Beatland Festival

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

Lack of Reward Validation in `createPerformance()` Enables Rewardless Events

Root + Impact

Description

  • Organizer is responsible to create a performance with a specified startTime, duration, and reward, enabling users with pass to attend and earn BEAT tokens

  • Inside createPerformance(), it carefully checks both the validity of startTime and duration, but it doesn't check whether reward > 0, i.e., whether created performance has no reward

function createPerformance(
uint256 startTime,
uint256 duration,
uint256 reward
) external onlyOrganizer returns (uint256) {
require(startTime > block.timestamp, "Start time must be in the future");
require(duration > 0, "Duration must be greater than 0");
@> // lack check if reward > 0
performances[performanceCount] = Performance({
startTime: startTime,
endTime: startTime + duration,
baseReward: reward
});
emit PerformanceCreated(performanceCount, startTime, startTime + duration);
return performanceCount++;
}

Risk

Likelihood:

  • Occurs when organizer accidentally set baseReward to 0

Impact:

  • Wasted User Actions and Gas: Users spend gas to call attendPerformance() expecting a reward, but ultimately receive nothing

  • User Trust Degradation: This breaks user expectations and may erode trust in the platform’s reliability

Proof of Concept

It’s straightforward to understand the impact by inspecting the code logic inside createPerformance()

Recommended Mitigation

Add a validation check to ensure that reward is greater than zero in createPerformance()

function createPerformance(
uint256 startTime,
uint256 duration,
uint256 reward
) external onlyOrganizer returns (uint256) {
require(startTime > block.timestamp, "Start time must be in the future");
require(duration > 0, "Duration must be greater than 0");
+ require(reward > 0, "Reward must be greater than 0");
performances[performanceCount] = Performance({
startTime: startTime,
endTime: startTime + duration,
baseReward: reward
});
emit PerformanceCreated(performanceCount, startTime, startTime + duration);
return performanceCount++;
}
Updates

Lead Judging Commences

inallhonesty Lead Judge 4 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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