File Scope: src/helpers/ERC20Internals.sol
Normal Behavior: Many ERC20 integrations (indexers, explorers, tooling) call balanceOf(address(0)) to check burn/mint accounting or display placeholders. ERC20 implementations typically return 0 for the zero address rather than revert.
Specific Issue: Token-0x's _balanceOf reverts when owner == address(0). This diverges from prevailing practice and breaks consumer assumptions, causing unnecessary failures in tooling and protocol integrations that query the zero address.
Likelihood:
Tooling and indexers frequently query balanceOf(address(0)) during UI updates and analytics.
DeFi protocols occasionally perform sanity checks involving the zero address balance.
Impact:
UI/Indexer Errors: Wallets/Explorers (and The Graph subgraphs) can crash or show errors instead of rendering balances.
Compatibility: Non-standard behavior reduces drop-in compatibility vs. widely used ERC20s (e.g., OpenZeppelin), increasing integration friction.
Test file: BalanceOfZero.t.sol
Behavior: token.balanceOf(address(0)) reverts as expected; test asserts with vm.expectRevert().
Return 0 for address(0) in _balanceOf to align with ecosystem expectations.
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.