Summary
Every creator on the platform currently has unlimited key supply determined only by demand. Some creators may want to hard-cap the number of keys that can ever exist for them — creating genuine scarcity that cannot be undone. Adding an optional max_supply field at registration gives creators this control at the contract level, enforced on-chain with no way for anyone to override it after the fact.
Scope
- Add optional
max_supply: Option<u32> parameter to register_creator
- If
None, supply is uncapped (current behavior, fully backwards-compatible)
- If
Some(n), the value is stored in creator state and n must be greater than zero
- At the start of
buy, check if current_supply + amount_to_buy > max_supply and panic with a new SupplyCapExceeded error if true
- Add
get_max_supply(creator_id) -> Option<u32> view function
- The cap is immutable after registration — no function may update it
Acceptance Criteria
Coordinate on Telegram
Summary
Every creator on the platform currently has unlimited key supply determined only by demand. Some creators may want to hard-cap the number of keys that can ever exist for them — creating genuine scarcity that cannot be undone. Adding an optional
max_supplyfield at registration gives creators this control at the contract level, enforced on-chain with no way for anyone to override it after the fact.Scope
max_supply: Option<u32>parameter toregister_creatorNone, supply is uncapped (current behavior, fully backwards-compatible)Some(n), the value is stored in creator state andnmust be greater than zerobuy, check ifcurrent_supply + amount_to_buy > max_supplyand panic with a newSupplyCapExceedederror if trueget_max_supply(creator_id) -> Option<u32>view functionAcceptance Criteria
Nonebehaves identically to current behaviorSome(0)is rejected with an appropriate errorSupplyCapExceededget_max_supplyreturnsNonefor uncapped creators and the cap value for capped onesCoordinate on Telegram