Skip to content

Commit

Permalink
fix: update scenario and migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
MishaShWoof committed Nov 25, 2024
1 parent b028b11 commit 5f26422
Show file tree
Hide file tree
Showing 33 changed files with 12,706 additions and 263 deletions.
4,154 changes: 4,154 additions & 0 deletions campaigns/sepolia-usdc/1732533846731-7149331-start.json

Large diffs are not rendered by default.

4,154 changes: 4,154 additions & 0 deletions campaigns/sepolia-usdc/1732533989184-7149332-finish.json

Large diffs are not rendered by default.

1,898 changes: 1,898 additions & 0 deletions campaigns/sepolia-weth/1732532220563-7149211-start.json

Large diffs are not rendered by default.

1,898 changes: 1,898 additions & 0 deletions campaigns/sepolia-weth/1732532335634-7149212-finish.json

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion contracts/CometRewardsV2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -701,8 +701,12 @@ contract CometRewardsV2 {
bytes32[] memory finishRoots,
address[][] memory assets,
uint256[] memory finishTimestamps

) {
if(campaigns[comet].length == 0) return (startRoots, finishRoots, assets, finishTimestamps);
startRoots = new bytes32[](campaigns[comet].length);
finishRoots = new bytes32[](campaigns[comet].length);
assets = new address[][](campaigns[comet].length);
finishTimestamps = new uint256[](campaigns[comet].length);
for (uint256 i; i < campaigns[comet].length; i++) {
Campaign storage $ = campaigns[comet][i];
startRoots[i] = $.startRoot;
Expand Down
Original file line number Diff line number Diff line change
@@ -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('1732300426_deploy_rewards_v2', {
prepare: async (deploymentManager: DeploymentManager) => {
return {};
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'rewardsV2',
'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<boolean> {
return false;
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'arbitrum', 'usdc.e');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const MULTISIG_ADDRESS = '';
export default migration('1732300422_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732300422_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'arbitrum', 'usdc');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Original file line number Diff line number Diff line change
@@ -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('1732300432_deploy_rewards_v2', {
prepare: async (deploymentManager: DeploymentManager) => {
return {};
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'rewardsV2',
'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<boolean> {
return false;
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'arbitrum', 'usdе');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Original file line number Diff line number Diff line change
@@ -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('1732300439_deploy_rewards_v2', {
prepare: async (deploymentManager: DeploymentManager) => {
return {};
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'rewardsV2',
'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<boolean> {
return false;
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'arbitrum', 'weth');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { expect } from 'chai';
import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager';
import { migration } from '../../../../plugins/deployment_manager/Migration';

const MULTISIG_ADDRESS = '0x3cb4653f3b45f448d9100b118b75a1503281d2ee';
const MULTISIG_ADDRESS = '';

export default migration('1732300459_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732300459_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'base', 'aero');
expect(MULTISIG_ADDRESS.toLowerCase()).to.be.equal((await cometRewardsV2.governor()).toLowerCase());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { expect } from 'chai';
import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager';
import { migration } from '../../../../plugins/deployment_manager/Migration';

const MULTISIG_ADDRESS = '0x3cb4653f3b45f448d9100b118b75a1503281d2ee';
const MULTISIG_ADDRESS = '';

export default migration('1732300468_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732300468_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'base', 'usdbc');
expect(MULTISIG_ADDRESS.toLowerCase()).to.be.equal((await cometRewardsV2.governor()).toLowerCase());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { expect } from 'chai';
import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager';
import { migration } from '../../../../plugins/deployment_manager/Migration';

const MULTISIG_ADDRESS = '0x3cb4653f3b45f448d9100b118b75a1503281d2ee';
const MULTISIG_ADDRESS = '';

export default migration('1732300475_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732300475_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'base', 'usdc');
expect(MULTISIG_ADDRESS.toLowerCase()).to.be.equal((await cometRewardsV2.governor()).toLowerCase());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { expect } from 'chai';
import { DeploymentManager } from '../../../../plugins/deployment_manager/DeploymentManager';
import { migration } from '../../../../plugins/deployment_manager/Migration';

const MULTISIG_ADDRESS = '0x3cb4653F3B45F448D9100b118B75a1503281d2ee';
const MULTISIG_ADDRESS = '';

export default migration('1732300480_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732300480_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'base', 'weth');
expect(MULTISIG_ADDRESS.toLowerCase()).to.be.equal((await cometRewardsV2.governor()).toLowerCase());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const MULTISIG_ADDRESS = '0xbbf3f1421D886E9b2c5D716B5192aC998af2012c';
export default migration('1732299881_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732299881_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usdc');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'mainnet', 'usdc');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { migration } from '../../../../plugins/deployment_manager/Migration';

const MULTISIG_ADDRESS = '0xbbf3f1421D886E9b2c5D716B5192aC998af2012c';

export default migration('1732299881_deploy_rewards_v2', {
export default migration('1732299900_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732299881_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usds');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'mainnet', 'usds');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { migration } from '../../../../plugins/deployment_manager/Migration';

const MULTISIG_ADDRESS = '0xbbf3f1421D886E9b2c5D716B5192aC998af2012c';

export default migration('1732299881_deploy_rewards_v2', {
export default migration('1732299887_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732299881_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'usdt');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'mainnet', 'usdt');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { migration } from '../../../../plugins/deployment_manager/Migration';

const MULTISIG_ADDRESS = '0xbbf3f1421D886E9b2c5D716B5192aC998af2012c';

export default migration('1732299881_deploy_rewards_v2', {
export default migration('1732299893_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732299881_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'weth');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'mainnet', 'weth');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ import { migration } from '../../../../plugins/deployment_manager/Migration';

const MULTISIG_ADDRESS = '0xbbf3f1421D886E9b2c5D716B5192aC998af2012c';

export default migration('1732299881_deploy_rewards_v2', {
export default migration('1732299907_deploy_rewards_v2', {
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'CometRewardsV2',
'rewardsV2',
'CometRewardsV2.sol',
[
MULTISIG_ADDRESS, // The governor who will control the contract
Expand All @@ -25,7 +25,7 @@ export default migration('1732299881_deploy_rewards_v2', {
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('CometRewardsV2', 'mainnet', 'wsteth');
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'mainnet', 'wsteth');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
29 changes: 23 additions & 6 deletions deployments/mantle/usde/migrations/1732300504_deploy_rewards_v2.ts
Original file line number Diff line number Diff line change
@@ -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('1732300504_deploy_rewards_v2', {
prepare: async (deploymentManager: DeploymentManager) => {
return {};
async prepare(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.deploy(
'rewardsV2',
'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<boolean> {
return false;
},

async verify(deploymentManager: DeploymentManager) {
const cometRewardsV2 = await deploymentManager.fromDep('rewardsV2', 'mantle', 'usde');
expect(MULTISIG_ADDRESS).to.be.equal(await cometRewardsV2.governor());
},
});
Loading

0 comments on commit 5f26422

Please sign in to comment.