The _mint() and _burn() functions do not emit Transfer events as required by EIP-20.
According to the standard, minting should emit Transfer(address(0), to, value) and burning should emit Transfer(from, address(0), value).
Likelihood:
Every mint and burn operation triggers this issue
100% occurrence rate for these operations
Impact:
Block explorers (Etherscan) won't show mint/burn transactions
Wallets display incorrect transaction history
DeFi protocols relying on Transfer events for supply tracking will malfunction
The Graph indexers will have incomplete data
This test uses Foundry's vm.recordLogs() to capture all events emitted during a mint operation. After minting tokens, we iterate through the recorded logs searching for the Transfer event topic. The test confirms that no Transfer event is emitted, breaking EIP-20 compliance.
Place this test in test/MissingEventsPOC.t.sol and run with forge test --match-test test_MintDoesNotEmitTransferEvent -vv:
Add log3 calls to emit the Transfer event at the end of both _mint() and _burn(). For minting, the from address should be address(0). For burning, the to address should be address(0). This matches OpenZeppelin's implementation and EIP-20 requirements.
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.