QA Report #58
Labels
bug
Something isn't working
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
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")
Redundant greater than 0 checks for uint
When executing pool weight changes in
InflationManager.sol
(_executeKeeperPoolWeight, _executeLpPoolWeight, _executeAmmTokenWeight), corresponding total pool weightsx
areunsigned int
. As they can't only bex >= 0
, the expressionx>0 ? x : 0
does nothing.Sensible changes, such as adding a Governor should be a two-step process
addGovernance
directly grantsRoles.GOVERNANCE
to thenewGovernor
. It should be a two-step process (e.g. setGovernance-acceptGovernance) to ensure the input address is correct. WhilstrenounceGovernance
checks that there is at least one Governor left, in a single-Governor scenario, back to back execution ofaddGovernance
with an incorrect address followed byrenounceGovernance
will render the protocol ungovernable. Additionally, as there is no way to revoke this role, granting governance to an address means that address will have complete control over the protocol forever after.Requirement uses external call to user-controlled address in
PoolMigrationZap.sol - migrate
require(oldPool_.getWithdrawalFee(msg.sender, lpTokenAmount_) == 0, "withdrawal fee not 0");
makes an external call tooldPoolAddress_
, which is a user-controlled address. It could be a malicious contract, thus reporting any result needed to bypass the guard.Erring on the safe side for reentrancy in
PoolMigrationZap.sol - migrate
While I did not manage to exploit it in any way - I'd recommend against not including a
nonReentrant
guard in this function.oldPoolAddress_
could be a malicious contract thus enabling multiple calls tomigrate
spanning from the external calls tooldPool
orlpToken_
.Recommended missing events
Modifying key protocol variables or triggering key events should always emit events accordingly to ensure transparency and proper traceability.
Minter.sol
: setToken, startInflation, executeInflationRateUpdateBkdLocker.sol
: migrateController.sol
: setInflationManagerAmmGauge.sol
: killKeeperGauge.sol
: kill, advanceEpoch, reportFees, poolCheckpointInflationManager.sol
: deactivateWeightBasedKeeperDistribution, checkpointAllGaugesVestedEscrow.sol
: setAdmin, setFundAdmin, initializeUnallocatedSupplyThe text was updated successfully, but these errors were encountered: