First Flight #18: T-Swap

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

Gas Cost of String Concatenation Using string.concat

Summary

Using string.concat for string concatenation is expensive in terms of gas and can lead to increased transaction costs.

Vulnerability Details

The string.concat function, used for concatenating strings, consumes a significant amount of gas. This is because string operations in Solidity are generally costly due to the nature of how strings are handled in the EVM. Each character in a string takes up a byte, and concatenating strings requires allocating memory and copying data, which leads to high gas costs.

Impact

  • Increased transaction fees for users.

  • Potential denial of service if the gas cost exceeds block gas limits in complex transactions.

  • Reduced efficiency and higher operational costs for the contract.

Tools Used

Manual Inspection

Recommendations

Consider optimizing the logic to minimize the use of string concatenation.

Updates

Appeal created

inallhonesty Lead Judge 12 months ago
Submission Judgement Published
Invalidated
Reason: Non-acceptable severity

Support

FAQs

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