First Flight #18: T-Swap

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

Reentrancy Vulnerability in TSwapPool Smart Contract

Summary

A reentrancy vulnerability has been identified in the _swap function of the TSwapPool smart contract. This allows an attacker to repeatedly call the function before previous executions are completed, potentially leading to unauthorized fund transfers.

Vulnerability Details

Single Function Reentrancy: The function _swap makes an external call to outputToken.safeTransfer, which can trigger a reentrant call back into the contract.
Vulnerable Function: _swap
Vulnerable Line: outputToken.safeTransfer(msg.sender, 1_000_000_000_000_000_000);
Issue: The external call can trigger the fallback function of msg.sender, allowing it to call back into the TSwapPool contract, exploiting the contract's state before it is securely updated and emit.

Impact

Repeated reentrant calls can deplete the contract’s funds, causing financial loss.

Tools Used

Slither

Recommendations

Adopt the Checks-Effects-Interactions Pattern

Updates

Appeal created

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.