Created
July 5, 2018 05:05
-
-
Save emurmotol/175469d9c04c6ee042a33d4d2a595df0 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.24+commit.e67f0147.js&optimize=false&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.24; | |
contract Escrow { | |
address public buyer; | |
address public seller; | |
address public arbiter; | |
constructor(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