Skip to content

Instantly share code, notes, and snippets.

View emurmotol's full-sized avatar
😎
I may be slow to respond.

emurmotol

😎
I may be slow to respond.
View GitHub Profile
@emurmotol
emurmotol / Coin.sol
Created July 7, 2018 09:32
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
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);
@emurmotol
emurmotol / Coin.sol
Created July 7, 2018 07:20
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
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);
@emurmotol
emurmotol / ballot.sol
Created July 6, 2018 07:13
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.0;
contract Ballot {
struct Voter {
uint weight;
bool voted;
uint8 vote;
address delegate;
}
struct Proposal {
@emurmotol
emurmotol / escrow.sol
Created July 5, 2018 16:31
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.18+commit.9cf6e910.js&optimize=true&gist=
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;
@emurmotol
emurmotol / escrow.sol
Created July 5, 2018 15:07
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=true&gist=
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;
@emurmotol
emurmotol / escrow.sol
Created July 5, 2018 05:22
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
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;
@emurmotol
emurmotol / escrow.sol
Created July 5, 2018 05:05
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
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;
@emurmotol
emurmotol / escrow-1509481350616.sol
Created July 4, 2018 09:59
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
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;
@emurmotol
emurmotol / escrow-1509481350616.sol
Created July 4, 2018 09:57
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
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;
@emurmotol
emurmotol / inDepth.sol
Created July 4, 2018 09:48
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.4.24+commit.e67f0147.js&optimize=false&gist=
pragma solidity ^0.4.22;
contract Purchase {
address public seller;
modifier onlySeller() { // Modifier
require(
msg.sender == seller,
"Only seller can call this."
);