See below
The completeClaimRequest function in the smart contract is intended to allow users to finalize a claim receipt from a specific epoch after waiting for a set number of epochs (claimCycle). However, due to the logic in the function and the initial setting of currentEpoch in the constructor, the function creates a Denial of Service (DoS) vulnerability when users attempt to complete a claim request for an epoch at index 1.
Constructor Snippet:
completeClaimRequest Function Snippet:
From the constructor, currentEpoch is initialized to 1, which means that the contract starts at the first epoch by default. When the completeClaimRequest function is called, the function first validates that the requestEpoch in the user's ClaimReceipt is not less than 1. Then, it checks whether the difference between currentEpoch and cr.requestEpoch is greater than claimCycle. If the difference is less than or equal to claimCycle, the function reverts with the CompleteRequestTooEarly() error.
When both currentEpoch and cr.requestEpoch are 1, the difference between them is 0. Since 0 <= claimCycle is always true (assuming claimCycle is a positive integer (obviuosly 3 uint8 public constant claimCycle = 3;)), the function will revert, making it impossible for a user to complete their claim request during the first epoch.
This is particularly problematic for users whose ClaimReceipt was generated in epoch 1, as they will be perpetually unable to complete their claim due to this logic.
This vulnerability results in a Denial of Service (DoS) condition, where users who have claims from epoch 1 cannot complete their claim request. This restricts access to their rewards, undermining the contract's intended functionality and potentially causing user dissatisfaction and loss of trust in the protocol.
Manual
The logic should be adjusted to exclude the first epoch from the CompleteRequestTooEarly check. This can be implemented by modifying the condition as follows:
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.