diff --git a/scripts/foundry/UpgradeRouter.s.sol b/scripts/foundry/UpgradeRouter.s.sol index 61de30c..7503eed 100644 --- a/scripts/foundry/UpgradeRouter.s.sol +++ b/scripts/foundry/UpgradeRouter.s.sol @@ -14,32 +14,30 @@ import { AngleRouterLinea } from "contracts/implementations/linea/AngleRouterLin import { AngleRouterPolygon } from "contracts/implementations/polygon/AngleRouterPolygon.sol"; contract UpgradeRouterScript is Script, CommonUtils { + function run() public { + uint256 chainId = vm.envUint("CHAIN_ID"); -function run() public { - uint256 chainId = vm.envUint("CHAIN_ID"); + address routerImpl; + if (chainId == CHAIN_ETHEREUM) { + routerImpl = address(new AngleRouterMainnet()); + } else if (chainId == CHAIN_ARBITRUM) { + routerImpl = address(new AngleRouterArbitrum()); + } else if (chainId == CHAIN_OPTIMISM) { + routerImpl = address(new AngleRouterOptimism()); + } else if (chainId == CHAIN_AVALANCHE) { + routerImpl = address(new AngleRouterAvalanche()); + } else if (chainId == CHAIN_BASE) { + routerImpl = address(new AngleRouterBase()); + } else if (chainId == CHAIN_CELO) { + routerImpl = address(new AngleRouterCelo()); + } else if (chainId == CHAIN_GNOSIS) { + routerImpl = address(new AngleRouterGnosis()); + } else if (chainId == CHAIN_LINEA) { + routerImpl = address(new AngleRouterLinea()); + } else if (chainId == CHAIN_POLYGON) { + routerImpl = address(new AngleRouterPolygon()); + } - address routerImpl; - if (chainId == CHAIN_ETHEREUM) { - routerImpl = address(new AngleRouterMainnet()); - } else if (chainId == CHAIN_ARBITRUM) { - routerImpl = address(new AngleRouterArbitrum()); - } else if (chainId == CHAIN_OPTIMISM) { - routerImpl = address(new AngleRouterOptimism()); - } else if (chainId == CHAIN_AVALANCHE) { - routerImpl = address(new AngleRouterAvalanche()); - } else if (chainId == CHAIN_BASE) { - routerImpl = address(new AngleRouterBase()); - } else if (chainId == CHAIN_CELO) { - routerImpl = address(new AngleRouterCelo()); - } else if (chainId == CHAIN_GNOSIS) { - routerImpl = address(new AngleRouterGnosis()); - } else if (chainId == CHAIN_LINEA) { - routerImpl = address(new AngleRouterLinea()); - } else if (chainId == CHAIN_POLYGON) { - routerImpl = address(new AngleRouterPolygon()); + console.log("Deployed router implementation at address: %s", routerImpl); } - - console.log("Deployed router implementation at address: %s", routerImpl); -} - }