Token-0x

First Flight #54
Beginner FriendlyDeFi
100 EXP
Submission Details
Impact: medium
Likelihood: medium

Missing totalSupply Decrement on Burn Causes Supply Mismatch

Author Revealed upon completion

Root + Impact

Description

  • The burn/burnFrom logic (direct or indirect) does not securely decrement totalSupply.
    This violates ERC-20 and leads to permanent supply inflation or inaccurate circulating supply.

// Example from ERC20Internals or Token0x burn logic
function _burn(address from, uint256 value) internal {
// @> missing: totalSupply -= value
// Supply remains artificially high
_balances[from] -= value;
}

Risk

Likelihood:

  • Any burn, redemption, or deflation mechanism will trigger incorrect supply.

Impact:

  • Breaking ERC-20 invariants.

Incorrect market cap / liquidity calculations.

  • DeFi integrations rejecting the token.

  • Inflation of effective circulating supply.

Proof of Concept

function testBurnSupplyMismatch() external {
token.mint(user, 1000 ether);
token.burn(1000 ether);
// totalSupply stays the same
assertEq(token.totalSupply(), 1000 ether); // ❌ should be 0
}

Recommended Mitigation

- remove this code
+ add this code
- // burn without reducing supply
- _balances[from] -= value;
+ _balances[from] -= value;
+ totalSupply = totalSupply - value; // strictly decrement supply

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.

Give us feedback!