Covest Labs Docs
  • Covest InSaaS Protocol
    • InSaaS Architecture
      • Basic Signed Quote Model
    • InSaaS Components
      • Governance
      • Risk Assessment
      • Claim Assessment
      • Validator Selection
      • Risk Carrier
    • InSaaS Smart Contracts
      • Policy States
      • Claim Case States
      • Operator
        • Pool Manager
        • Pricing Manager
        • Policy Manager
        • Claim Manager
      • Policyholder
        • Policy Manager
          • issuePolicy
          • redeemPolicy
          • Others
        • Claim Manager
          • submitClaim
          • Others
      • Claim Assessor
        • Claim Manager
      • Governance Board
        • Claim Manager
      • Contract Integration
  • Covest Warranty
    • Key Components
    • System Overview
    • Core Features
      • Contract Management
      • Warranty Certificate
      • Claim Management
      • Customer Portal
    • API Documentations
    • API Diagrams
      • Create Order Flow
      • Redeem Order Flow
Powered by GitBook
On this page
  • onPolicyIssued
  • onPolicyRedeemed
  • onClaimSubmitted
  1. Covest InSaaS Protocol
  2. InSaaS Smart Contracts

Contract Integration

If policyholder is a smart contract

If the policyholder is a smart contract, the contract must implement certain functions to interact with an insurance contract for the purposes of issuing, redeeming, and submitting claims for policies.

onPolicyIssued

function onPolicyIssued(address operator, address from, string policyId) external returns (bytes4)

This function will called by the insurance contract (policy manager facet) when the policy is issued and the caller is contract.

The selector can be obtained in Solidity with IInsuranceIssuer.onPolicyIssued.selector.

Name
Type
Description

operator

address

The operator address.

from

address

The from address.

policyId

string

The policy id.

Name
Type
Description

[0]

bytes4

The bytes4 of the selector of onPolicyIssued function.

onPolicyRedeemed

function onPolicyRedeemed(address operator, address from, string policyId) external returns (bytes4)

This function will called by the insurance contract (policy manager facet) when the policy is redeemed and the caller is contract.

The selector can be obtained in Solidity with IInsuranceIssuer.onPolicyRedeemed.selector.

Name
Type
Description

operator

address

The operator address.

from

address

The caller address.

policyId

string

The policy id.

Name
Type
Description

[0]

bytes4

The bytes4 of the selector of onPolicyRedeemed function.

onClaimSubmitted

function onClaimSubmitted(address operator, address from, string policyId) external returns (bytes4)

This function will called by the insurance contract (claim manager facet) when the policy is submitted and the caller is contract.

The selector can be obtained in Solidity with IInsuranceIssuer.onClaimSubmitted.selector.

Name
Type
Description

operator

address

The operator address.

from

address

The caller address.

policyId

string

The policy id.

Name
Type
Description

[0]

bytes4

The bytes4 of the selector of onClaimSubmitted function.

PreviousClaim ManagerNextCovest Warranty

Last updated 2 years ago