A user's Fjord tokens could be locked for an extended duration without their control
The stake()
allows anyone to stake FJORD tokens in return for rewards:
Prior to the execution of this function, the modifier checkEpochRollover
is executed which calls _checkEpochRollover()
:
Thus, it first checks for the epoch, and updates it if exceeds the current epoch. Also, considering the unstake functions which call _redeem()
at their hearts,
users have to keep and lock their assets for at least one epoch.
An issue arises because the user cannot specify the latest desired unlock time. This opens the path for the tokens to be locked for longer than expected,
which may have significant impact for users if they need the funds. Consider the following case, where x is week number:
It is day 6 of an epoch (one day from nextEpoch)
Assumed unlock time is 7 + lockDuration
The TX does not execute in next 1 day for any reason (gas price went up, validator does not include TX, etc)
It is now day 7, another epoch starts. Now nextEpoch is 7 + x
Executed unlock time is 7 + x + lockDuration
This means user's funds are locked for an additional 7 days more than expected.
Essentially the stake function lacks a deadline parameter similar to swapping functions, and the impact is temporary freeze of funds.
This issue is considered medium certainly as it is related to the temporary freeze of funds beyond the users wills.
Temporary loss of Fjord tokens due to being locked for an extended duration beyond the users intention and without their control.
Manual review
Consider adding a deadline parameter for the staking functions.
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.