Created
September 20, 2020 12:50
-
-
Save Gribnik2K/d0d424381743b8f7a033de8c224df956 to your computer and use it in GitHub Desktop.
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 SKALPToken { | |
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; | |
} | |
function burn(uint256 _value) public returns (bool success) { | |
if (balances[msg.sender] >= _value) { | |
balances[msg.sender] -= _value; | |
totalSupply -= _value; | |
return true; | |
} else { return false; } | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment