Created
July 5, 2018 16:31
-
-
Save emurmotol/66d99c262e33a4ce7ae90a5eb700a2ae to your computer and use it in GitHub Desktop.
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=
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; | |
seller = _seller; | |
arbiter = _arbiter; | |
} | |
function paySeller() public { | |
if(msg.sender == buyer || msg.sender == arbiter) { | |
seller.transfer(address(this).balance); | |
} | |
} | |
function refundBuyer() public { | |
if(msg.sender == seller || msg.sender == arbiter) { | |
buyer.transfer(address(this).balance); | |
} | |
} | |
function fund() public payable returns (bool) { | |
return true; | |
} | |
function getBalance() public constant returns (uint) { | |
return address(this).balance; | |
} | |
} |
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 Storage { | |
uint storedData; | |
function set(uint x) public { | |
storedData = x; | |
} | |
function get() public view returns (uint) { | |
return storedData; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment