# IsurAce

### By Cover By ETH

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

```c
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 :&#x20;

* products : InsurAce allows mutliple products to be bought from the platform at once. &#x20;
* 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.

```c
    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 :&#x20;

* 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


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www-covercompared.gitbook.io/docs/covercompared-dapp/defi-covers/isurace.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
