Use Seaport gas optimized signature verification contract for signature verification
Currently, verify function takes too much gas on Address.isContract(signer)
Address.isContract(signer) = extcodesize will cause an unnecessary 2600 upfront gas cost on every transaction. While it can be avoided for majority of case where it is EOA wallet.
Solidity 0.8.4 introduced custom errors. They are more gas efficient than revert strings, when it comes to deployment cost as well as runtime cost when the revert condition is met. Use custom errors instead of revert strings for gas savings.
Any require statement in your code can be replaced with custom error for example:
require(verifyMatchOneToManyOrders(buyOrderHash, false, sell, buy), 'order not verified');
Use Seaport gas optimized signature verification contract for signature verification
Currently, verify function takes too much gas on Address.isContract(signer)
Address.isContract(signer) = extcodesize will cause an unnecessary 2600 upfront gas cost on every transaction. While it can be avoided for majority of case where it is EOA wallet.
https://github.com/code-423n4/2022-06-infinity/blob/765376fa238bbccd8b1e2e12897c91098c7e5ac6/contracts/libs/SignatureChecker.sol#L51-L68
2600 gas on Address.isContract(signer) can be avoided by using Seaport implementation
https://github.com/ProjectOpenSea/seaport/blob/main/contracts/lib/SignatureVerification.sol
Consider using custom errors instead of revert strings
This reduce gas cost as show here https://forum.openzeppelin.com/t/a-collection-of-gas-optimisation-tricks/19966/5
Solidity 0.8.4 introduced custom errors. They are more gas efficient than revert strings, when it comes to deployment cost as well as runtime cost when the revert condition is met. Use custom errors instead of revert strings for gas savings.
Any require statement in your code can be replaced with custom error for example:
Can be replaced with