First Flight #18: T-Swap

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

Donating weth

Summary

Donating weth to the pool will cause liquidity providers getting less than expected LP tokens.

Vulnerability Details

The attack is on this formula which calculate how much LP to mint to the liquidity provider, it is as simple as donating weth, the more the attacker the less LP tokens will be minted to the liquidity providers.

liquidityTokensToMint =
(wethToDeposit * totalLiquidityTokenSupply()) /
wethReserves;

Impact

High, liquidity providers are getting less LP tokens that what should be.

Tools Used

Unit test.

Recommendations

Store the weth reserves in the contract and use it to calculate liquidityTokensToMint, the weth reserve value can be updated after deposit.

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

Support

FAQs

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