20,000 USDC
View results
Submission Details
Severity: gas
Valid

Structs can be packed into fewer storage slots

Each slot saved can avoid an extra Gsset (20000 gas) for the first setting of the struct. Subsequent reads as well as writes have smaller gas savings.

Recommendations

File: src/interfaces/ISwapRouter.sol
struct ExactInputSingleParams {
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint160 sqrtPriceLimitX96;
}

Support

FAQs

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