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

1 stars 0 forks source link

Gas Optimizations #17

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

createConduit used to check the existence of conduit As the storage at _conduits[conduit] is anyways updated in future it is better to use _conduits[conduit].key == bytes32(0) and this will give a gas saving an average of 2500 https://github.com/code-423n4/2022-05-opensea-seaport/blob/7c082637d9273deb42e551c74a578151cefd8448/contracts/conduit/ConduitController.sol#L85

HardlyDifficult commented 2 years ago

Savings confirmed, and it seems to accomplish the same goal.