Beatland Festival

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

Missing event

Missing Events

Description

  • FestivalPass::setOrganizer and FestivalPass::configurePass function are updating important state variables, should emit an event.

function setOrganizer(address _organizer) public onlyOwner {
@> organizer = _organizer;
}
function configurePass(
uint256 passId,
uint256 price,
uint256 maxSupply
) external onlyOrganizer {
require(passId == GENERAL_PASS || passId == VIP_PASS || passId == BACKSTAGE_PASS, "Invalid pass ID");
require(price > 0, "Price must be greater than 0");
require(maxSupply > 0, "Max supply must be greater than 0");
passPrice[passId] = price;
passMaxSupply[passId] = maxSupply;
passSupply[passId] = 0; // Reset current supply
}

Impact

  • When the state is initialized or modified, an event needs to be emitted.

  • Any state that is initialized or modified without an event being emitted is not visible off-chain. This means that any off-chain service is not able to view changes

Likelihood: High


Recommended Mitigation

  • Should emit an event FestivalPass__OrganizerUpdated on calling FestivalPass::setOrganizer function

+ event FestivalPass__OrganizerUpdated(address newOrganizer);
+ event FestivalPass__ConfigurePass(uint256 indexed passId,uint256 indexed price, uint256 indexed maxSupply);
function setOrganizer(address _organizer) public onlyOwner {
organizer = _organizer;
+ emit FestivalPass__OrganizerUpdated(organizer);
}
function configurePass(
uint256 passId,
uint256 price,
uint256 maxSupply
) external onlyOrganizer {
require(passId == GENERAL_PASS || passId == VIP_PASS || passId == BACKSTAGE_PASS, "Invalid pass ID");
require(price > 0, "Price must be greater than 0");
require(maxSupply > 0, "Max supply must be greater than 0");
+ emit FestivalPass__ConfigurePass(passId,price,maxSupply);
passPrice[passId] = price;
passMaxSupply[passId] = maxSupply;
passSupply[passId] = 0; // Reset current supply
}
Updates

Lead Judging Commences

inallhonesty Lead Judge about 1 month ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity
Assigned finding tags:

Missing events / Events not properly configured

Informational. This protocol doesn't rely on events to function, they are just nice to have, but not mandatory.

Support

FAQs

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