MixinRefunds.sol#_getCancelAndRefundValue
Cache and read storage variables from the stack can save gas
#206
Labels
MixinRefunds.sol#_getCancelAndRefundValue
Cache and read storage variables from the stack can save gas
#206
Handle
WatchPug
Vulnerability details
For the storage variables that will be accessed multiple times, cache and read from the stack can save ~100 gas from each extra read (
SLOAD
after Berlin).In
MixinRefunds.sol#_getCancelAndRefundValue
:freeTrialLength
,expirationDuration
andkeyPrice
are accessed multiple times.https://github.com/code-423n4/2021-11-unlock/blob/ec41eada1dd116bcccc5603ce342257584bec783/smart-contracts/contracts/mixins/MixinRefunds.sol#L133-L159
Recommendation
Change to:
The text was updated successfully, but these errors were encountered: