Created
February 17, 2018 23:45
-
-
Save michielmulders/75da31bbfb7583828ac6f0cfd6fb9ac2 to your computer and use it in GitHub Desktop.
ERC777 Burn implementation interface Ethereum
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
/// @notice Burns `_amount` tokens from `_tokenHolder` | |
/// Sample burn function to showcase the use of the `Burned` event. | |
/// @param _tokenHolder The address that will lose the tokens | |
/// @param _amount The quantity of tokens to burn | |
function burn(address _tokenHolder, uint256 _amount, bytes _userData, bytes _operatorData) public onlyOwner { | |
requireMultiple(_amount); | |
require(balanceOf(_tokenHolder) >= _amount); | |
mBalances[_tokenHolder] = mBalances[_tokenHolder].sub(_amount); | |
mTotalSupply = mTotalSupply.sub(_amount); | |
Burned(msg.sender, _tokenHolder, _amount, _userData, _operatorData); | |
if (mErc20compatible) { Transfer(_tokenHolder, 0x0, _amount); } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment