From 8d46f876f490332a8466feffea98f60deb309ef9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 17 Nov 2022 17:01:23 -0300 Subject: [PATCH 1/4] Add tokens task --- pkg/deployments/hardhat.config.ts | 4 ++++ pkg/deployments/tasks/00000000-tokens/output/arbitrum.json | 4 ++++ pkg/deployments/tasks/00000000-tokens/output/bsc.json | 3 +++ pkg/deployments/tasks/00000000-tokens/output/gnosis.json | 4 ++++ pkg/deployments/tasks/00000000-tokens/output/goerli.json | 4 ++++ pkg/deployments/tasks/00000000-tokens/output/mainnet.json | 4 ++++ pkg/deployments/tasks/00000000-tokens/output/optimism.json | 4 ++++ pkg/deployments/tasks/00000000-tokens/output/polygon.json | 4 ++++ 8 files changed, 31 insertions(+) create mode 100644 pkg/deployments/tasks/00000000-tokens/output/arbitrum.json create mode 100644 pkg/deployments/tasks/00000000-tokens/output/bsc.json create mode 100644 pkg/deployments/tasks/00000000-tokens/output/gnosis.json create mode 100644 pkg/deployments/tasks/00000000-tokens/output/goerli.json create mode 100644 pkg/deployments/tasks/00000000-tokens/output/mainnet.json create mode 100644 pkg/deployments/tasks/00000000-tokens/output/optimism.json create mode 100644 pkg/deployments/tasks/00000000-tokens/output/polygon.json diff --git a/pkg/deployments/hardhat.config.ts b/pkg/deployments/hardhat.config.ts index 673f4fdee1..7bb9e317a9 100644 --- a/pkg/deployments/hardhat.config.ts +++ b/pkg/deployments/hardhat.config.ts @@ -85,6 +85,10 @@ task('check-deployments', `Check that all tasks' deployments correspond to their await new Task(args.id, TaskMode.CHECK, hre.network.name).run(args); } else { for (const taskID of Task.getAllTaskIds()) { + if (taskID.startsWith('00000000-')) { + continue; + } + const task = new Task(taskID, TaskMode.CHECK, hre.network.name); const outputDir = path.resolve(task.dir(), 'output'); diff --git a/pkg/deployments/tasks/00000000-tokens/output/arbitrum.json b/pkg/deployments/tasks/00000000-tokens/output/arbitrum.json new file mode 100644 index 0000000000..a754a9f246 --- /dev/null +++ b/pkg/deployments/tasks/00000000-tokens/output/arbitrum.json @@ -0,0 +1,4 @@ +{ + "BAL": "0x040d1EdC9569d4Bab2D15287Dc5A4F10F56a56B8", + "WETH": "0x82aF49447D8a07e3bd95BD0d56f35241523fBab1" +} diff --git a/pkg/deployments/tasks/00000000-tokens/output/bsc.json b/pkg/deployments/tasks/00000000-tokens/output/bsc.json new file mode 100644 index 0000000000..2ed8a2a917 --- /dev/null +++ b/pkg/deployments/tasks/00000000-tokens/output/bsc.json @@ -0,0 +1,3 @@ +{ + "WETH": "0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c" +} diff --git a/pkg/deployments/tasks/00000000-tokens/output/gnosis.json b/pkg/deployments/tasks/00000000-tokens/output/gnosis.json new file mode 100644 index 0000000000..cf7fc39b29 --- /dev/null +++ b/pkg/deployments/tasks/00000000-tokens/output/gnosis.json @@ -0,0 +1,4 @@ +{ + "BAL": "0x7eF541E2a22058048904fE5744f9c7E4C57AF717", + "WETH": "0xdFCeA9088c8A88A76FF74892C1457C17dfeef9C1" +} diff --git a/pkg/deployments/tasks/00000000-tokens/output/goerli.json b/pkg/deployments/tasks/00000000-tokens/output/goerli.json new file mode 100644 index 0000000000..bc793eedfc --- /dev/null +++ b/pkg/deployments/tasks/00000000-tokens/output/goerli.json @@ -0,0 +1,4 @@ +{ + "BAL": "0xfA8449189744799aD2AcE7e0EBAC8BB7575eff47", + "WETH": "0xdFCeA9088c8A88A76FF74892C1457C17dfeef9C1" +} diff --git a/pkg/deployments/tasks/00000000-tokens/output/mainnet.json b/pkg/deployments/tasks/00000000-tokens/output/mainnet.json new file mode 100644 index 0000000000..1fc6c7c700 --- /dev/null +++ b/pkg/deployments/tasks/00000000-tokens/output/mainnet.json @@ -0,0 +1,4 @@ +{ + "BAL": "0xba100000625a3754423978a60c9317c58a424e3D", + "WETH": "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2" +} diff --git a/pkg/deployments/tasks/00000000-tokens/output/optimism.json b/pkg/deployments/tasks/00000000-tokens/output/optimism.json new file mode 100644 index 0000000000..532e98ea99 --- /dev/null +++ b/pkg/deployments/tasks/00000000-tokens/output/optimism.json @@ -0,0 +1,4 @@ +{ + "BAL": "0xFE8B128bA8C78aabC59d4c64cEE7fF28e9379921", + "WETH": "0x4200000000000000000000000000000000000006" +} diff --git a/pkg/deployments/tasks/00000000-tokens/output/polygon.json b/pkg/deployments/tasks/00000000-tokens/output/polygon.json new file mode 100644 index 0000000000..bb848d7387 --- /dev/null +++ b/pkg/deployments/tasks/00000000-tokens/output/polygon.json @@ -0,0 +1,4 @@ +{ + "BAL": "0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3", + "WETH": "0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270" +} From c08f06415f0eb3b306f7be065c34f2541bbbecd6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Thu, 17 Nov 2022 17:08:57 -0300 Subject: [PATCH 2/4] Use inputs --- .../tasks/00000000-tokens/output/gnosis.json | 2 +- pkg/deployments/tasks/20210418-vault/input.ts | 46 +++++-------------- .../input.ts | 13 ++---- 3 files changed, 18 insertions(+), 43 deletions(-) diff --git a/pkg/deployments/tasks/00000000-tokens/output/gnosis.json b/pkg/deployments/tasks/00000000-tokens/output/gnosis.json index cf7fc39b29..63ab0d4981 100644 --- a/pkg/deployments/tasks/00000000-tokens/output/gnosis.json +++ b/pkg/deployments/tasks/00000000-tokens/output/gnosis.json @@ -1,4 +1,4 @@ { "BAL": "0x7eF541E2a22058048904fE5744f9c7E4C57AF717", - "WETH": "0xdFCeA9088c8A88A76FF74892C1457C17dfeef9C1" + "WETH": "0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d" } diff --git a/pkg/deployments/tasks/20210418-vault/input.ts b/pkg/deployments/tasks/20210418-vault/input.ts index 9879d43f07..b4539cc06d 100644 --- a/pkg/deployments/tasks/20210418-vault/input.ts +++ b/pkg/deployments/tasks/20210418-vault/input.ts @@ -9,54 +9,32 @@ export type VaultDeployment = { }; const Authorizer = new Task('20210418-authorizer', TaskMode.READ_ONLY); +const Tokens = new Task('00000000-tokens', TaskMode.READ_ONLY); export default { - kovan: { - Authorizer, - weth: '0xdFCeA9088c8A88A76FF74892C1457C17dfeef9C1', - pauseWindowDuration: 3 * MONTH, - bufferPeriodDuration: MONTH, - }, + Authorizer, + pauseWindowDuration: 3 * MONTH, + bufferPeriodDuration: MONTH, + mainnet: { - Authorizer, - weth: '0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', - pauseWindowDuration: 3 * MONTH, - bufferPeriodDuration: MONTH, + weth: Tokens.output({ network: 'mainnet' }).WETH, }, polygon: { - Authorizer, - weth: '0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270', // WMATIC - pauseWindowDuration: 3 * MONTH, - bufferPeriodDuration: MONTH, + weth: Tokens.output({ network: 'polygon' }).WETH, // WMATIC }, arbitrum: { - Authorizer, - weth: '0x82aF49447D8a07e3bd95BD0d56f35241523fBab1', - pauseWindowDuration: 3 * MONTH, - bufferPeriodDuration: MONTH, + weth: Tokens.output({ network: 'arbitrum' }).WETH, }, optimism: { - Authorizer, - weth: '0x4200000000000000000000000000000000000006', - pauseWindowDuration: 3 * MONTH, - bufferPeriodDuration: MONTH, + weth: Tokens.output({ network: 'optimism' }).WETH, }, gnosis: { - Authorizer, - weth: '0xe91D153E0b41518A2Ce8Dd3D7944Fa863463a97d', // wxDAI - pauseWindowDuration: 3 * MONTH, - bufferPeriodDuration: MONTH, + weth: Tokens.output({ network: 'gnosis' }).WETH, // wxDAI }, bsc: { - Authorizer, - weth: '0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', // WBNB - pauseWindowDuration: 3 * MONTH, - bufferPeriodDuration: MONTH, + weth: Tokens.output({ network: 'bsc' }).WETH, // WBNB }, goerli: { - Authorizer, - weth: '0xdFCeA9088c8A88A76FF74892C1457C17dfeef9C1', - pauseWindowDuration: 3 * MONTH, - bufferPeriodDuration: MONTH, + weth: Tokens.output({ network: 'goerli' }).WETH, }, }; diff --git a/pkg/deployments/tasks/20220413-child-chain-gauge-factory/input.ts b/pkg/deployments/tasks/20220413-child-chain-gauge-factory/input.ts index bca46e20c8..ce4dee2eb9 100644 --- a/pkg/deployments/tasks/20220413-child-chain-gauge-factory/input.ts +++ b/pkg/deployments/tasks/20220413-child-chain-gauge-factory/input.ts @@ -8,24 +8,21 @@ export type ChildChainLiquidityGaugeFactoryDeployment = { const AuthorizerAdaptor = new Task('20220325-authorizer-adaptor', TaskMode.READ_ONLY); const Vault = new Task('20210418-vault', TaskMode.READ_ONLY); -const TestBalancerToken = new Task('20220325-test-balancer-token', TaskMode.READ_ONLY); +const Tokens = new Task('00000000-tokens', TaskMode.READ_ONLY); export default { AuthorizerAdaptor, Vault, - kovan: { - BAL: TestBalancerToken.output({ network: 'kovan' }).TestBalancerToken, - }, polygon: { - BAL: '0x9a71012B13CA4d3D0Cdc72A177DF3ef03b0E76A3', + BAL: Tokens.output({ network: 'polygon' }).BAL, }, arbitrum: { - BAL: '0x040d1EdC9569d4Bab2D15287Dc5A4F10F56a56B8', + BAL: Tokens.output({ network: 'arbitrum' }).BAL, }, optimism: { - BAL: '0xFE8B128bA8C78aabC59d4c64cEE7fF28e9379921', + BAL: Tokens.output({ network: 'optimism' }).BAL, }, goerli: { - BAL: TestBalancerToken.output({ network: 'goerli' }).TestBalancerToken, + BAL: Tokens.output({ network: 'goerli' }).BAL, }, }; From 9d0035716a921e36e79fa3604ee84b1ea3a587c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Tue, 22 Nov 2022 14:20:18 -0300 Subject: [PATCH 3/4] Add readme --- pkg/deployments/tasks/00000000-tokens/readme.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 pkg/deployments/tasks/00000000-tokens/readme.md diff --git a/pkg/deployments/tasks/00000000-tokens/readme.md b/pkg/deployments/tasks/00000000-tokens/readme.md new file mode 100644 index 0000000000..6fce157f70 --- /dev/null +++ b/pkg/deployments/tasks/00000000-tokens/readme.md @@ -0,0 +1,5 @@ +# Tokens + +This is not a real task, but rather a collection of token addresses that are useful so that they can be referenced in other tasks. The tokens included are WETH and BAL. + +Not all networks use ETH as their native token: in these, WETH really represents the wrapped native token. Examples include WMATIC in Polygon, WBNB in Binance and WXDAI in Gnosis. From 741d77131dcf52ddbdff168a69847695a153dce5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicol=C3=A1s=20Venturo?= Date: Tue, 22 Nov 2022 14:22:18 -0300 Subject: [PATCH 4/4] Apply review comments --- pkg/deployments/tasks/20210418-vault/index.ts | 2 +- pkg/deployments/tasks/20210418-vault/input.ts | 27 +++---------------- .../input.ts | 15 ++--------- 3 files changed, 6 insertions(+), 38 deletions(-) diff --git a/pkg/deployments/tasks/20210418-vault/index.ts b/pkg/deployments/tasks/20210418-vault/index.ts index 57ee23c19b..446feea556 100644 --- a/pkg/deployments/tasks/20210418-vault/index.ts +++ b/pkg/deployments/tasks/20210418-vault/index.ts @@ -4,7 +4,7 @@ import { TaskRunOptions } from '../../src/types'; export default async (task: Task, { force, from }: TaskRunOptions = {}): Promise => { const input = task.input() as VaultDeployment; - const vaultArgs = [input.Authorizer, input.weth, input.pauseWindowDuration, input.bufferPeriodDuration]; + const vaultArgs = [input.Authorizer, input.WETH, input.pauseWindowDuration, input.bufferPeriodDuration]; const vault = await task.deployAndVerify('Vault', vaultArgs, from, force); // The vault automatically also deploys the protocol fees collector: we must verify it diff --git a/pkg/deployments/tasks/20210418-vault/input.ts b/pkg/deployments/tasks/20210418-vault/input.ts index b4539cc06d..1ec2961ea4 100644 --- a/pkg/deployments/tasks/20210418-vault/input.ts +++ b/pkg/deployments/tasks/20210418-vault/input.ts @@ -3,38 +3,17 @@ import { MONTH } from '@balancer-labs/v2-helpers/src/time'; export type VaultDeployment = { Authorizer: string; - weth: string; + WETH: string; pauseWindowDuration: number; bufferPeriodDuration: number; }; const Authorizer = new Task('20210418-authorizer', TaskMode.READ_ONLY); -const Tokens = new Task('00000000-tokens', TaskMode.READ_ONLY); +const WETH = new Task('00000000-tokens', TaskMode.READ_ONLY); export default { Authorizer, pauseWindowDuration: 3 * MONTH, bufferPeriodDuration: MONTH, - - mainnet: { - weth: Tokens.output({ network: 'mainnet' }).WETH, - }, - polygon: { - weth: Tokens.output({ network: 'polygon' }).WETH, // WMATIC - }, - arbitrum: { - weth: Tokens.output({ network: 'arbitrum' }).WETH, - }, - optimism: { - weth: Tokens.output({ network: 'optimism' }).WETH, - }, - gnosis: { - weth: Tokens.output({ network: 'gnosis' }).WETH, // wxDAI - }, - bsc: { - weth: Tokens.output({ network: 'bsc' }).WETH, // WBNB - }, - goerli: { - weth: Tokens.output({ network: 'goerli' }).WETH, - }, + WETH, }; diff --git a/pkg/deployments/tasks/20220413-child-chain-gauge-factory/input.ts b/pkg/deployments/tasks/20220413-child-chain-gauge-factory/input.ts index ce4dee2eb9..68c2cc64ca 100644 --- a/pkg/deployments/tasks/20220413-child-chain-gauge-factory/input.ts +++ b/pkg/deployments/tasks/20220413-child-chain-gauge-factory/input.ts @@ -8,21 +8,10 @@ export type ChildChainLiquidityGaugeFactoryDeployment = { const AuthorizerAdaptor = new Task('20220325-authorizer-adaptor', TaskMode.READ_ONLY); const Vault = new Task('20210418-vault', TaskMode.READ_ONLY); -const Tokens = new Task('00000000-tokens', TaskMode.READ_ONLY); +const BAL = new Task('00000000-tokens', TaskMode.READ_ONLY); export default { AuthorizerAdaptor, Vault, - polygon: { - BAL: Tokens.output({ network: 'polygon' }).BAL, - }, - arbitrum: { - BAL: Tokens.output({ network: 'arbitrum' }).BAL, - }, - optimism: { - BAL: Tokens.output({ network: 'optimism' }).BAL, - }, - goerli: { - BAL: Tokens.output({ network: 'goerli' }).BAL, - }, + BAL, };