Missing check if _amount < accountClaimed[account]
in PriorityPool::claimLSDTokens
function, which could lead to incorrect calculations and automatic reverts.
Without this check, if _amount < accountClaimed[account]
, the amountToClaim calculation (_amount - accountClaimed[account]
) could result in a negative number or an underflow (though with Solidity 0.8+ this would result in an automatic revert). This would prevent the function from working as intended.
For example: If _amount = 50
and accountClaimed[account] = 100
, the operation 50 - 100
will result in -50
, which cannot be stored in a uint256
and will cause a revert.
When performing the operation _amount - accountClaimed[account]
, where accountClaimed[account]
is greater than _amount
, the result will be a negative number
. Since uint256
cannot represent negative values, this will cause an underflow and automatic revert.
The logic assumes that users cannot claim more than what has been allocated to them. Adding this check ensures that users don’t try to claim an amount lower than what they’ve already claimed, which would not make sense in the context of a claim function.
Manual review
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.