code-423n4 / 2022-06-notional-coop-findings

1 stars 1 forks source link

Gas Optimizations #224

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

[Gas - 01] - Settling of account could be saved locally

https://github.com/code-423n4/2022-06-notional-coop/blob/6f8c325f604e2576e2fe257b6b57892ca181509a/notional-wrapped-fcash/contracts/wfCashLogic.sol#L221

After maturation, each time someone burns, an external call NotionalV2.settleAccount(address(this)); is made. Even if it's a noop, it would be cheaper to have a local variable to store this and eventually skip the call as it needs to be done only once.

jeffywu commented 2 years ago

Good call