Skip to content

Commit

Permalink
implement _burn()
Browse files Browse the repository at this point in the history
  • Loading branch information
TamaraRingas committed Aug 28, 2024
1 parent 947d8b8 commit 0f64286
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/world-module-erc20-own-store/src/MUDERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,20 @@ contract MUDERC20 is Store, IERC20Errors, IERC20Events {
_update(from, to, value);
}

/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}

/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
Expand Down

0 comments on commit 0f64286

Please sign in to comment.