seaport icon indicating copy to clipboard operation
seaport copied to clipboard

fix: optimize pad to Reduce Gas Costs

Open mdqst opened this issue 10 months ago • 0 comments

Motivation

The pad function was using while and string.concat, which are not the most gas-efficient ways to handle string padding in Solidity. Since string operations are expensive, this approach led to unnecessary gas consumption.

Solution

Replaced while and string.concat with abi.encodePacked, reducing redundant concatenations. This improves gas efficiency while maintaining the same functionality.

mdqst avatar Feb 20 '25 11:02 mdqst