Skip to content

Instantly share code, notes, and snippets.

@ackuser
Created February 2, 2018 20:08
Show Gist options
  • Select an option

  • Save ackuser/66a9908ada6981db682304b6f9bc6257 to your computer and use it in GitHub Desktop.

Select an option

Save ackuser/66a9908ada6981db682304b6f9bc6257 to your computer and use it in GitHub Desktop.
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