The claimCut
function currently allows players to claim their rewards without verifying whether the pot is still open. As a result, players can attempt to claim rewards even after the pot should have been closed. This lack of a timing restriction can lead to inconsistent states where claims are made after the pot has already been finalized or closed.
Allowing claims after the pot is supposed to be closed can lead to unexpected behavior, including potential over-distribution of rewards, disruption of the closing process, and loss of funds intended for specific time frames. It also opens the contract to potential abuse where users could continue to claim rewards indefinitely, which can result in a breach of the intended contract logic and rules.
Deploy the contract and set the rewards for a list of players.
Allow the pot to remain open for claims for the required duration (e.g., 90 days).
After the 90-day period, attempt to call the claimCut
function as a player.
Observe that the function still allows claims to be made even though the pot should have been closed.
Add a check at the beginning of the claimCut
function to ensure that claims can only be made while the pot is still open. This can be done by comparing the current timestamp with the deployment timestamp and enforcing the claim period:
Example Fix:
This mitigation ensures that claims can only be made during the valid claim period, preventing any unauthorized claims after the pot has closed.
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.