Beatland Festival

First Flight #44
Beginner FriendlyFoundrySolidityNFT
100 EXP
View results
Submission Details
Severity: low
Valid

Irreversible Inactivation of Memorabilia Collection Prevents Redemption

Irreversible Inactivation of Memorabilia Collection Prevents Redemption in absence of fucntion to activate or deactivate a specific memorabilia collection.

Description

  • In the FestivalPass contract, organizers create memorabilia collections via createMemorabiliaCollection() by passing several parameters, including activateNow.

  • If activateNow is set to true, the collection is immediately active and allows redemption.

  • If activateNow is set to false, redemption is disabled.

  • However, there is no function in FestivalPass to change the collection’s activation state after creation.

  • As a result, if a collection is initialized as inactive, it cannot be activated later, permanently preventing redemption.


function createMemorabiliaCollection(
string memory name,
string memory baseUri,
uint256 priceInBeat,
uint256 maxSupply,
@> bool activateNow
) external onlyOrganizer returns (uint256) {
require(priceInBeat > 0, "Price must be greater than 0");
require(maxSupply > 0, "Supply must be at least 1");
require(bytes(name).length > 0, "Name required");
require(bytes(baseUri).length > 0, "URI required");
uint256 collectionId = nextCollectionId++;
collections[collectionId] = MemorabiliaCollection({
name: name,
baseUri: baseUri,
priceInBeat: priceInBeat,
maxSupply: maxSupply,
currentItemId: 1, // Start item IDs at 1
@> isActive: activateNow
});
emit CollectionCreated(collectionId, name, maxSupply);
return collectionId;
}

Risk

Likelihood:

  • Low; this fucntion is restricted to a trusted organizer minimzing the change of unintentional use.

  • There is no involvement of untrusted external input or user-controlled data affecting this logic.

Impact:

  • if activateNowis set to false during creation, this collection will remain permenantly inactive.

  • This prevent users from redeeming this specific memorabilia disable a core feature in the protocol.

  • No funds at risk but it breaks core functionality, cause user disastifaction and potential reveneu loss.

Proof of Concept

  • Creat a Memorabilia with activateNowset to false

  • No user will be able to claim it

fnction test_CreateMemorabiliaCollection_IfActivateNowIsSetToFalseNoUserCanRedeemAnyItem() public {
address user = makeAddr("user");
// we created a memorabilia with activeNow set to false
vm.prank(organizer);
uint256 collectionId = festivalPass.createMemorabiliaCollection({
name: "Bunny",
baseUri: "ipfs://QmBunny",
priceInBeat: 10e18,
maxSupply: 100,
activateNow: false
});
vm.prank(address(festivalPass));
beatToken.mint(user1, 10e18);
vm.expectRevert("Collection not active");
vm.prank(user);
festivalPass.redeemMemorabilia(100); //first collention so collectionId = 100

Recommended Mitigation

  • This issue can be solved by adding a fucntion that can activate or deactivate a specific collection and restrict the access to the organizer.

  • Also, you can also add an event and emit it when the status of collection is changed.

+ event CollectionActivationUpdated(uint256 indexed collectionId, bool isActive);
+ function setCollectionActive(uint256 collectionId, bool status) external onlyOrganizer {
+ require(collections[collectionId].maxSupply > 0, "Invalid collection");
+ collections[collectionId].isActive = status;
+ emit CollectionActivationUpdated(collectionId, status);
+ }
Updates

Lead Judging Commences

inallhonesty Lead Judge 3 months ago
Submission Judgement Published
Validated
Assigned finding tags:

createMemorabiliaCollection with isActive false for later usage - flow not properly implemented.

Low because an organizer can use it with active = true and organizer is trusted.

Support

FAQs

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