BeatToken.sol::setFestivalContract is missing a zero check
The setFestivalContract function allows the owner to set the festivalContract address that is authorized to mint and burn tokens. This address is critical because it controls token supply modification.
However, the function does not validate that the provided _festival address is non-zero. As a result, the owner can mistakenly set the festivalContract to address(0).
Both mint and burnFrom will become permanently unusable, since no address can satisfy the msg.sender == festivalContract requirement. This would effectively disable token minting and burning functionality.
Likelihood:
Owner configuration mistakes are common during deployment.
There is no safeguard preventing the accidental assignment of address(0)
Impact:
Token minting and burning functionality become permanently inaccessible
The following test demonstrates that after setting festivalContract to address(0), any attempt to mint tokens reverts with Only_Festival_Mint, confirming that the contract enters an unusable state.
To prevent accidental misconfiguration, the function should validate that the provided _festival address is not the zero address before assigning it to festivalcontract.
Adding a zero-check ensures that the authorization condition remains satisfiable and prevents the contract from entering a permanently unusable state.
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.