Avoid unnecessary storage read can save gas #112
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")
Handle
WatchPug
Vulnerability details
https://github.com/code-423n4/2021-10-mochi/blob/8458209a52565875d8b2cefcb611c477cefb9253/projects/mochi-core/contracts/vault/MochiVault.sol#L85-L111
At L93,
debtIndex
is set ascurrentIndex
, therefore, at L96, L99, and L109 storage variabledebtIndex
can be changed to local variablecurrentIndex
to avoid unnecessary storage read to save some gas.The text was updated successfully, but these errors were encountered: