You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default value of uint varibles are 0. Therefore, there is no need to set 0 on uint variables. Not setting 0 on uint variables can reduce the deployment gas cost.
[Gas-1] No need to set 0 on uint variables
The default value of uint varibles are 0. Therefore, there is no need to set 0 on uint variables. Not setting 0 on uint variables can reduce the deployment gas cost.
Here are some examples:
https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/AmountDeriver.sol#L44
https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/CriteriaResolution.sol#L56
They can be modified as follows:
[Gas-2][FulfillmentApplier.sol] unchecked can be used in _applyFulfillment function
Since it has
if (considerationItem.amount > execution.item.amount)
check, following parts can be wrapped by unchecked like them.https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/FulfillmentApplier.sol#L97-L100
https://github.com/code-423n4/2022-05-opensea-seaport/blob/main/contracts/lib/FulfillmentApplier.sol#L109-L112
The text was updated successfully, but these errors were encountered: