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

1 stars 0 forks source link

Gas Optimizations #79

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Pre-incrementing (resp. pre-decrementing) a variable is cheaper than post-incrementing (resp. post-decrementing) it

Details: Consider the following changes to OrderCombiner.sol:

  1. Change L229 to --maximumFulfilled;.
  2. Change L490, L515 and L768 to ++totalFilteredExecutions;.

For more information, see G012 of c4-common-issues.

Profile: Using yarn profile the following report was obtained: