GIF Contracts

Secure and audited smart contracts to develop decentralized insurance applications.

  • GIF Contracts is a library of smart contracts for decentralized insurance applications.

Overview

Installation

$ npm install @etherisc/gif-contracts

Etherisc GIF Contracts features a stable API, which means your contracts won’t break unexpectedly when upgrading to a newer minor version.

Usage

Once installed, you can use the contracts in the library by importing them:

// contracts/MyProduct.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.2;

import "@etherisc/gif-interface/contracts/components/Product.sol";

contract MyProduct is Product {

    bytes32 public constant POLICY_FLOW = "PolicyDefaultFlow";

    constructor(
        bytes32 productName,
        address token,
        address registry,
        uint256 riskpoolId,
    )
        Product(productName, token, POLICY_FLOW, riskpoolId, registry)
    {
    }
}
If you’re new to smart contract development, head to …​ to learn about creating a new project and compiling your contracts.

To keep your system secure, you should always use the installed code as-is, and neither copy-paste it from online sources, nor modify it yourself. The library is designed so that only the contracts and functions you use are deployed, so you don’t need to worry about it needlessly increasing gas costs.

Error Codes

Each error has a 7-letter identifier of the form XXX-###. The first three letters indicate the component where the error occurred, and the last three letters indicate the error number within that component. A list of the error codes with explanations / conditions is available in the Errors section.

Learn More

The guides in the sidebar will teach about different concepts, and how to use the related contracts that GIF Contracts provides: