First Flight #18: T-Swap

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

Incorrect Fee calculations

Incorrect fee calculations getInputAmountBasedOnOutput cause protocol to take too many tokens from users, resulting in lost fee

`

Vulnerability DetailsThe fucntiongetInputAmountBasedOnOutput` intended to calculate amount of tokens a user should deposit should deposit an amout of tokens of output token. This function is miscalculate the resulting amount. when calculating the fee, it scales the amount by 10_000 inseted of 1_000

Impact low

##Tools Foundry fuzz and manual review

Recommendations use 1_000 insted of 10_000

Updates

Lead Judging Commences

inallhonesty Lead Judge
over 1 year ago

Appeal created

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

Incorrect fee calculation in TSwapPool::getInputAmountBasedOnOutput causes protocol to take too many tokens from users, resulting in lost fees

Support

FAQs

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

Give us feedback!