Skip to content

Commit

Permalink
Fix burn hook
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacques Dafflon committed Nov 4, 2018
1 parent 1e29fbc commit cf071f1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contracts/ERC777BaseToken.sol
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,14 @@ contract ERC777BaseToken is ERC777Token, ERC820Implementer {
function doBurn(address _operator, address _tokenHolder, uint256 _amount, bytes _data, bytes _operatorData)
internal
{
callSender(_operator, _tokenHolder, 0x0, _amount, _data, _operatorData);

requireMultiple(_amount);
require(balanceOf(_tokenHolder) >= _amount, "Not enough funds");

mBalances[_tokenHolder] = mBalances[_tokenHolder].sub(_amount);
mTotalSupply = mTotalSupply.sub(_amount);

callSender(_operator, _tokenHolder, 0x0, _amount, _data, _operatorData);
emit Burned(_operator, _tokenHolder, _amount, _data, _operatorData);
}

Expand Down

0 comments on commit cf071f1

Please sign in to comment.