Advertisement
Guest User

Untitled

a guest
May 26th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. pragma solidity ^0.4.17;
  2.  
  3. //todo: actually confirm that the withdraw is from the correct user
  4. contract Escrow {
  5. address public creator;
  6. address public owner;
  7.  
  8. modifier onlyOwner {
  9. require(msg.sender == owner);
  10. _;
  11. }
  12.  
  13. constructor(address _creator, address _owner) public {
  14. creator = _creator;
  15. owner = _owner;
  16. }
  17.  
  18. function info() public view returns(address, address, uint) {
  19. return (creator, owner, address(this).balance);
  20. }
  21.  
  22. function withdraw() onlyOwner public {
  23. msg.sender.transfer(address(this).balance);
  24. }
  25.  
  26. function deposit(uint256 amount) payable public {
  27. require(msg.value == amount);
  28. //nothing here
  29. }
  30.  
  31. function getBalance() public view returns (uint256) {
  32. return address(this).balance;
  33. }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement