This repository has been archived by the owner on May 26, 2023. It is now read-only.
WATCHPUG - Lack of deadline control in deposit()
may result in an unfavorable lock in some edge cases
#113
Labels
WATCHPUG
medium
Lack of deadline control in
deposit()
may result in an unfavorable lock in some edge casesSummary
The
deposit()
transaction can get minted much later than expected in some edge cases, which means the end time of the lock may not be favorable by then.Vulnerability Detail
The lock end time of the deposit is decided by the time the transaction gets minted, which can be out of the user's control in some edge cases (network congestion, network went offline, etc).
For example:
deposit()
and lock for 1 day;Impact
deposit()
can lock funds for a longer time than expected in some edge cases.Code Snippet
https://github.com/sherlock-audit/2022-10-merit-circle/blob/main/merit-liquidity-mining/contracts/TimeLockPool.sol#L85-L107
Tool used
Manual Review
Recommendation
Consider adding a
deadline
parameter and revert ifblock.timestamp > deadline
indeposit()
.The text was updated successfully, but these errors were encountered: