Token-0x

First Flight #54
Beginner FriendlyDeFi
100 EXP
Submission Details
Impact: low
Likelihood: low

Missing mint/burn Transfer events

Author Revealed upon completion

Description

The documentation states token will behave like an OpenZeppelin ERC20, but its implementation does not emit Transfer events on _mint() and _burn(), whereas OpenZeppelin’s _mint() and _burn() always emit Transfer(address(0), to, amount) and Transfer(from, address(0), amount)`

Recommended Mitigation

Updating the token’s mint and burn to follow the OpenZeppelin ERC20

function _mint(...) internal {
//...
mstore(ptr, value)
log3(
ptr,
0x20,
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef,
mload(0x60),
account)
}
function _burn(...) internal {
//...
mstore(ptr, value)
log3(
ptr,
0x20,
0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef,
account,
mload(0x60))
}

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!