Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Impact: medium
Likelihood: low
Invalid

BeatToken: Festival Contract Address Can Only Be Set Once

Root + Impact

Description

  • The setFestivalContract(address _festival) function allows the owner to set the address of the festival contract that can mint and burn BEAT tokens.

    Explain the specific issue:

    • The function can only be called once, as it checks require(festivalContract == address(0), "Festival contract already set");.

    • This means the token contract cannot be reused for future festivals, and if the festival contract is upgraded or redeployed due to a bug, the token contract becomes unusable.

    • If the festival contract is compromised or lost, there is no way to recover mint/burn functionality.


// BeatToken.sol
function setFestivalContract(address _festival) external onlyOwner {
@> require(festivalContract == address(0), "Festival contract already set");
festivalContract = _festival;
}

Risk

Likelihood:

  1. This will occur if the festival contract needs to be upgraded or redeployed due to a bug or vulnerability.

  1. This will occur if the owner makes a mistake during deployment and sets the wrong address.

  1. This will occur if the festival is intended to be a recurring event, but the token contract cannot be reused.

  1. This will occur if the festival contract is compromised and needs to be replaced.

Impact:

  1. BEAT token contract becomes locked and unusable for future events.

  1. Loss of flexibility for contract upgrades or bug fixes.

  1. Potential loss of all BEAT token utility if the festival contract is lost or compromised.

  1. Users may lose trust in the platform due to inability to upgrade or recover from mistakes.

Proof of Concept

// Owner cannot update festivalContract after initial set

Recommended Mitigation

- require(festivalContract == address(0), "Festival contract already set");
+ // Consider allowing the owner to update the festival contract, possibly with a time lock or multi-sig for safety.
Updates

Lead Judging Commences

inallhonesty Lead Judge 25 days ago
Submission Judgement Published
Invalidated
Reason: Design choice
Assigned finding tags:

`setFestivalContract` only callable once

This is intended. It's done like that because the festival contract requires beat token's address and vice versa.

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.