MyCut

AI First Flight #8
Beginner FriendlyFoundry
EXP
View results
Submission Details
Impact: medium
Likelihood: medium
Invalid

Missing Claim Deadline Validation Allows Rewards to Be Claimed After Contest Expiration

Root + Impact

Players can call claimCut() after the 90-day claim period has expired because the function does not check the contest's expiration time. This bypasses the apparent claim deadline and may interfere with the owner's final reward distribution through closePot().

Description

The root cause is that claimCut() validates the player's reward but does not verify whether the 90-day claim period has expired.

Because this expiration check is absent from claimCut(), players can still claim their allocated rewards after the stated period.

function claimCut() public {
address player = msg.sender;
uint256 reward = playersToRewards[player];
​
if (reward <= 0) {
revert Pot__RewardNotFound();
}
​
playersToRewards[player] = 0;
remainingRewards -= reward;
claimants.push(player);
_transferReward(player, reward);
}

Risk

Likelihood: The missing check is directly reachable by players with unclaimed rewards after the deadline.

Impact: The intended expiration policy can be bypassed, and late claims can alter the remaining reward balance and claimant list used by the final distribution logic.

Proof of Concept

Expected result: The call should revert because the claim period has expired. The current implementation allows it to proceed if the player still has an outstanding reward and the pot has sufficient funds.

function testClaimCutAfter90Days() public {
// Assume `pot` is deployed with this test contract
// as an eligible player and has been funded.
​
vm.warp(block.timestamp + 91 days);
​
uint256 rewardBefore = pot.checkCut(address(this));
assertGt(rewardBefore, 0);
​
uint256 balanceBefore = token.balanceOf(address(this));
​
// Vulnerability: claim succeeds after the deadline.
pot.claimCut();
​
assertEq(pot.checkCut(address(this)), 0);
assertEq(
token.balanceOf(address(this)),
balanceBefore + rewardBefore
);
}

Recommended Mitigation

Add an expiration check at the beginning of claimCut() so that claims are accepted only during the intended 90-day window.

For clarity, consider introducing a dedicated Pot__ClaimPeriodExpired() error. Ensure that closePot() and claimCut() follow a consistent deadline policy.

function claimCut() public {
+ if (block.timestamp - i_deployedAt >= 90 days) {
+ revert Pot__StillOpenForClaim();
+ }
+
address player = msg.sender;
uint256 reward = playersToRewards[player];
Updates

Lead Judging Commences

ai-first-flight-judge Lead Judge about 2 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!