MyCut

First Flight #23
Beginner FriendlyFoundry
100 EXP
View results
Submission Details
Severity: medium
Invalid

Missing time checks in `Pot::claimCut`, leading to possible claims after the 90-day period.

Description

The Pot::claimCut function allows claimants to claim their rewards from the pot pool. However, the function lacks a check for the time constraints defined in the contest documentation. According to the documentation, claimants have a 90-day window to claim their rewards before the manager is entitled to take a cut of the remaining pool.

The current implementation does not verify whether the claim is being made within the allowed 90-day period. As a result, claimants can potentially claim their rewards even after the designated claim period has expired.

Impact

Claimants might claim rewards after the intended period, leading to disputes and incorrect reward distribution. Also the manager may not receive the correct cut of the remaining pool if late claims are permitted, resulting in potential financial discrepancies.

Tools Used

Manual review, vscode

Recommended Mitigation

To address this issue, a time check should be implemented within the Pot::claimCut function to ensure that claims are made within the authorized 90-day period:

function claimCut() public {
+ // Ensure that the claim is made within the allowed 90-day period.
+ require(block.timestamp - i_deployedAt < 90 days, "Claim period has expired");
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);
}
Updates

Lead Judging Commences

equious Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Design choice

Support

FAQs

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