Created
February 2, 2018 20:08
-
-
Save ackuser/66a9908ada6981db682304b6f9bc6257 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.0; | |
| contract MyCoins { | |
| mapping(address => uint) balances; | |
| function MyCoins(address owner) public { | |
| balances[owner] = 1000000; | |
| } | |
| function tranferCoins(address sender, address receiver, uint amount) public { | |
| if ( balances[sender] >= amount ) { | |
| balances[sender] = balances[sender] - amount; | |
| balances[receiver] = balances[receiver] + amount; | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment