First Flight #18: T-Swap

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

A dangerous strict equality in `TSwapPool::revertIfZero(uint256)` causes the contract to be easily manipulated.

Summary

Use of strict equalities that can be easily manipulated by an attacker.

Vulnerability Details

Proof of Concepts
TSwapPool::revertIfZero(uint256) (src/TSwapPool.sol#80-85) uses a dangerous strict equality:
- amount == 0 (src/TSwapPool.sol#81)

The strict equality creates a risk of never reverting if the equality is always false. This risks the contract to be vulnerable by an attacker.

Impact

The contract will get stuck in an infinite loop.
Custom errors for invalid inputs.

Tools Used

Slither

Recommendations

Don't use strict equality to determine if an account has enough Ether or tokens.

Updates

Appeal created

inallhonesty Lead Judge about 1 year ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

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