Skip to content

shambadynamic/BlockBima_HardhatSetup

Repository files navigation

Hardhat Setup for Blockbima Smart Contracts

Overview

This protocol consists of mainly 2 smart contracts:

  1. BlockbimaInsuranceProvider: Which represents a BlockBima Insurance Product that acts as a factory for deployment/creation of BlockBima Insurance Contracts with different specifications.

  2. BlockbimaInsuranceConsumer: Which represents a BlockBima Insurance Contract deployed under a particular BlockbimaInsuranceProvider with a particular specification, generally in terms of thematic area representing the type of the insurance, start and end dates representing the duration of the insurance and area of interest representing the concerned geographical location.


Utilising XRPL EVM Sidechain

  1. In ShambaGeoConsumer contract available in Shamba Smart Contract Kit inherited by the BlockbimaInsuranceConsumer contract, we've deployed the Chainlink Operator Contract to XRPL EVM Sidechain, and added the details of the same in our job spec of the corresponding Chainlink XRPL Node that we're running in our backend.

Here's the code snippet containing the deployed operator contract address on XRPL EVM Sidechain (having ETH-ChainId as 1440002):

else if (chainId == 1440002) {
    operatorAddress = 0xf8A6b3b38895C861C37F93EF8058F54B7c16fe75;
}

Permalink to the line of code

  1. Also, in the etherscan object of the hardhat.config.js file, the XRPL EVM Sidechain is added in the customChains array:
customChains: [
    {
        network: "rippleEvmSidechain",
        chainId: 1440002,
        urls: {
            apiURL: "https://evm-sidechain.xrpl.org/api",
            browserURL: "https://evm-sidechain.xrpl.org",
        }
    }
]

This enables us to deploy and verify the contracts fluently on the XRPL EVM Sidechain network by passing the rippleEvmSidechain in the network flag while executing the deploy task:

npx hardhat deploy BlockbimaInsuranceProvider 1440002 --network rippleEvmSidechain

npx hardhat verify ${BlockbimaInsuranceProvider_Address}  1440002 --network rippleEvmSidechain

Application

The application is available as Blockbima for XRPL EVM SIdechain.


UI Screenshots

  1. If user's wallet is not connected to the XRPL EVM Sidechain network:

1

  1. Home page showcasing various data insights as well as a list of BlockBima Insurance Products deployed by the connected user's wallet:

2

  1. Globe showcasing the deployed BlockBima Insurance Contracts at various places:

3

  1. Deployment form for BlockBima Insurance Product and BlockBima Insurance Contract:

4

  1. List of available BlockBima Insurance Products deployed by the connected user's wallet:

5

  1. List of the BlockBima Insurance Contracts deployed under a particular BlockBima Insurance Product deployed by the connected user's wallet:

6


Demo Video

To get a brief demo of the working, you can watch the walkthrough video showcasing the interaction with the application:

BlockBima UI Walkthrough


Deployment using Remix

You can open and interact with this protocol in Remix IDE:

Open In Remix

About

Hardhat Setup for BlockBima Smart Contracts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors