DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: medium
Invalid

Unbounded loops in route management

The nRoutes counter in StrategyMainnet can grow without bounds as new routes are added through the addRoute function. There is no maximum limit on the number of routes or way to remove old routes. This could lead to denial of service if too many routes are added, as iterating through them would consume too much gas.

function addRoute(
address[11] calldata _route,
uint256[5][5] calldata _swapParams,
address[5] calldata _pools
) external onlyManagement {
routes[nRoutes] = _route;
swapParams[nRoutes] = _swapParams;
pools[nRoutes] = _pools;
nRoutes++;
}

https://github.com/Cyfrin/2024-12-alchemix/blob/82798f4891e41959eef866bd1d4cb44fc1e26439/src/StrategyMainnet.sol#L64

Updates

Appeal created

inallhonesty Lead Judge 7 months ago
Submission Judgement Published
Invalidated
Reason: Lack of quality

Support

FAQs

Can't find an answer? Chat with us on Discord, Twitter or Linkedin.