From b028b1143d44579b60c0b44b665873776c0e0d34 Mon Sep 17 00:00:00 2001 From: Mikhailo Shabodyash Date: Sun, 24 Nov 2024 04:19:49 +0200 Subject: [PATCH] fix: update migrations --- .../1732300422_deploy_rewards_v2.ts | 29 +++++++++++++++---- .../1732300459_deploy_rewards_v2.ts | 29 +++++++++++++++---- .../1732300468_deploy_rewards_v2.ts | 29 +++++++++++++++---- .../1732300475_deploy_rewards_v2.ts | 29 +++++++++++++++---- .../1732300480_deploy_rewards_v2.ts | 29 +++++++++++++++---- 5 files changed, 115 insertions(+), 30 deletions(-) diff --git a/deployments/arbitrum/usdc/migrations/1732300422_deploy_rewards_v2.ts b/deployments/arbitrum/usdc/migrations/1732300422_deploy_rewards_v2.ts index af6d47851..5639e7143 100644 --- a/deployments/arbitrum/usdc/migrations/1732300422_deploy_rewards_v2.ts +++ b/deployments/arbitrum/usdc/migrations/1732300422_deploy_rewards_v2.ts @@ -1,14 +1,31 @@ +import { expect } from 'chai'; import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; import { migration } from '../../../../plugins/deployment_manager/Migration'; -interface Vars {}; +const MULTISIG_ADDRESS = ''; export default migration('1732300422_deploy_rewards_v2', { - prepare: async (deploymentManager: DeploymentManager) => { - return {}; + async prepare(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.deploy( + 'CometRewardsV2', + 'CometRewardsV2.sol', + [ + MULTISIG_ADDRESS, // The governor who will control the contract + ] + ); + return { cometRewardsV2Address: cometRewardsV2.address }; }, - enact: async (deploymentManager: DeploymentManager, govDeploymentManager: DeploymentManager, vars: Vars) => { - // No governance changes - } + enact: async () => { + // + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds'); + expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor()); + }, }); diff --git a/deployments/base/aero/migrations/1732300459_deploy_rewards_v2.ts b/deployments/base/aero/migrations/1732300459_deploy_rewards_v2.ts index 4735f00c8..e451f6136 100644 --- a/deployments/base/aero/migrations/1732300459_deploy_rewards_v2.ts +++ b/deployments/base/aero/migrations/1732300459_deploy_rewards_v2.ts @@ -1,14 +1,31 @@ +import { expect } from 'chai'; import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; import { migration } from '../../../../plugins/deployment_manager/Migration'; -interface Vars {}; +const MULTISIG_ADDRESS = '0x3cb4653f3b45f448d9100b118b75a1503281d2ee'; export default migration('1732300459_deploy_rewards_v2', { - prepare: async (deploymentManager: DeploymentManager) => { - return {}; + async prepare(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.deploy( + 'CometRewardsV2', + 'CometRewardsV2.sol', + [ + MULTISIG_ADDRESS, // The governor who will control the contract + ] + ); + return { cometRewardsV2Address: cometRewardsV2.address }; }, - enact: async (deploymentManager: DeploymentManager, govDeploymentManager: DeploymentManager, vars: Vars) => { - // No governance changes - } + enact: async () => { + // + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds'); + expect(MULTISIG_ADDRESS.toLowerCase()).to.be.equal((await cometRewardsV2.governor()).toLowerCase()); + }, }); diff --git a/deployments/base/usdbc/migrations/1732300468_deploy_rewards_v2.ts b/deployments/base/usdbc/migrations/1732300468_deploy_rewards_v2.ts index 396e2fdcd..9778254a5 100644 --- a/deployments/base/usdbc/migrations/1732300468_deploy_rewards_v2.ts +++ b/deployments/base/usdbc/migrations/1732300468_deploy_rewards_v2.ts @@ -1,14 +1,31 @@ +import { expect } from 'chai'; import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; import { migration } from '../../../../plugins/deployment_manager/Migration'; -interface Vars {}; +const MULTISIG_ADDRESS = '0x3cb4653f3b45f448d9100b118b75a1503281d2ee'; export default migration('1732300468_deploy_rewards_v2', { - prepare: async (deploymentManager: DeploymentManager) => { - return {}; + async prepare(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.deploy( + 'CometRewardsV2', + 'CometRewardsV2.sol', + [ + MULTISIG_ADDRESS, // The governor who will control the contract + ] + ); + return { cometRewardsV2Address: cometRewardsV2.address }; }, - enact: async (deploymentManager: DeploymentManager, govDeploymentManager: DeploymentManager, vars: Vars) => { - // No governance changes - } + enact: async () => { + // + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds'); + expect(MULTISIG_ADDRESS.toLowerCase()).to.be.equal((await cometRewardsV2.governor()).toLowerCase()); + }, }); diff --git a/deployments/base/usdc/migrations/1732300475_deploy_rewards_v2.ts b/deployments/base/usdc/migrations/1732300475_deploy_rewards_v2.ts index 9ec396e21..dbd4004a2 100644 --- a/deployments/base/usdc/migrations/1732300475_deploy_rewards_v2.ts +++ b/deployments/base/usdc/migrations/1732300475_deploy_rewards_v2.ts @@ -1,14 +1,31 @@ +import { expect } from 'chai'; import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; import { migration } from '../../../../plugins/deployment_manager/Migration'; -interface Vars {}; +const MULTISIG_ADDRESS = '0x3cb4653f3b45f448d9100b118b75a1503281d2ee'; export default migration('1732300475_deploy_rewards_v2', { - prepare: async (deploymentManager: DeploymentManager) => { - return {}; + async prepare(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.deploy( + 'CometRewardsV2', + 'CometRewardsV2.sol', + [ + MULTISIG_ADDRESS, // The governor who will control the contract + ] + ); + return { cometRewardsV2Address: cometRewardsV2.address }; }, - enact: async (deploymentManager: DeploymentManager, govDeploymentManager: DeploymentManager, vars: Vars) => { - // No governance changes - } + enact: async () => { + // + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds'); + expect(MULTISIG_ADDRESS.toLowerCase()).to.be.equal((await cometRewardsV2.governor()).toLowerCase()); + }, }); diff --git a/deployments/base/weth/migrations/1732300480_deploy_rewards_v2.ts b/deployments/base/weth/migrations/1732300480_deploy_rewards_v2.ts index 0ebba38cc..499ee525b 100644 --- a/deployments/base/weth/migrations/1732300480_deploy_rewards_v2.ts +++ b/deployments/base/weth/migrations/1732300480_deploy_rewards_v2.ts @@ -1,14 +1,31 @@ +import { expect } from 'chai'; import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager'; import { migration } from '../../../../plugins/deployment_manager/Migration'; -interface Vars {}; +const MULTISIG_ADDRESS = '0x3cb4653F3B45F448D9100b118B75a1503281d2ee'; export default migration('1732300480_deploy_rewards_v2', { - prepare: async (deploymentManager: DeploymentManager) => { - return {}; + async prepare(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.deploy( + 'CometRewardsV2', + 'CometRewardsV2.sol', + [ + MULTISIG_ADDRESS, // The governor who will control the contract + ] + ); + return { cometRewardsV2Address: cometRewardsV2.address }; }, - enact: async (deploymentManager: DeploymentManager, govDeploymentManager: DeploymentManager, vars: Vars) => { - // No governance changes - } + enact: async () => { + // + }, + + async enacted(): Promise { + return false; + }, + + async verify(deploymentManager: DeploymentManager) { + const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds'); + expect(MULTISIG_ADDRESS.toLowerCase()).to.be.equal((await cometRewardsV2.governor()).toLowerCase()); + }, });