Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save DerayGa/0b75ab49259ee62d5aa3b5f11d908126 to your computer and use it in GitHub Desktop.

Select an option

Save DerayGa/0b75ab49259ee62d5aa3b5f11d908126 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];
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment