DeFiFoundrySolidity
16,653 OP
View results
Submission Details
Severity: low
Valid

Hardcoded Router Address on Mainnet

Summary

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

The router address on Mainnet is hardcoded, making it impossible to update the router dynamically without redeploying the contract. In contrast, Arbitrum and Optimism contracts uses a setRouter function to allow flexible updates to the router address.

function _initStrategy() internal {
router = ICurveRouterNG(0xF0d4c12A5768D806021F80a262B4d39d26C58b8D);
underlying.safeApprove(address(router), type(uint256).max);
}

Mainnet relies on a fixed router address which could result in operational challenges if the router becomes outdated if there's a need for an upgrade.

Tools Used

Manual Review

Recommendations

Add a setRouter function for dynamic router updates.

Updates

Appeal created

inallhonesty Lead Judge 8 months ago
Submission Judgement Published
Validated
Assigned finding tags:

Cannot Set A New Router In `StrategyMainnet.sol`

Support

FAQs

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