Skip to content

Commit

Permalink
deploying router contract upgrades across different chains
Browse files Browse the repository at this point in the history
  • Loading branch information
sogipec committed Dec 13, 2022
1 parent 512008c commit 91fbe8f
Show file tree
Hide file tree
Showing 15 changed files with 4,291 additions and 21 deletions.
5 changes: 4 additions & 1 deletion deploy/networks/avalanche.json
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
{}
{
"oneInchRouter": "0x1111111254eeb25477b68fb85ed929f73a960582",
"uniswapV3Router": "0x0000000000000000000000000000000000000000"
}
29 changes: 13 additions & 16 deletions deploy/routerMainnet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,20 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {

console.log('Deploying router');

const chainId = ChainId.MAINNET;
console.log('Now deploying implementation');

await deploy('AngleRouterMainnetV2_1_Implementation', {
contract: 'AngleRouterMainnet',
from: deployer.address,
log: !argv.ci,
});

const angleRouterImplementation = (await deployments.get('AngleRouterMainnetV2_1_Implementation')).address;
console.log(`Successfully deployed Angle router implementation at the address ${angleRouterImplementation}`);
console.log('');
/*
const chainId = ChainId.MAINNET;
const json = await import('./networks/' + network.name + '.json');
const proxyAdmin = registry(chainId)?.ProxyAdminGuardian;
const coreBorrow = registry(chainId)?.CoreBorrow;
const angle = registry(chainId)?.ANGLE;
Expand All @@ -24,8 +36,6 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {
const stablecoins: string[] = [];
const justLiquidityGauges: boolean[] = [];
const json = await import('./networks/' + network.name + '.json');

const uniswapRouter = json.uniswapV3Router;
const oneInchAggregator = json.oneInchRouter;
Expand All @@ -44,19 +54,6 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {
console.log(poolManagers);
console.log(gauges);
console.log(stablecoins);

console.log('Now deploying implementation');

await deploy('AngleRouterMainnetV2_1_Implementation', {
contract: 'AngleRouterMainnet',
from: deployer.address,
log: !argv.ci,
});

const angleRouterImplementation = (await deployments.get('AngleRouterMainnetV2_1_Implementation')).address;
console.log(`Successfully deployed Angle router implementation at the address ${angleRouterImplementation}`);
console.log('');
/*
console.log('Now deploying the proxy');
const dataRouter = new ethers.Contract(
Expand Down
8 changes: 4 additions & 4 deletions deploy/routerSidechain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {
chainId = ChainId.POLYGON;
chainName = 'Polygon';
} else {
chainId = ChainId.ARBITRUM;
chainId = ChainId.AVALANCHE;
chainName = network.name.charAt(0).toUpperCase() + network.name.substring(1);
}

Expand All @@ -34,8 +34,9 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {

const routerImplementation = (await ethers.getContract(`${contractName}V2_1_Implementation`)).address;
console.log(`Successfully deployed the implementation for the router at ${routerImplementation}`);
/*
const proxyAdmin = registry(chainId)?.ProxyAdminGuardian;

// const proxyAdmin = registry(chainId)?.ProxyAdminGuardian;
const proxyAdmin = '0xb1F2A25fFB2b095E99f430cAF507cC31F9A3EaAB';
const coreBorrow = registry(chainId)?.CoreBorrow;
console.log('Now deploying the proxy contract');
const dataRouter = new ethers.Contract(
Expand All @@ -55,7 +56,6 @@ const func: DeployFunction = async ({ ethers, deployments, network }) => {
console.log(`${router} ${routerImplementation} ${proxyAdmin} ${dataRouter}`);
console.log('');
console.log('Success');
*/
};

func.tags = ['routerSidechain'];
Expand Down
Loading

0 comments on commit 91fbe8f

Please sign in to comment.