Last active
September 14, 2020 15:11
-
-
Save k0kk0k/afb69f9c86648f41cb8636642208fbb0 to your computer and use it in GitHub Desktop.
very simple token
This file contains 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.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