A standard balanceOf function should allow querying the balance of any valid address, including the zero address (address(0)). This is a common practice in ERC20 standards, where the zero address typically represents burned or unallocated tokens.
The function immediately reverts when the input address is the zero address, causing external calls to token.balanceOf(address(0)) to fail. This violates the expected behavior of the standard ERC20 interface and may impact on-chain applications or monitoring tools that rely on querying the zero address balance.
Likelihood:
Any external contract or user attempting to query the zero address balance (e.g., for common operations such as calculating total circulating supply or burned token amount) will trigger a revert.
Frontend applications, blockchain explorers, or monitoring services will encounter transaction failures when attempting to read the zero address balance by default.
Impact:
Breaks compatibility with the ERC20 standard, leading to unexpected errors in third-party integrations that rely on standard behavior (e.g., wallets, exchanges, DeFi protocols).
Impedes transparent tracking of token economic data. For example, it becomes impossible to obtain the amount of burned tokens held by the zero address through a simple call, affecting the visibility of the token economic model.
Add the function test_1_balanceOf_AddressZero in Token.t.sol as follows:
Execute the command: forge test --mt test_1_balanceOf_AddressZero -vvvv
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.