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/…
Chain
Other
Category
logic
Date
Aug 2024
Source
AuditVault
EVM Playground
Source-level debugger — step opcodes and Solidity in sync
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.
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-registrymirror.
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#
| Impact | HIGH — once claims (or any non-minter mint path) push totalSupply to 40% of max, MINTER_ROLE airdrops permanently revert |
| Protocol | Pepper |
| Vulnerable code | mint — require(totalSupply() + amount <= MINT_LIMIT) |
| Bug class | Shared cap across independent mint paths |
| Finding | Halborn — Pepper · #52222 |
| Report | halborn.com/audits/pepper/pepper |
| Source | AuditVault |
| Status | Audit finding — fixed with separate minterRoleMintedAmount tracker. Local synthetic PoC. |
| Compiler | ^0.8.24 (PoC) |
TL;DR#
mint(MINTER_ROLE) caps against globaltotalSupply, intended as a 40% airdrop budget.claimalso increasestotalSupplyoutside that role.- After claims alone hit
MINT_LIMIT, minter airdrops revert even if minters minted 0. - HARM: planned airdrop of 500 tokens is blocked forever (liveness/availability).
The vulnerable code#
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
mintafterward.
Attack walkthrough#
- User claims
CLAIM_AMOUNT == MINT_LIMIT(40% of max). - Minter calls
mint(recipient, 500 ether)→ reverts. - HARM: legitimate airdrop permanently blocked.
Diagrams#
Impact#
Disrupted token distribution / airdrops; entitled users never receive minter-path tokens.
Sources#
- AuditVault finding #52222
- Halborn report — Pepper
- Remediation hash:
bccbd7a5747d4ef6586581ec93ac77e0d8a4de45
Sources & further analysis#
Reproductions & code
- Standalone PoC + full trace: 52222-minting-limit-calculation-may-prevent-legitimate-claims-halb_exp (evm-hack-registry mirror).
- AuditVault finding: 52222-minting-limit-calculation-may-prevent-legitimate-claims-halb.
Alerts & third-party analyses
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.