Closed sherlock-admin closed 2 years ago
After internally discussing this matter the team thinks that this issue is low/informational and it is not worth addressing. Most of the locks will presumably be longer, the impact of this edge cases can be considered marginal and users should be aware of the systemic risk of transacting in the blockchain:
network congestion, network went offline, etc
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()
.