IsurAce

By Cover By ETH

To buy insurAce covers using ETH the buyCoverByETH function is called by the user.

function buyCoverByETH(
        uint16[] memory products,
        uint16[] memory durationInDays,
        uint256[] memory amounts,
        address currency,
        address owner,
        uint256 referralCode,
        uint256 premiumAmount,
        uint256[] memory helperParameters,
        uint256[] memory securityParameters,
        uint8[] memory v,
        bytes32[] memory r,
        bytes32[] memory s
    )

Input variables :

  • products : InsurAce allows mutliple products to be bought from the platform at once.

  • durationInDays : refers to the duration of days for which the product is being bought

  • amounts : refers to the sum being insured on InsurAce

  • currency : refers to the currency of payment for buying the cover

  • owner : [Description needed]

  • referralCode : refers to the InsurAce partner code. In this case it would be CoverCompared's referral address.

  • premiumAmount : refers to the quote price, the premium to be paid to buy the cover

  • helperParameters : It comes from InsureAce api and it is being used to buy cover in InsureAce smart contract.

  • securityParameters : It comes from InsureAce api and it is being used to buy cover in InsureAce smart contract.

  • v : is a signature parameter which comes from InsureAce API

  • r : is a signature parameter which comes from InsureAce API

  • s : is a signature parameter which comes from InsureAce API

By Cover By Token

To buy insurAce covers using compliant ERC20 tokens the buyCoverByToken function is called by the user.

    function buyCoverByToken(
        uint16[] memory products,
        uint16[] memory durationInDays,
        uint256[] memory amounts,
        address currency,
        address owner,
        uint256 referralCode,
        uint256 premiumAmount,
        uint256[] memory helperParameters,
        uint256[] memory securityParameters,
        uint8[] memory v,
        bytes32[] memory r,
        bytes32[] memory s
    )

Input variables :

  • products : InsurAce allows multiple products to be bought from the platform at once. this parameter refers to the address of protocols in which the funds are being insured

  • durationInDays : refers to the duration of days for which the product is being bought

  • amounts : refers to the sum being insured on InsurAce

  • currency : refers to the currency of payment for buying the cover

  • owner : It is the address who owns cover after buying. In our case it should be user wallet address which is trying to buy cover.

  • referralCode : refers to the InsurAce partner code. In this case it would be CoverCompared's referral address.

  • premiumAmount : refers to the quote price, the premium to be paid to buy the cover

  • helperParameters : It comes from InsureAce api and it is being used to buy cover in InsureAce smart contract.

  • securityParameters : It comes from InsureAce api and it is being used to buy cover in InsureAce smart contract.

  • v : is a signature parameter which comes from InsureAce API

  • r : is a signature parameter which comes from InsureAce API

  • s : is a signature parameter which comes from InsureAce API

Last updated