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
1 change: 1 addition & 0 deletions contracts/interfaces/IIndividualClaims.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ struct ClaimDisplay {
uint id;
uint productId;
uint coverId;
uint assessmentId;
uint amount;
string assetSymbol;
uint assetIndex;
Expand Down
1 change: 1 addition & 0 deletions contracts/modules/assessment/IndividualClaims.sol
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ contract IndividualClaims is IIndividualClaims, MasterAwareV2 {
id,
coverData.productId,
claim.coverId,
claim.assessmentId,
claim.amount,
assetSymbol,
claim.coverAsset,
Expand Down
15 changes: 9 additions & 6 deletions scripts/deploy/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const productTypes = [
productType: {
descriptionIpfsHash: 'protocolCoverIPFSHash',
claimMethod: claimMethod.claim,
gracePeriodInDays: 30,
gracePeriod: 30,
},
},
{
Expand All @@ -39,7 +39,7 @@ const productTypes = [
productType: {
descriptionIpfsHash: 'custodyCoverIPFSHash',
claimMethod: claimMethod.claim,
gracePeriodInDays: 90,
gracePeriod: 90,
},
},
{
Expand All @@ -48,7 +48,7 @@ const productTypes = [
productType: {
descriptionIpfsHash: 'yieldTokenCoverIPFSHash',
claimMethod: claimMethod.incident,
gracePeriodInDays: 14,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mixplore I think the new gracePeriod param is now in seconds, not in days anymore - @shark0der ?

gracePeriod: 14,
},
},
];
Expand Down Expand Up @@ -344,14 +344,16 @@ async function main() {

return {
productId: MaxUint256,
ipfsMetadata: '',
product: {
productType,
yieldTokenAddress,
coverAssets,
initialPriceRatio: 100,
capacityReductionRatio: 0,
useFixedPrice: false,
},
ipfsMetadata: '',
allowedPools: [],
};
});

Expand Down Expand Up @@ -433,6 +435,7 @@ async function main() {
productInitializationParams,
depositAmount,
trancheId,
'', // ipfsDescriptionHash
);

await stakingPool.setStake(productId, parseEther('10000'));
Expand Down Expand Up @@ -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;
}
}

Expand Down
5 changes: 4 additions & 1 deletion scripts/mocks/buyV2Covers.js
Original file line number Diff line number Diff line change
@@ -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() {
Expand Down Expand Up @@ -36,6 +36,7 @@ async function main() {
commissionRatio: parseEther('0'),
commissionDestination: AddressZero,
ipfsData: '',
coverId: MaxUint256.toString(),
},
[{ poolId: '0', coverAmountInAsset: amount.toString() }],
{
Expand All @@ -56,6 +57,7 @@ async function main() {
commissionRatio: parseEther('0'),
commissionDestination: AddressZero,
ipfsData: '',
coverId: MaxUint256.toString(),
},
[{ poolId: '0', coverAmountInAsset: amount.toString() }],
{
Expand All @@ -76,6 +78,7 @@ async function main() {
commissionRatio: parseEther('0'),
commissionDestination: AddressZero,
ipfsData: '',
coverId: MaxUint256.toString(),
},
[{ poolId: '0', coverAmountInAsset: amount.toString() }],
{
Expand Down
3 changes: 3 additions & 0 deletions test/unit/IndividualClaims/getClaimsToDisplay.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')];
Expand Down Expand Up @@ -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);
Expand All @@ -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]);
Expand Down