submitClaim
Last updated
Last updated
In a typical submit claim operation, the user first submits the data and claim evidences to an Off-chain API, which encrypts the bundle of data before storing all of the encrypted claim evidence in an IPFS service. User may send claim request to "Claim Manager" contract after receiving IPFS hash.
Afterwards, the "Claim Manager" contract to initiate a claim case and establish a claim reserve to reserve potential claim paid, while concurrently invoking the "Validator Manager" contract to select a claim validator for the claim case based on the selection criteria of the "Validator Manager" contract.
When the claim validator is chosen, the claim case will be stamped with the claim validator's contract address. After that, the "Claim Manager" contract will notify the claim validator about the claim job that should be performed.
The submitClaim()
function allows a user to submit a claim for an insurance policy. The function takes one parameter:
SubmitClaimParams
: A struct that contains information about the claim being submitted. This includes the policy ID, document hash, claim amount, signature valid until date, and signature components v, r, and s.
The submitClaim()
function returns a boolean value indicating whether the claim submission was successful or not. It also emits a ClaimSubmitted
event, which includes information about the claim that was submitted, such as the policy ID, claim ID, validator address, claim amount, and document hash.
Requirements:
nonReentrant
The function must not be reentrant.
whenNotPaused
The function must not be paused.
Events:
ClaimSubmitted
Emitted when the claim is submitted successfully.
Parameters
Name | Type | Description |
---|---|---|
claimData | The claim data. |
Return Values
Name | Type | Description |
---|---|---|
[0] | bool | True if the claim is submitted successfully. |
The SubmitClaimParams
struct represents the parameters required to submit a claim for an insurance policy. The struct includes the following fields:
policyId
: A unique identifier for the policy associated with the claim.
documentHash
: The hash of the claim document.
claimAmount
: The amount of the claim.
signatureValidUntil
: The date until which the verifier's signature is valid.
v
: The v
value from the signed message that is used for signature verification.
r
: The r
value from the signed message that is used for signature verification.
s
: The s
value from the signed message that is used for signature verification.
The ClaimSubmitted
event is emitted when a claim is submitted successfully. The event includes the following parameters:
policyId
: The ID of the policy associated with the claim.
claimId
: The ID of the claim that was submitted.
validator
: The address of the validator who selected from the submitted claim.
claimAmount
: The amount of the claim that was submitted.
documentHash
: The hash of the claim document.
The ClaimSubmitted
event is emitted when a user submits a claim successfully. It includes information about the claim that was submitted, including the policy ID, claim ID, validator address, claim amount, and document hash.