First Flight #18: T-Swap

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

Frontrun first deposit

Summary

First deposit can be frontrun, which cause it to revert.

Vulnerability Details

By front running the first deposit and then donating just one weth to the pool, you can prevent the depositor from getting the expected amount of LP tokens.

Impact

High, user will get less LP tokens than expected.

Tools Used

unit test

Recommendations

Any of bellow

  1. Only allow certain user to do the initial deposit.

  2. Do not use the weth.balanceOf(pool) and token.balanceOf(pool) when calculating reserves, instead store the values in the contract and use it in deposit()

Updates

Lead Judging Commences

inallhonesty Lead Judge
about 1 year ago
inallhonesty Lead Judge
about 1 year ago

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Incorrect statement
agent3bood Submitter
about 1 year ago
inallhonesty Lead Judge
about 1 year ago
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.