The configurePass() function permits the organizer to decrease maxSupply to a value lower than the number of passes already minted and in circulation.
There is no validation to ensure that the new maxSupply is at least equal to the current passSupply\[passId]. This directly violates the fundamental token invariant:
Total circulating supply must never exceed the declared maximum supply
Even without considering the separate critical bug of resetting passSupply to 0, this lack of check alone allows the declared maxSupply to fall below the actual number of existing passes — rendering the cap meaningless and misleading.
High severity: Breaks a core economic and security invariant of capped token supplies.
Misleading protocol state: Users and frontends reading passMaxSupply will believe fewer passes can exist than actually do.
Loss of trust: VIP and Backstage passes are marketed as limited/rare — this undermines scarcity guarantees.
Centralized risk: Only the organizer can trigger this, but it represents a critical design flaw with economic consequences.
Compounds with supply reset bug: When combined with the passSupply = 0 reset (separate finding), it enables unlimited minting.
The following Foundry test passes on the current code and clearly demonstrates the invariant violation:
solidity
Test Result:
text
The invariant actual circulating supply ≤ maxSupply is permanently broken.
Add a strict safety check before updating maxSupply:
solidity
This change:
Prevents the invariant violation
Allows price changes and maxSupply increases safely
Has negligible gas overhead
Aligns with standard practices in capped token systems
The contest is live. Earn rewards by submitting a finding.
Submissions are being reviewed by our AI judge. Results will be available in a few minutes.
View all submissionsThe contest is complete and the rewards are being distributed.