Open code423n4 opened 2 years ago
I agree, because these are Storage value set to the same value, the gas saved is 100 per instance 300
I agree, but would have liked to see a POC with detailed gas savings, in lack of it will give it 200 gas (low estimate)
Total Gas Saved
500
[G-01] Unnecessary check for positive value
Description
A
uint256
value can not be negative, hence there is no need to check for it.Findings
tokenomics/InflationManager.sol#L589
tokenomics/InflationManager.sol#L602
tokenomics/InflationManager.sol#L575
Recommended mitigation steps
Remove the check and use the value directly to save gas.
[G-02] Unnecessary
poolCheckpoint
function callThe
AmmGauge
andKeeperGauge
contracts call the functionpoolCheckpoint()
within thekill()
function. Therefore, functions which call thiskill()
function do not have to additionally call thepoolCheckpoint()
function.Description
A
uint256
value can not be negative, hence there is no need to check for it.Findings
tokenomics/InflationManager.sol#L427\ tokenomics/InflationManager.sol#L461
Recommended mitigation steps
Remove the call to
poolCheckpoint()
to save gas.