Gas Optimizations #131
Labels
bug
Something isn't working
G (Gas Optimization)
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
[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.The text was updated successfully, but these errors were encountered: