Skip to content

Instantly share code, notes, and snippets.

@basil2style
Created October 30, 2017 03:04
Show Gist options
  • Select an option

  • Save basil2style/4ffaafddc9e732620bdde0110a792fdf to your computer and use it in GitHub Desktop.

Select an option

Save basil2style/4ffaafddc9e732620bdde0110a792fdf to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.11;
contract PayableContract {
address client;
bool _switch = false;
function PayableContract() {
client = msg.sender;
}
function depositFunds() payable {
//To deposit ether on account
}
modifier ifClient() {
if(client != msg.sender) {
throw;
}
else {
_;
}
}
function withdrawfunds(uint amount) ifClient{
if(client.send(amount)) {
_switch = true;
}
else {
_switch = false;
}
}
function getFunds() ifClient constant returns(uint) {
return this.balance;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment