Skip to content

Commit

Permalink
EcoBurning added
Browse files Browse the repository at this point in the history
  • Loading branch information
salemalem committed Jul 23, 2021
1 parent efcfb6b commit 5c892d7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions trc20token.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,13 @@ contract TRC20 {

function transfer(address _to, uint256 _value) public returns(bool success) {
_transfer(msg.sender, _to, _value);

return true;
}

// 3rd party can spend someone's fund if that person approved it using approve function
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success) {
require(_value <= allowance[_from][msg.sender]);
_transfer(_from, _to, _value);

return true;
}

Expand All @@ -60,4 +58,15 @@ contract TRC20 {

return true;
}

// disappear from blockchain supply forever
function ecoburn(uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
totalSupply -= _value;

emit EcoBurn(msg.sender, _value);

return true;
}
}

0 comments on commit 5c892d7

Please sign in to comment.