This file contains hidden or 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.24; | |
contract Coin { | |
address owner; | |
uint public totalSupply = 1000; //sample initial supply | |
mapping (address => uint) public balances; | |
event Transfer(address indexed _to, address indexed _from, uint _value); |
This file contains hidden or 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.24; | |
contract Coin { | |
address owner; | |
uint public totalSupply = 1000; //sample initial supply | |
mapping (address => uint) public balances; | |
event Transfer(address indexed _to, address indexed _from, uint _value); |
This file contains hidden or 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.0; | |
contract Ballot { | |
struct Voter { | |
uint weight; | |
bool voted; | |
uint8 vote; | |
address delegate; | |
} | |
struct Proposal { |
This file contains hidden or 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.18; | |
contract Escrow { | |
address public buyer; // 0xC0ce1fD45a8aD881DB212e707404f00F4b134ca7 | |
address public seller; // 0x97d4cf5EAB11E92d5555D52ecBED3cCda13DF160 | |
address public arbiter; // 0xA3750c3cE35403b6157716a2C1C4C599843c020c | |
function Escrow(address _seller, address _arbiter) public { | |
buyer = msg.sender; |
This file contains hidden or 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.24; | |
contract Escrow { | |
address public buyer; | |
address public seller; | |
address public arbiter; | |
constructor(address _seller, address _arbiter) public { | |
buyer = msg.sender; |
This file contains hidden or 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.24; | |
contract Escrow { | |
address public buyer; | |
address public seller; | |
address public arbiter; | |
constructor(address _seller, address _arbiter) public { | |
buyer = msg.sender; |
This file contains hidden or 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.24; | |
contract Escrow { | |
address public buyer; | |
address public seller; | |
address public arbiter; | |
constructor(address _seller, address _arbiter) public { | |
buyer = msg.sender; |
This file contains hidden or 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.0; | |
/* | |
Simple escrow contract that mediates disputes using a trusted arbiter | |
*/ | |
contract Escrow { | |
enum State {AWAITING_PAYMENT, AWAITING_DELIVERY, COMPLETE, REFUNDED} | |
State public currentState; | |
This file contains hidden or 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.0; | |
/* | |
Simple escrow contract that mediates disputes using a trusted arbiter | |
*/ | |
contract Escrow { | |
enum State {AWAITING_PAYMENT, AWAITING_DELIVERY, COMPLETE, REFUNDED} | |
State public currentState; | |
This file contains hidden or 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.22; | |
contract Purchase { | |
address public seller; | |
modifier onlySeller() { // Modifier | |
require( | |
msg.sender == seller, | |
"Only seller can call this." | |
); |
NewerOlder