Open code423n4 opened 2 years ago
Valid gas savings
Lack of address(0) check, valid
Agree with avoiding shadowing
Disagree that it's an issue
Agree with informational level finding
Personally I recommend sorting by issue rather than by file, that said this report was pretty short which means either way of grouping findings is fine
QA
Use unchecked lib
PoolMigrationZap.sol
Enforce pattern on loops
You can add the unchecked math lib like you do on the others contracts to safely increment the
i
var, saving gas and make contract consistent with the others by enforcing the same style.On
PoolMigrationZap.sol#L39-L44
you are doing a unchecked increment in the loop, but in the rest of the code you a different pattern. Add the unchecked math lib and change:To;
_underlyingNewPools
can end with a wrong dataIf
underlying_
isaddress(0)
then_underlyingNewPools[address(0)]
will be fill...Consider change lines
PoolMigrationZap.sol#L26-L27
from:To:
ConvexStrategyBase.sol
Change var name to avoid shadow
On line L287 you are declaring variable with the same name, i understang that is for caching, but i recommend to change the variable name, consider changing this;
To this;
LiquidityPool.sol
Add check before calling
safeApprove
In think you will need a check before doing the safeApprove call on LiquidityPool.sol#L700 Just replace;
With
_keeperGauge
Missing event emission
Critical function dont emit events;
InflationManager.sol#L58-L63:setMinter
InflationManager.sol#L89:deactivateWeightBasedKeeperDistribution