In the LibGermiante:claimGerminatingRoots
function, there is no check to ensure that the stalk
parameter (representing the amount of stalk to be claimed) is not greater than the unclaimedGerminating[season].stalk
. If stalk is greater than unclaimedGerminating[season].stalk, both stalk and roots final values would become negative after subtraction, which is not acceptable.
You can see the function here:
If the stalk
parameter exceeds the unclaimedGerminating[season].stalk
, it would result in negative values for both stalk and roots. Storing negative values in unsigned integer variables will lead to unexpected behavior and could potentially disrupt the entire unclaimed process. This issue could introduce inconsistencies in the system and may cause unintended consequences.
Manual Review
To address this issue, you should add a check to ensure that stalk
does not exceed unclaimedGerminating[season].stalk
before subtracting the values. If stalk exceeds unclaimedGerminating[season].stalk, you can handle this situation appropriately, such as reverting the transaction or logging an error message.
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.