code-423n4 / 2022-05-opensea-seaport-findings

1 stars 0 forks source link

Gas Optimizations #187

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

[Gas-01] Save deployment gas with constants

Description

The following variables can be made constant and populated in compile time. https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/ConsiderationBase.sol#L23-L30

There is no need to have a function and runtime computation at deploy time.

It also improves readability.

Recommended Mitigation Steps

Consider computing hashes at compile time.

-----------------------------------------------------------------