The premuim and the claim amount are calculated based on the information returned from the query to the blockchain. This will be proportional to the sector size. While requestiong claim from the smart contract the storage provider will have to hand over the benificiary address (this can be changed using the MinorAPI provided in future) which will verifed and the funds will be released to the storage provider.
Step 1.
git clone https://github.com/adityabhattad2021/filecoin_insurance.git
cd filecoin_insurance
yarn
Step 2.
Create a .env folder and configure the required keys
Step 3.
- To run tests:
yarn hardhat test
- To check coverage
yarn hardhat coverage
- Register the Storage Provider
yarn hardhat node
yarn hardhat run scripts/registerStorageProvider.js --network localhost
- Pay Insurance from the storage provider account
yarn hardhat node
yarn hardhat run scripts/payPremium.js --network localhost
- Claim Insurance if valid
yarn hardhat node
yarn hardhat run scripts/claim.js --network localhost