Beatland Festival

AI First Flight #4
Beginner FriendlyFoundrySolidityNFT
EXP
View results
Submission Details
Impact: medium
Likelihood: medium
Invalid

PerformanceCreated Event Omits Reward Parameter Leading to Incomplete Off-Chain Event Data

Root + Impact

Description

  • In the normal flow, createPerformance() is expected to register a new performance with a startTime, duration, and reward, and then emit an event that fully reflects the created performance parameters for off-chain tracking and indexing.


  • However, the current implementation emits an event that omits the reward parameter, even though it is part of the function input and likely part of the state used internally.

    This creates an inconsistency between on-chain state changes and emitted events, reducing transparency and reliability for off-chain consumers.

// Root cause in the codebase with @> marks to highlight the relevant section
unction 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");
// Set start/end times
performances[performanceCount] =
Performance({startTime: startTime, endTime: startTime + duration, baseReward: reward});
// emitting the wrong event??
@> emit PerformanceCreated(performanceCount, startTime, startTime + duration);
return performanceCount++;
}

Risk

Likelihood:

  • This issue occurs every time a performance is created since the event is consistently emitted without the reward field.

  • Off-chain systems relying on event logs will always receive incomplete data for each created performance.

Impact:

  • Indexers (The Graph, custom backends, analytics dashboards) will not have access to reward information, leading to incorrect or incomplete UI/state representation.

  • Users and integrators may misinterpret performance metadata, especially where reward value is economically relevant.

Proof of Concept

A user calls createPerformance(startTime, duration, reward) with:

  • startTime = 1000

  • duration = 300

  • reward = 50 ETH

  • The contract executes successfully and:

    • Increments performanceCount

    • Stores or processes the reward internally (assumed normal behavior)

  • The contract emits the event:

  • emit PerformanceCreated(performanceCount, startTime, startTime + duration);

    What is observed off-chain

    • Event logs captured by indexers show:

      • performanceId

      • startTime

      • endTime

    • ❌ Missing field:

      • reward is not included in event data

function test_reward_not_emitted() public {
vm.expectEmit(true, true, false, true);
emit PerformanceCreated(1, 1000, 1300); // no reward field
perfManager.createPerformance(1000, 300, 50 ether);
}

Recommended Mitigation

Ensure that the reward parameter is included in the PerformanceCreated event so that all critical creation parameters are consistently emitted for off-chain indexing, transparency, and auditability.

This aligns the event schema with the function inputs and prevents loss of important metadata.

event PerformanceCreated(
uint256 performanceId,
uint256 startTime,
- uint256 endTime
+ uint256 endTime,
+ uint256 reward
);
function createPerformance(
uint256 startTime,
uint256 duration,
uint256 reward
) external {
performanceCount++;
emit PerformanceCreated(
performanceCount,
startTime,
- startTime + duration
+ startTime + duration,
+ reward
);
}
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 3 hours ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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

Give us feedback!