Description
In the `FestivalPass::configurePass` function, the contract resets the current supply `passSupply[passId]`
to zero every time the pass configuration is updated, without checking whether tokens have already been minted:
```javascript
passSupply[passId] = 0;
```
This opens up a supply misrepresentation issue, where an organizer can reset supply tracking and mint more
tokens than intended, bypassing maxSupply logic.
Risk
Impact:
1. Reset supply to 0 after some tokens are minted.
2. Set a new maxSupply (possibly smaller or larger).
3. Continue minting, violating original supply caps.
This creates a trust and fairness issue in the tokenomics of the pass system.
Proof of Concept
```javascript
festivalPass.configurePass(VIP_PASS, 1 ether, 100);
for (uint i = 0; i < 80; i++) {
festivalPass.buyPass{value: 1 ether}(VIP_PASS);
}
festivalPass.configurePass(VIP_PASS, 1 ether, 50);
for (uint i = 0; i < 50; i++) {
festivalPass.buyPass{value: 1 ether}(VIP_PASS);
}
```
- Over-minting of VIP, BACKSTAGE, or GENERAL passes
- Violates capped supply assumptions
- Affects token value, secondary market trust, and user confidence
- Could be abused by malicious or negligent organizers
Recommended Mitigation
```diff
function configurePass(
uint256 passId,
uint256 price,
uint256 maxSupply
) external onlyOrganizer {
require(passId == GENERAL_PASS || passId == VIP_PASS || passId == BACKSTAGE_PASS, "Invalid pass ID");
require(price > 0, "Price must be greater than 0");
require(maxSupply > 0, "Max supply must be greater than 0");
passPrice[passId] = price;
passMaxSupply[passId] = maxSupply;
- passSupply[passId] = 0; // Reset current supply
}
```