ERC20Internals::_burn subtracts the user's balance without checking if it is sufficient, causing arithmetic underflowIn an ERC20, _burn must check that the account has enough balance before subtracting, reverting with a clear error if balance < amount.
In this implementation, _burn subtracts the balance directly without any prior check, causing automatic underflow.
Likelihood: Medium
The error occurs whenever _burn receives an amount greater than the account's actual balance.
Any internal or external call using _burn without prior balance validation will immediately cause an underflow.
Impact: High
Underflow in Yul does not revert and causes wrap-around, leaving the account with a massively inflated balance.
It also incorrectly alters totalSupply, completely breaking the basic ERC20 invariants and affecting system integrity.
This test demonstrates that _burn does not check if the user has enough balance: when more is burned than owned, Yul underflow inflates the user's balance to a huge value instead of reverting.
Add a prior check to validate that the account has enough balance before performing the subtraction. If value exceeds the available balance, the function should revert with the appropriate error to prevent underflow and maintain ERC20 invariants.
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.