diff --git a/contracts/interfaces/IIndividualClaims.sol b/contracts/interfaces/IIndividualClaims.sol index 7fd1c92b1e..f6ab057506 100644 --- a/contracts/interfaces/IIndividualClaims.sol +++ b/contracts/interfaces/IIndividualClaims.sol @@ -74,6 +74,7 @@ struct ClaimDisplay { uint id; uint productId; uint coverId; + uint assessmentId; uint amount; string assetSymbol; uint assetIndex; diff --git a/contracts/modules/assessment/IndividualClaims.sol b/contracts/modules/assessment/IndividualClaims.sol index 92f225f07c..0c18ff3d7d 100644 --- a/contracts/modules/assessment/IndividualClaims.sol +++ b/contracts/modules/assessment/IndividualClaims.sol @@ -185,6 +185,7 @@ contract IndividualClaims is IIndividualClaims, MasterAwareV2 { id, coverData.productId, claim.coverId, + claim.assessmentId, claim.amount, assetSymbol, claim.coverAsset, diff --git a/scripts/deploy/deploy.js b/scripts/deploy/deploy.js index 021faca5e4..a70bddebf4 100644 --- a/scripts/deploy/deploy.js +++ b/scripts/deploy/deploy.js @@ -30,7 +30,7 @@ const productTypes = [ productType: { descriptionIpfsHash: 'protocolCoverIPFSHash', claimMethod: claimMethod.claim, - gracePeriodInDays: 30, + gracePeriod: 30, }, }, { @@ -39,7 +39,7 @@ const productTypes = [ productType: { descriptionIpfsHash: 'custodyCoverIPFSHash', claimMethod: claimMethod.claim, - gracePeriodInDays: 90, + gracePeriod: 90, }, }, { @@ -48,7 +48,7 @@ const productTypes = [ productType: { descriptionIpfsHash: 'yieldTokenCoverIPFSHash', claimMethod: claimMethod.incident, - gracePeriodInDays: 14, + gracePeriod: 14, }, }, ]; @@ -344,14 +344,16 @@ async function main() { return { productId: MaxUint256, + ipfsMetadata: '', product: { productType, yieldTokenAddress, coverAssets, initialPriceRatio: 100, capacityReductionRatio: 0, + useFixedPrice: false, }, - ipfsMetadata: '', + allowedPools: [], }; }); @@ -433,6 +435,7 @@ async function main() { productInitializationParams, depositAmount, trancheId, + '', // ipfsDescriptionHash ); await stakingPool.setStake(productId, parseEther('10000')); @@ -503,8 +506,8 @@ async function main() { const abiPath = path.join(abiDir, `${legacyContractName || abiName}.json`); fs.writeFileSync(abiPath, JSON.stringify(abi, null, 2)); - if (!config.CONTRACTS_ADDRESSES[alias] || isProxy) { - config.CONTRACTS_ADDRESSES[alias] = address; + if (!config.CONTRACTS_ADDRESSES[legacyContractName || alias] || isProxy) { + config.CONTRACTS_ADDRESSES[legacyContractName || alias] = address; } } diff --git a/scripts/mocks/buyV2Covers.js b/scripts/mocks/buyV2Covers.js index 8fe4d2f47b..94df5578f0 100644 --- a/scripts/mocks/buyV2Covers.js +++ b/scripts/mocks/buyV2Covers.js @@ -1,6 +1,6 @@ const { config, network, ethers } = require('hardhat'); const { BigNumber } = ethers; -const { AddressZero } = ethers.constants; +const { AddressZero, MaxUint256 } = ethers.constants; const { parseEther } = ethers.utils; async function main() { @@ -36,6 +36,7 @@ async function main() { commissionRatio: parseEther('0'), commissionDestination: AddressZero, ipfsData: '', + coverId: MaxUint256.toString(), }, [{ poolId: '0', coverAmountInAsset: amount.toString() }], { @@ -56,6 +57,7 @@ async function main() { commissionRatio: parseEther('0'), commissionDestination: AddressZero, ipfsData: '', + coverId: MaxUint256.toString(), }, [{ poolId: '0', coverAmountInAsset: amount.toString() }], { @@ -76,6 +78,7 @@ async function main() { commissionRatio: parseEther('0'), commissionDestination: AddressZero, ipfsData: '', + coverId: MaxUint256.toString(), }, [{ poolId: '0', coverAmountInAsset: amount.toString() }], { diff --git a/test/unit/IndividualClaims/getClaimsToDisplay.js b/test/unit/IndividualClaims/getClaimsToDisplay.js index 8e394cfc5b..6d05695a4e 100644 --- a/test/unit/IndividualClaims/getClaimsToDisplay.js +++ b/test/unit/IndividualClaims/getClaimsToDisplay.js @@ -22,6 +22,7 @@ describe('getClaimsToDisplay', function () { const expectedProductIds = ['1', '0', '1', '0', '1']; const expectedClaimIds = ['0', '1', '2', '3', '4']; const expectedCoverIds = ['3', '1', '2', '0', '4']; + const expectedAssessmentIds = ['0', '1', '2', '3', '4']; const expectedAssetSymbols = ['MOCK', 'MOCK', 'ETH', 'ETH', 'MOCK']; // MOCk is the symbol for the DAI mock const expectedAssetIndexes = ['1', '1', '0', '0', '1']; const expectedAmounts = [parseEther('10'), parseEther('20'), parseEther('30'), parseEther('40'), parseEther('40')]; @@ -170,6 +171,7 @@ describe('getClaimsToDisplay', function () { const actualClaimIds = res.map(x => x.id); const actualProductIds = res.map(x => x.productId); const actualCoverIds = res.map(x => x.coverId); + const actualAssessmentIds = res.map(x => x.assessmentId); const actualAssetSymbols = res.map(x => x.assetSymbol); const actualAssetIndexes = res.map(x => x.assetIndex); const actualAmounts = res.map(x => x.amount); @@ -182,6 +184,7 @@ describe('getClaimsToDisplay', function () { expect(actualClaimIds[i]).to.be.equal(expectedClaimIds[i]); expect(actualProductIds[i]).to.be.equal(expectedProductIds[i]); expect(actualCoverIds[i]).to.be.equal(expectedCoverIds[i]); + expect(actualAssessmentIds[i]).to.be.equal(expectedAssessmentIds[i]); expect(actualAssetSymbols[i]).to.be.equal(expectedAssetSymbols[i]); expect(actualAssetIndexes[i]).to.be.equal(expectedAssetIndexes[i]); expect(actualAmounts[i]).to.be.equal(expectedAmounts[i]);