Created
October 30, 2017 03:04
-
-
Save basil2style/4ffaafddc9e732620bdde0110a792fdf 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 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