Gas Optimizations #71
Labels
bug
Something isn't working
G (Gas Optimization)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
valid
1. Can save gas when call
_submitOutOrders()
with_toReserve = false
In case
_toReserve = false
, it still calculatesfeesAmount
usingentryFees
but do not use the result anywhere. We can save gas by calculatingfeesAmount
only when_toReserve = true
Affected Code
https://github.com/code-423n4/2022-06-nested/blob/b4a153c943d54755711a2f7b80cbbf3a5bb49d76/contracts/NestedFactory.sol#L443
Recommended Mitigation Steps
Only calculate
feesAmount
only when_toReserve = true
The text was updated successfully, but these errors were encountered: