First Flight #18: T-Swap

First Flight #18
Beginner FriendlyDeFiFoundry
100 EXP
View results
Submission Details
Severity: high
Invalid

`TSwapPool::deposit` function has no deadline check which will stop transactions from being sent after deadline

Summary The deposit function accepts a deadline parameter which is never used

Vulnerability Details The TSwapPool::deposit function in accepts a deadline parameter, which according to the Nat Spec is "The deadline for the transaction to be completed by". This parameter is never used. Liquidity Providers can still deposit after the deadline when the contract does not expect any deposit

Liquidity Providers could call deposit function after the deadline has passed.

Tools Used Foundry , Manual Review

Recommendations Consider making the following change to the function. Add the revertIfDeadlinePassed modifier to the deposit function.

function deposit(
uint256 wethToDeposit,
uint256 minimumLiquidityTokensToMint,
uint256 maximumPoolTokensToDeposit,
uint64 deadline
)
external
+ revertIfDeadlinePassed(deadline)
revertIfZero(wethToDeposit)
returns (uint256 liquidityTokensToMint)
{
Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement

Support

FAQs

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