Open code423n4 opened 2 years ago
Passing standardTransfer[i] directly to _transfer()
I ran the recommended changes here and didn't get great results. Some calls got a tiny bit more efficient, others a bit worse. ~ +/- 10 gas and not a consistent win.
Using assembly for checking open channel, can save some gas
I tried this one as well, using the hardhat profile report instead of the simplified example above. Again got some mixed results, best case was a savings of ~40 gas.
Given that neither change provides a clear win, I'm closing this as invalid.
Hi there, im afraid i have to disagree with the decision on this one since the changes that made into the seaportV1.1, they made some changes related to this issue https://github.com/ProjectOpenSea/seaport/blob/main/contracts/conduit/Conduit.sol#L104 for the 1 gas opt https://github.com/ProjectOpenSea/seaport/blob/main/contracts/conduit/Conduit.sol#L40-L68 for the 2 gas opt
for reference you can take a look at the etherscan https://etherscan.io/address/0x00000000006c3852cbef3e08e8df289169ede581#code
on the conduit.sol, those changes was made based on these reports. and since on the contest page, there is nothing that stated a limit on what is the minimum gas, that was accepted, i don't think this report should go to invalid.
Thank you
That's a fair point. Thanks for raising this.
Re-opening as valid.
GAS 1. Title: Passing standardTransfer[i] directly to
_transfer()
https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/conduit/Conduit.sol#L68-L71 https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/conduit/Conduit.sol#L132-L135Instead of storing
standardTransfer[i]
value intostandardTransfer
var. Passing it directly can save gas per loop2. Title: Using assembly for checking open channel, can save some gas
Occurrences: https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/conduit/Conduit.sol#L58 https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/conduit/Conduit.sol#L96 https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/conduit/Conduit.sol#L122
by replacing these check with assembly can save some gas