Transfer Events in mint and burn Operations Causes Non-Standard Behavior for a Functional ERC20 TokenIn a standard ERC20, after executing the logic of mint and burn, a Transfer event must be emitted from or to address(0) to correctly reflect the operation.
In this contract, although the logic for mint and burn is executed, no Transfer event is emitted, which prevents these operations from being detected by tools that rely on ERC20 events.
Likelihood: Medium
This occurs every time the contract or a child contract performs mint or burn, since these operations do not emit the expected event.
Any off-chain tool that tries to read the supply or token history based on events will immediately fail.
Impact: Low
The operations are correct on-chain, but tools that depend on events will not detect mints or burns.
Protocols inheriting this implementation may experience unexpected behavior or incomplete data.
This test validates that the mint and burn functions correctly update balances and totalSupply, but do not emit any Transfer event.
All logs are recorded during execution and then checked to ensure none contain the Transfer topic, demonstrating that the contract does not follow the standard behavior expected by the ERC20 ecosystem.
Add emission of the Transfer event after completing the logic of mint and burn, using log3 with address(0) as sender or receiver as appropriate. This will align the contract's behavior with widely used ERC20 implementations and ensure compatibility with off-chain tools.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.
The contest is complete and the rewards are being distributed.