Submitted by Trust
The LockingMultiRewards allows anyone to stake MagicLP tokens in return for rewards.
LP tokens are sent with either functions below:
This will lead to _createLock(), which calculates the nextUnlockTime():
Note that nextEpoch() would always return the next 1-week (or reward duration) slot.
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:
This means users funds are locked for an additional 7 days more than expected.
Note that delayed execution of a users TX has always been considered in scope, certainly for Med severity impacts:
- https://solodit.xyz/issues/m-13-interactions-with-amms-do-not-use-deadlines-for-operations-code4rena-paraspace-paraspace-contest-git
- https://solodit.xyz/issues/m-04-lack-of-deadline-for-uniswap-amm-code4rena-asymmetry-finance-asymmetry-contest-git
- https://solodit.xyz/issues/m-03-missing-deadline-param-in-swapexactamountout-allowing-outdated-slippage-and-allow-pending-transaction-to-be-executed-unexpectedly-code4rena-pooltogether-pooltogether-git
Essentially the locking function lacks a deadline parameter similar to swapping functions, and the impact is temporary freeze of funds.
A users tokens could be locked for an extended duration beyond their intention and without their control.
Consider adding a latestUnlockTime deadline parameter for the locking functions.
0xCalibur (Abracadabra) acknowledged, but disagreed with severity and commented:
cccz (Judge) commented:
Trust (Warden) commented:
cccz (Judge) commented:
