The checkUpkeep function in the FeeConversionKeeper contract pre-allocates a fixed-size array (marketIds) to store market IDs that require fee distribution. However, this array may not be fully populated, leading to empty or invalid entries (e.g., 0). These invalid entries are encoded into performData and later decoded in performUpkeep, potentially causing the convertAccumulatedFeesToWeth function to be called with invalid parameters, such as a marketId of 0. This could result in failed transactions, wasted gas, or unintended behavior in the MarketMakingEngine contract.
In checkUpkeep, the marketIds and assets arrays are initialized with a fixed size (liveMarketIds.length * 10), which is significantly larger than the actual number of valid entries.
Unused slots in these arrays are filled with default values (0 for uint128 and address(0) for addresses).
The marketIds and assets arrays, including their empty or invalid entries, are encoded into performData and passed to performUpkeep.
In performUpkeep, performData is decoded into marketIds and assets arrays. If these arrays contain invalid entries (e.g., marketId = 0), the convertAccumulatedFeesToWeth function may revert.
The impact is High because the convertAccumulatedFeesToWeth function will revert, the likelihood is Medium, so the severity is High.
Manual Review
Consider adding validation in performUpkeep
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.