Created
October 9, 2017 22:29
-
-
Save thisiscodingnow/5a4e621912d5acb6e06c742ffd9fed6c to your computer and use it in GitHub Desktop.
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.11; | |
| contract CustodialContract{ | |
| address client; | |
| bool _switch = false; | |
| function CustodialContract(){ | |
| client = msg.sender; | |
| } | |
| modifier ifClient(){ | |
| if(msg.sender != client){ | |
| throw; | |
| } | |
| _; | |
| } | |
| function depositFunds() payable { | |
| } | |
| function withdrawFunds(uint amount) ifClient { | |
| if(client.send(amount)){ | |
| _switch = true; | |
| } | |
| else{ | |
| _switch = false; | |
| } | |
| } | |
| function getFunds() ifClient constant returns(uint){ | |
| return 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.11; | |
| contract CustodialContract{ | |
| address client; | |
| bool _switch = false; | |
| function CustodialContract(){ | |
| client = msg.sender; | |
| } | |
| modifier ifClient(){ | |
| if(msg.sender != client){ | |
| throw; | |
| } | |
| _; | |
| } | |
| function depositFunds() payable { | |
| } | |
| function withdrawFunds(uint amount) ifClient { | |
| if(client.send(amount)){ | |
| _switch = true; | |
| } | |
| else{ | |
| _switch = false; | |
| } | |
| } | |
| function getFunds() ifClient constant returns(uint){ | |
| return this.balance; | |
| } | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
a custodial contract