ERC20Internals::_balanceOf and ERC20Internals::_allowance forcibly revert, breaking the ERC20 standard and causing unexpected reverts in tools, wallets, and protocols that rely on these queriesIn a standard ERC20, the balanceOf and allowance functions must always return a valid value regardless of the address provided, including address(0), and must never revert.
In this implementation, _balanceOf and _allowance revert when any parameter is address(0), which contradicts ERC20 behavior and causes unexpected reverts in tools and integrations that rely on these standard queries.
Likelihood: Medium
This occurs whenever a wallet, explorer, or protocol makes standard queries like balanceOf() or allowance().
Tools that iterate addresses or perform general checks on balances and allowances will regularly encounter address(0).
Impact: Low
Does not put funds at risk, but causes unexpected reverts in view queries that the ecosystem expects to always succeed.
Can prevent wallets, explorers, or integrations from displaying or using the token correctly, severely degrading ERC20 compatibility.
The following test shows that balanceOf and allowance revert when any parameter is address(0).
This confirms that the token's view queries do not follow the ERC20 standard, which requires always returning a uint256 and never reverting for valid domain addresses, including 0x0000000000000000000000000000000000000000.
Remove the checks that force revert when any parameter is address(0), as ERC20 requires that balanceOf and allowance always return a valid value. The functions should handle 0x0 like any other address and return 0 instead of reverting.
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.