in the unstakeVested
function in FjordStaking.sol,
The function doesn't check if the current epoch is the same as the staked epoch before allowing unstaking. This means users could potentially unstake vested tokens immediately after staking them, bypassing the intended 6-week (6 epoch) lock period.
The function checks:
But it should also prevent unstaking if the current epoch is the same as the staked epoch. A correct check would be:
This bug could allow users to stake and immediately unstake vested tokens, potentially exploiting the system.
User stakes vested tokens using stakeVested(streamID)
.
In the same transaction or epoch, user calls unstakeVested(streamID)
.
The tokens are immediately unstaked without waiting for the lock period.
This could be exploited to:
Gain unfair advantages in reward distribution.
Manipulate the total staked amount to affect reward calculations.
To fix, add a check to ensure currentEpoch > data.epoch
before allowing unstaking.
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.