-
Build a smart contract using the Solidity programming language
-
The contract must have a minimum of 4 functions
-
The contract must utilize a minimum of 1 data structure (array, mapping)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
contract EthStorage { | |
uint maxWithdrawl = 1 ether; | |
mapping(address => uint) public balances; | |
function deposit() public payable { | |
balances[msg.sender] += msg.value; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
interface ERC777Token { | |
function name() public view returns (string); | |
function symbol() public view returns (string); | |
function totalSupply() public view returns (uint256); | |
function balanceOf(address owner) public view returns (uint256); | |
function granularity() public view returns (uint256); | |
function defaultOperators() public view returns (address[]); | |
function authorizeOperator(address operator) public; | |
function revokeOperator(address operator) public; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.20; | |
/// @title ERC-721 Non-Fungible Token Standard | |
/// @dev See https://github.com/ethereum/EIPs/blob/master/EIPS/eip-721.md | |
/// Note: the ERC-165 identifier for this interface is 0x80ac58cd. | |
interface ERC721 /* is ERC165 */ { | |
/// @dev This emits when ownership of any NFT changes by any mechanism. | |
/// This event emits when NFTs are created (`from` == 0) and destroyed | |
/// (`to` == 0). Exception: during contract creation, any number of NFTs | |
/// may be created and assigned without emitting Transfer. At the time of |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.9; | |
/* New ERC223 contract interface */ | |
contract ERC223 { | |
uint public totalSupply; | |
function balanceOf(address who) public view returns (uint); | |
function name() public view returns (string _name); | |
function symbol() public view returns (string _symbol); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ---------------------------------------------------------------------------- | |
// ERC Token Standard #20 Interface | |
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20.md | |
// ---------------------------------------------------------------------------- | |
contract ERC20Interface { | |
function totalSupply() public view returns (uint); | |
function balanceOf(address tokenOwner) public view returns (uint balance); | |
function allowance(address tokenOwner, address spender) public view returns (uint remaining); | |
function transfer(address to, uint tokens) public returns (bool success); | |
function approve(address spender, uint tokens) public returns (bool success); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.5.2; | |
contract Crowdfunding { | |
address payable beneficiary; | |
uint goalInEther; | |
uint deadline; | |
mapping (address => uint) public contributions; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity 0.5.2; | |
contract Escrow { | |
//state variables | |
address payable buyer; | |
address payable seller; | |
address arbiter; | |
uint public amountInWei; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.2; | |
contract HelloWorld { | |
uint public num; | |
event NewNum(address indexed _who, uint _newNum, uint _timestamp); | |
constructor(uint _num) public { | |
num = _num; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.25; | |
contract Escrow { | |
address public buyer; | |
address public seller; | |
address public arbiter; | |
uint256 public escrowAmount; | |
constructor(address _buyer, address _arbiter, uint256 _escrowAmount) public { |
NewerOlder