The BeatToken
contract is a custom ERC20 used to distribute and burn tokens for a festival ecosystem. It includes a setFestivalContract()
function, which allows the token to authorize one FestivalPass
contract for minting and burning BEAT tokens.
However, this function uses a hard require
condition to prevent any updates once the festivalContract
is set. This design is reinforced by a comment in the code:
This enforces single-use behavior and prevents reusing the same token contract for future festivals, seasonal upgrades, or contract migrations. If the current FestivalPass
contract becomes outdated, the BEAT token becomes locked to that logic, forcing the organizer to deploy a new token, fragmenting balances and user trust.
Likelihood:
Happens when organizers wish to upgrade to a new FestivalPass
contract for a new season or fix vulnerabilities.
Happens when the token is expected to outlive a specific contract (e.g., to support multiple festivals or future integrations).
Impact:
Limits the ability to maintain and upgrade the ecosystem over time.
Causes token fragmentation, requiring airdrops or manual token migrations.
Breaks user continuity for holders of BEAT tokens across seasons or dApps.
Organizers cannot reuse the BEAT token for a future upgraded festival logic, forcing them to deploy a new incompatible token.
Implement an owner-controlled update mechanism that allows the authorized festival contract to be updated securely.
Explanation:
setFestivalContract()
ensures safe one-time setup of the initial logic.
updateFestivalContract()
gives the owner controlled upgrade flexibility while maintaining traceability via events.
This preserves security while avoiding token lock-in or re-deployment costs.
Benefits of this approach:
Still restricts minting and burning to one contract at a time.
Allows the owner to update it when necessary (e.g., in case of upgrades or bug fixes).
Emits an event to track updates.
Maintains forward compatibility and reduces token fragmentation.
Use a whitelist pattern to allow multiple trusted festival contracts to interact with the token, controlled by the owner.
authorizeFestival()
allows the owner to add a new approved contract (e.g., for future festivals or upgrades).
revokeFestival()
enables access control and deactivation.
mint()
and burnFrom()
now enforce that only authorized contracts can interact with token supply.
The system supports safe upgradeability and multi-festival use, while still being owner-controlled.
This is intended. It's done like that because the festival contract requires beat token's address and vice versa.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.