Skip to content

Instantly share code, notes, and snippets.

@k0kk0k
Last active September 14, 2020 15:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save k0kk0k/afb69f9c86648f41cb8636642208fbb0 to your computer and use it in GitHub Desktop.
Save k0kk0k/afb69f9c86648f41cb8636642208fbb0 to your computer and use it in GitHub Desktop.
very simple token
pragma solidity >=0.5.12;
contract UshakovToken {
mapping(address => uint256) balances;
uint256 public totalSupply = 0;
function transfer(address _to, uint256 _value) public returns (bool success) {
if (balances[msg.sender] >= _value && balances[_to] + _value > balances[_to]) {
balances[msg.sender] -= _value;
balances[_to] += _value;
return true;
} else { return false; }
}
function balanceOf(address _owner) public view returns (uint256 balance) {
return balances[_owner];
}
function mint(uint256 _value) public {
balances[msg.sender] += _value;
totalSupply += _value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment