Closed code423n4 closed 2 years ago
- This is not really an issue. The functions are equivalently the same, except the primary contract is optimised.
- The rest are minor issues.
It would still revert so disagree with the finding
Disagree that natspec has to be 100% for all params, all of natspec is optional
Disagree because the codebase is consistently using named returns with explicit returns
Disagree as the suggestion consumes more gas / misses the point
Agree with Invalid
[QA-1][AmountDeriver.sol] The order of checking
if (!exact)
does not map 1:1 betwen reference and optimized oneIn the optimized contract, the logic order of
_getFraction
is as follows:if (!exact)
checknewValue
https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/AmountDeriver.sol#L99-L120On the other hand, the reference contract does
if (!exact)
check at the last part of the function. https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/reference/lib/ReferenceAmountDeriver.sol#L96-L100[QA-2][ZoneInteraction.sol] Missing comment at
_callIsValidOrder
functionThroughout the codebase, function has comments for their arguments and the note for dev. However,
_callIsValidOrder
function does not have comments explaining their arguments or its role. https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/ZoneInteraction.sol#L56-L61[QA-3][OrderFulfiller.sol] Unnecessary return statement
AdvancedOrder[] memory advancedOrders
is defined at the function.However, it also call
return advancedOrders
at the end of the function. It simply can removereturn advancedOrders;
. https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/OrderFulfiller.sol#L477-L478[QA-4][OrderValidator.sol]
++i
does not need to be located at the end of for loopThese for loops are wrapped by
unchecked
.https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/OrderValidator.sol#L272-L311
https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/OrderValidator.sol#L350-L394
However,
++i
exists at the end of function.It simply can be located at the for loop definition instead.