Under standard ERC20 behavior, querying the balance of an account or the allowance between two addresses is a harmless view operation that never reverts. When address(0) is used, the expected behavior is simply to return 0:
balanceOf(address(0)) → 0
allowance(address(0), spender) → 0
allowance(owner, address(0)) → 0
In this implementation, both _balanceOf and _allowance revert when given address(0):
_balanceOf reverts if owner == address(0)
_allowance reverts if owner == address(0) or spender == address(0)
Calls will revert in cases where a normal ERC20 would safely return 0. This breaks expected ERC20 read semantics and can affect integrations or tooling that rely on zero-address queries being safe.
Likelihood: Medium
Zero-address balance and allowance reads occur in both on-chain validation paths and off-chain tooling. Because ERC20s normally return 0 for these cases, unexpected reverts can to appear during real integrations.
Impact: Low
The issue does not threaten funds or core token functionality, but it does cause unnecessary reverts in systems that assume ERC20-standard behavior. This reduces compatibility and may require special-case handling for this token.
Remove the zero-address checks in _balanceOf and _allowance.
The _balances mapping is never updated for address(0) in _burn and _transfer reverts if it is to or from address(0), so it will always return 0.
Similarly, _approve reverts when owner or spender is address(0), so _allowance can safely rely on the default mapping value and will return 0 when either is address(0).
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.