First Flight #18: T-Swap

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

Bizzare token transfer like in some ponzy game

Summary

TSwapPool.sol have this bizzare transfer at 10 swap (max swaps)

    if (swap_count >= SWAP_COUNT_MAX) {
        swap_count = 0;
        outputToken.safeTransfer(msg.sender, 1_000_000_000_000_000_000);
    }

Vulnerability Details

    if (swap_count >= SWAP_COUNT_MAX) {
        swap_count = 0;
        outputToken.safeTransfer(msg.sender, 1_000_000_000_000_000_000);
    }

Try to reset some token swaps counter and transfer big amount of tokens.

Impact

Can cripple the app by giving funds to users on deterministic occasions like in ponzy game.

Tools Used

slitehr, code review

Recommendations

Delete those lines.

Updates

Appeal created

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

In `TSwapPool::_swap` the extra tokens given to users after every swapCount breaks the protocol invariant of x * y = k

Support

FAQs

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