Skip to content

Instantly share code, notes, and snippets.

@thisiscodingnow
Created October 9, 2017 22:29
Show Gist options
  • Select an option

  • Save thisiscodingnow/5a4e621912d5acb6e06c742ffd9fed6c to your computer and use it in GitHub Desktop.

Select an option

Save thisiscodingnow/5a4e621912d5acb6e06c742ffd9fed6c to your computer and use it in GitHub Desktop.
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;
}
}
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;
}
}
@thisiscodingnow
Copy link
Copy Markdown
Author

a custodial contract

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment