_burnThe burn function should decrease the user's balance and total supply, reverting if the user has insufficient balance.
The _burn function uses assembly to subtract the value from the balance and supply without checking if the result underflows (i.e., if balance < value).
Likelihood:
High // Any user can call burn on their own address.
Impact:
High// A user with 0 tokens can burn tokens to underflow their balance to 2^256 - 1 (effectively infinite tokens).
High // totalSupply will also underflow, breaking token accounting.
For subtraction, we must ensure that the value being subtracted is not greater than the value it is being subtracted from. In Yul, sub(a, b) wraps on underflow if b > a. We add an explicit check lt(supply, value) (is supply < value?) to detect this condition and revert.
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.