maintananceInvariant is only used for withdrawTo function, which also uses collateralInvariant. Both modifiers load collateral amount. They can be combined together to avoid loading collateral amount twice to the stack and save gas on withdrawTo function. Since maintananceInvariant is only used for this function, rather than maintananceInvariant it would be more gas efficient to create the modifier maintananceAndCollateralInvariant and remove maintananceInvariant.
Handle
0x0x0x
Vulnerability details
maintananceInvariant
is only used forwithdrawTo
function, which also usescollateralInvariant
. Both modifiers load collateral amount. They can be combined together to avoid loading collateral amount twice to the stack and save gas onwithdrawTo
function. SincemaintananceInvariant
is only used for this function, rather thanmaintananceInvariant
it would be more gas efficient to create the modifiermaintananceAndCollateralInvariant
and removemaintananceInvariant
.