> For the complete documentation index, see [llms.txt](https://www-covercompared.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www-covercompared.gitbook.io/docs/covercompared-dapp/defi-covers/isurace.md).

# 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
