In pushUnderlying and pullUnderlying, to compute the tokenAmount it is required to divide by BASE twice. Square of BASE can be saved in a constant to avoid applying this division twice. Simply a new variable called BASE2 (representing square of BASE) can apply the same logic for less gas.
Handle
0x0x0x
Vulnerability details
In
pushUnderlying
andpullUnderlying
, to compute thetokenAmount
it is required to divide byBASE
twice. Square ofBASE
can be saved in a constant to avoid applying this division twice. Simply a new variable calledBASE2
(representing square ofBASE
) can apply the same logic for less gas.