Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion MIGRATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ phase 3 (second ab action)
- claims.initialize
- master.migrate (copies assets/oracles/mcr and moves the funds!)
- transfer registry proxy ownership to Governor
- setup assessing groups for product types
- setup 1 assessing group for all product types
2. safe transaction via TGovernor.execute
- upgrade TGovernor to `Governor.sol` - in theory can be batched above

Expand All @@ -69,6 +69,7 @@ Non AB:

Single AB member ops:
- update existing CoverProduct productTypes to add assessmentCooldownPeriod and payoutRedemptionPeriod values
- cover.populateIpfsMetadata - set cover IPFS metadata to storage

Enzyme:
- remove old depositors and set SwapOperator as a depositor
33 changes: 29 additions & 4 deletions test/fork/v3.js
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ describe('v3 launch', function () {
// get last claim id
const individualClaims = await ethers.getContractAt(abis.IndividualClaims, addresses.IndividualClaims);
const latestClaimCount = await individualClaims.getClaimsCount();
const latestClaimId = latestClaimCount - 1n; // TODO: why subtract 1?!
const latestClaimId = latestClaimCount - 1n;

const claimsAddress = await this.registry.getContractAddressByIndex(ContractIndexes.C_CLAIMS);
this.claims = await ethers.getContractAt('Claims', claimsAddress);
Expand All @@ -409,6 +409,34 @@ describe('v3 launch', function () {
data: this.claims.interface.encodeFunctionData('initialize', [latestClaimId]),
});

// TGovernor -> Assessments.addAssessorsToGroup
const assessmentsAddress = await this.registry.getContractAddressByIndex(ContractIndexes.C_ASSESSMENTS);
this.assessments = await ethers.getContractAt('Assessments', assessmentsAddress);

const assessorIds = [
await this.registry.getMemberId('0x87B2a7559d85f4653f13E6546A14189cd5455d45'),
await this.registry.getMemberId('0x43f4cd7d153701794ce25a01eFD90DdC32FF8e8E'),
await this.registry.getMemberId('0x9063a2C78aFd6C8A3510273d646111Df67D6CB4b'),
];

tGovernorTxs.push({
target: this.assessments.target,
data: this.assessments.interface.encodeFunctionData('addAssessorsToGroup', [assessorIds, 0]), // create new group
});

// TGovernor -> Assessments.setAssessingGroupIdForProductTypes
const assessmentGroupId = 1;
const latestProductTypeCount = await this.coverProducts.getProductTypeCount();
const allProductTypeIds = Array.from({ length: Number(latestProductTypeCount) }, (_, i) => i);

tGovernorTxs.push({
target: this.assessments.target,
data: this.assessments.interface.encodeFunctionData('setAssessingGroupIdForProductTypes', [
allProductTypeIds,
assessmentGroupId,
]),
});

// TGovernance -> NXMaster.migrate
this.master = await ethers.getContractAt('NXMaster', this.master.target); // get upgraded master contract
tGovernanceTxs.push({
Expand Down Expand Up @@ -439,9 +467,6 @@ describe('v3 launch', function () {
const receipt = await abTx.wait();
console.log('Phase 3 AB tx gas used:', receipt.gasUsed.toString());

const assessmentsAddress = await this.registry.getContractAddressByIndex(ContractIndexes.C_ASSESSMENTS);
this.assessments = await ethers.getContractAt('Assessments', assessmentsAddress);

const coverProductsAddress = await this.registry.getContractAddressByIndex(ContractIndexes.C_COVER_PRODUCTS);
this.coverProducts = await ethers.getContractAt('CoverProducts', coverProductsAddress);

Expand Down