Staking logic and balance management contains a critical issue where the staking logic doesn't accumulate stakes.
The stake
function overwrites the existing stake amount for a user:
This means that every time a user stakes, it replaces the previous stake amount with the new amount. This prevents users from adding to their existing stakes and only allows them to stake a new amount entirely. This can be problematic if users intended to increase their existing stake.
Users are unable to increase their existing stake and in case they attempt to increase it the old amounts are permanently locked in the contract with no way to retrieve them.
The following test case illustrates the issue:
Manual Review
Update the staking logic to accumulate stakes by changing the line to:
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.