Sandbox
Fire Insurance Demo
This repository holds the smart contracts for a demo fire insurance.
Setup Requirements
-
A running Docker installation
-
Developing with VS Code
-
Working with dev containers
Installing Docker on Windows is sometimes a struggle. Recommended Approach: Follow the installation instructions for Docker Desktop. Installing Docker on Linux or Mac should be straight forward.
Interaction via Command Line
Deploy and Verify with Ganache
brownie console
In the console use the following steps.
from scripts.deploy_fire import help
help()
The help command then shows an example session.
from scripts.deploy_fire import all_in_1, verify_deploy, create_bundle, create_policy, help
(customer, customer2, product, oracle, riskpool, riskpoolWallet, investor, usdc, instance, instanceService, instanceOperator, bundleId, processId, d) = all_in_1(deploy_all=True)
verify_deploy(d, usdc, product)
Deploy to differnt Network with existing Instance
As an example use the Ganache chain that runs in the background of this devcontainer setup.
brownie console --network=ganache
With an existing instance set parameter deploy_all=False
. In this case
the file gif_instance_address.txt
needs to exist and contain the
addresses of the instance registry. The file should be automatically
created during the devconainer setup procedure of this repository.
from scripts.deploy_fire import all_in_1, verify_deploy, create_bundle, create_policy, help
(customer, customer2, product, oracle, riskpool, riskpoolWallet, investor, usdc, instance, instanceService, instanceOperator, bundleId, processId, d) = all_in_1(deploy_all=False)
verify_deploy(d, usdc, product)