Skip to content

Instantly share code, notes, and snippets.

@noeleon930
Last active November 9, 2016 10:52
Show Gist options
  • Select an option

  • Save noeleon930/6fbe3effffba92241f7b4957e4ac3f66 to your computer and use it in GitHub Desktop.

Select an option

Save noeleon930/6fbe3effffba92241f7b4957e4ac3f66 to your computer and use it in GitHub Desktop.
pragma solidity ^0.4.0;
contract NccuBank {
address public minter;
mapping (address => uint) public balances;
event Sent(address from, address to, uint amount);
function NccuBank() {
minter = msg.sender;
}
function mint(address receiver, uint amount) returns (bool) {
if (msg.sender != minter) return false;
balances[receiver] += amount;
return true;
}
function _send(address receiver, uint amount) returns (bool) {
if (balances[msg.sender] < amount) return false;
balances[msg.sender] -= amount;
balances[receiver] += amount;
Sent(msg.sender, receiver, amount);
return true;
}
function check() constant returns (uint) {
return balances[msg.sender];
}
}
@noeleon930
Copy link
Copy Markdown
Author

0xca35b7d915458ef540ade6068dfe2f44e8fa733c
0x14723a09acff6d2a60dcdf7aa4aff308fddc160c
0x4b0897b0513fdc7c541b6d9d7e929c4e5364d2db
0x583031d1113ad414f02576bd6afabfb302140225
0xdd870fa1b7c4700f2bd7f44238821c26f7392148

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