Skip to content

Instantly share code, notes, and snippets.

@Gribnik2K
Created September 20, 2020 12:50
Show Gist options
  • Save Gribnik2K/d0d424381743b8f7a033de8c224df956 to your computer and use it in GitHub Desktop.
Save Gribnik2K/d0d424381743b8f7a033de8c224df956 to your computer and use it in GitHub Desktop.
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