The UnripeFacet:pick
function allows users to claim their pickable Unripe Tokens. Users provide a Merkle proof along with the amount of tokens they want to claim. The function first verifies that the Merkle root for the Unripe Token is not empty, ensuring that the token is valid and exists in the system.
It checks whether the user has already claimed tokens for the given Unripe Token. If they have, the function reverts to prevent double claiming. The function validates the Merkle proof provided by the user to ensure that the claimed amount is legitimate.
The issues arises as pick
doesn't verify whether the amount user wants to claim is less than or equal to the actual amount available for the user to claim. This can lead to a situation where a user claims fewer tokens than expected, which will set s.unripeClaimed[token][msg.sender]
to true
. Now subsequent attempts to claim the remaining tokens will fail due to the assumption that they've already claimed their entire allocation.
See the following code:
Users may face inconsistencies in claiming their Unripe Tokens, leading to potential loss of unclaimed unripe tokens and loss of trust in the system. It can also result in a waste of gas fees for users attempting to claim the remaining tokens after an incomplete claim.
Manual Review
To address this issue, you should implement a verification step in the pick
function to ensure that the amount being picked matches the actual available amount for the user.
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.