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

1 stars 0 forks source link

Gas Optimizations #81

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago
  1. Cache variable to save gas _conduits[conduit].owner , _conduits[conduit].potentialOwner in acceptOwnership() for ConduitController.sol should be cached to save gas _CONDUIT_CREATION_CODE_HASH in getConduit() for ConduitController.sol should be cached to save gas

  2. Cheaper to use calldata than memory Use calldata instead of memory when possible to save GAS **Occurrences in: https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/Consideration.sol#L399

0xleastwood commented 2 years ago

I'm sure the sponsor appreciates the findings, however, I think it is not fair to other wardens who submitted gas reports to have this included for rewards. I will be marking all low-quality gas reports as invalid.

HardlyDifficult commented 2 years ago
  1. These values do not seem to be read multiple times here, so not sure how caching would help.
  2. I believe this was intentional because the helper used here could sometimes use calldata but other times requires memory and it's not clear if the redundancy is worth the potential savings here.