First Flight #18: T-Swap

First Flight #18
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: medium
Valid

`TSwapPool::deposit` is missing deadline check

Summary

TSwapPool::deposit accepts the deadline parameter where "the deadline for the transaction to be completed by" per the documentation. Adding liquidity to the pool can cause transactions to be executed during unplanned times

Vulnerability Details

Unused deadline parameter

Impact

Possible transactions sent in suboptimal market conditions, even if a deadline parameter is added.

Tools Used

Manual Review

Recommendations

Change the function as follows:

function deposit(
uint256 wethToDeposit,
uint256 minimumLiquidityTokensToMint, // LP tokens -> if empty, we can pick 100% (100% == 17 tokens)
uint256 maximumPoolTokensToDeposit,
uint64 deadline
)
external
+ revertIfDeadlinePassed(deadline)
revertIfZero(wethToDeposit)
returns (uint256 liquidityTokensToMint)
{
Updates

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Validated
Assigned finding tags:

`deposit` is missing deadline check causing transactions to complete even after the deadline

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.