Reproduced Exploit

Pepper — minting limit uses `totalSupply`, blocking legitimate minter airdrops

1. mint (MINTER_ROLE) caps against global totalSupply, intended as a 40% airdrop budget. 2. claim also increases totalSupply outside that role. 3. After claims alone hit MINT_LIMIT, minter airdrops revert even if minters minted 0. 4. HARM: planned airdrop of 500 tokens is blocked forever (liveness/…

Aug 2024Otherlogic2 min read

Chain

Other

Category

logic

Date

Aug 2024

Source

AuditVault

EVM Playground

Source-level debugger — step opcodes and Solidity in sync

evm-hack-analyzer

The attack is replayed in an in-browser EVM preloaded with the exact dumped fork state. The execution tree shows every call; step by Solidity line or by opcode across all depths — source, Stack, Memory, Storage, Balances (native / ERC-20 / NFT), Transient storage and Return value stay in sync. Click a tree node, opcode, or source line to jump. No backend, no live RPC.

Loading fork state…

Source & credit. Reproduction of a public audit finding curated by AuditVault — the original finding: 52222-minting-limit-calculation-may-prevent-legitimate-claims-halb. Standalone Foundry PoC and full write-up: 52222-minting-limit-calculation-may-prevent-legitimate-claims-halb_exp in the evm-hack-registry mirror.


Vulnerability classes: vuln/logic/wrong-condition · vuln/mint/shared-cap · genome: wrong-condition · permanent · reward-accounting

Reproduction: self-contained Foundry PoC with only forge-std. Full trace: output.txt. PoC: test/52222-minting-limit-calculation-may-prevent-legitimate-claims-halb_exp.sol.

AuditVault taxonomy: lang/solidity · platform/halborn · has/poc · severity/high · sector/staking · sector/token · genome: wrong-condition · permanent · reward-accounting


Key info#

ImpactHIGH — once claims (or any non-minter mint path) push totalSupply to 40% of max, MINTER_ROLE airdrops permanently revert
ProtocolPepper
Vulnerable codemintrequire(totalSupply() + amount <= MINT_LIMIT)
Bug classShared cap across independent mint paths
FindingHalborn — Pepper · #52222
Reporthalborn.com/audits/pepper/pepper
SourceAuditVault
StatusAudit finding — fixed with separate minterRoleMintedAmount tracker. Local synthetic PoC.
Compiler^0.8.24 (PoC)

TL;DR#

  1. mint (MINTER_ROLE) caps against global totalSupply, intended as a 40% airdrop budget.
  2. claim also increases totalSupply outside that role.
  3. After claims alone hit MINT_LIMIT, minter airdrops revert even if minters minted 0.
  4. HARM: planned airdrop of 500 tokens is blocked forever (liveness/availability).

The vulnerable code#

SOLIDITY
function mint(address to, uint256 amount) public {
    require(hasRole(MINTER_ROLE, msg.sender), "Must have minter role to mint");
    uint256 _amount = totalSupply() + amount;
    require(_amount <= MINT_LIMIT, "Minting exceeds 40% of total supply"); // @> VULN
    ...
}

Root cause#

The 40% budget was meant for controlled minter mints but is enforced on the sum of all supply sources.

Preconditions#

  • Claim (or other non-minter) mint path can grow supply toward MINT_LIMIT.
  • Airdrop still needs to call mint afterward.

Attack walkthrough#

  1. User claims CLAIM_AMOUNT == MINT_LIMIT (40% of max).
  2. Minter calls mint(recipient, 500 ether) → reverts.
  3. HARM: legitimate airdrop permanently blocked.

Diagrams#

flowchart LR Claim["claim path grows totalSupply"] --> Cap["totalSupply == MINT_LIMIT"] Cap --> Block["mint by MINTER_ROLE reverts"] Block --> Harm["airdrop recipients unpaid"]

Impact#

Disrupted token distribution / airdrops; entitled users never receive minter-path tokens.

Sources#


Sources & further analysis#

Reproductions & code

Alerts & third-party analyses

  • Web3Sec X hacked database: search.
  • Rekt leaderboard: search.
  • Solodit incident search: search.

These dashboards index community alerts tweets, post-mortems, and independent write-ups. Reach them through the protocol name above to cross-check this reproduction against other analyses.