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

Use abi.encodePacked to save gas

Summary

abi.encodePacked() consumes less gas than abi.encode().

Vulnerability Details

Impact

Changing abi.encode() function to abi.encodePacked() can save gas since the abi.encode() function pads extra null bytes at the end of the call data. getPoolId() is a pure function but is called internally so it consumes gas when called from other functions inside of the contract.

Tools Used

Manual Analysis

Recommendations

Use abi.encodePacked() instead of abi.encode() to save on gas.

Support

FAQs

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