\<VAR>++ OR \<VAR> += 1 TO ++\<VAR> ALSO USE UNCHECKED FOR OPERATIONS NOT EXPECTED TO OVERFLOW
When the value of the post-loop increment/decrement is not stored or used in any calculations, the prefix increment/decrement operators (++i/--i) cost less gas PER LOOP than the postfix increment/decrement operators (i++/i--)
Gas Report
\<VAR>++ OR \<VAR> += 1 TO ++\<VAR> ALSO USE UNCHECKED FOR OPERATIONS NOT EXPECTED TO OVERFLOW
When the value of the post-loop increment/decrement is not stored or used in any calculations, the prefix increment/decrement operators (
++i
/--i
) cost less gas PER LOOP than the postfix increment/decrement operators (i++
/i--
)Use
++i
rather thani++
to save gasInstances include
i++ to ++i:
Also add unchecked:
CACHING LENGTH ON FOR
zeroswap/contracts/uniswapv2/UniswapV2Oracle.sol: 83 cachear el granularity
zeroswap/contracts/uniswapv2/UniswapV2Router02.sol: 214, 323 el path.leng-1 cachearlo
zeroswap/contracts/mocks/ComplexRewarderTime.sol: L157 zeroswap/contracts/uniswapv2/UniswapV2Oracle.sol: 83
State variables can be constant;
MasterChef.sol
MasterChef.sol#L59
MasterChef.sol#L63
MasterChef.sol#L65
MasterChef.sol#L77
Save gas avoiding initialize variables with 0
MasterChef.sol#L75
This will save you gas