Skip to content

Instantly share code, notes, and snippets.

@emurmotol
Created July 5, 2018 15:07
Show Gist options
  • Save emurmotol/c5194c01640555add8ebcc361f75a956 to your computer and use it in GitHub Desktop.
Save emurmotol/c5194c01640555add8ebcc361f75a956 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=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;
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;
}
}
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