ClaimManager

The ClaimManager contract manages the lifecycle of claims from initiation to resolution. It coordinates interactions between users, the Liquidity Manager, and arbitration courts. This contracts ensures a fair and transparent system for cover holders to submit claims and receive compensation when eligible.


Enums info

ClaimStatus

enum ClaimStatus {
  Initiated,
  Accepted,
  Compensated,
  Disputed,
  RejectedByOverrule,
  RejectedByRefusalToArbitrate,
  RejectedByCourtDecision,
  AcceptedByCourtDecision,
  CompensatedAfterDispute
}

RulingOptions

enum RulingOptions {
  RefusedToArbitrate,
  PayClaimant,
  RejectClaim
}

The neutral "refuse to arbitrate" option IS ALWAYS 0


Structs info

ClaimRead

struct ClaimRead {
 uint256 claimId;
 address claimant;
 string[] evidence;
 string[] counterEvidence;
 uint256[] relatedClaimIds;
 uint64 poolId;
 uint256 coverAmount;
 bool isCoverActive;
 uint64 createdAt;
 uint64 rulingTimestamp;
 uint64 challengedTimestamp;
 ClaimManager.ClaimStatus status;
 uint256 coverId;
 uint256 disputeId;
 string metaEvidenceURI;
 uint256 amount;
 address prosecutor;
 uint256 deposit;
}

Claim

struct Claim {
 uint64 createdAt;
 uint64 rulingTimestamp;
 uint64 challengedTimestamp;
 ClaimManager.ClaimStatus status;
 uint256 coverId;
 uint256 disputeId;
 uint256 amount;
 address claimant;
 address prosecutor;
 uint256 deposit;
}

State variables info

baseMetaEvidenceURI

string baseMetaEvidenceURI

coverToken

contract IAthenaCoverToken coverToken

liquidityManager

contract ILiquidityManager liquidityManager

arbitrator

contract IArbitrator arbitrator

evidenceGuardian

address evidenceGuardian

overruleGuardian

address overruleGuardian

nextClaimId

uint256 nextClaimId

claims

mapping(uint256 => struct ClaimManager.Claim) claims

disputeIdToClaimId

mapping(uint256 => uint256) disputeIdToClaimId

claimIdToEvidence

mapping(uint256 => string[]) claimIdToEvidence

claimIdToCounterEvidence

mapping(uint256 => string[]) claimIdToCounterEvidence

claimCollateral

uint256 claimCollateral

klerosExtraData

bytes klerosExtraData

challengePeriod

uint64 challengePeriod

overrulePeriod

uint64 overrulePeriod

evidenceUploadPeriod

uint64 evidenceUploadPeriod

numberOfRulingOptions

uint64 immutable numberOfRulingOptions = 2

courtClosed

bool courtClosed

Modifiers info

onlyArbitrator

modifier onlyArbitrator()

Check that the caller is the arbitrator contract

coverExists

modifier coverExists(uint256 coverId_)

Check that the cover exists

Parameters:

Name
Type
Description

coverId_

uint256

The cover ID

claimsExists

modifier claimsExists(uint256 claimId_)

Check that the claim exists

Parameters:

Name
Type
Description

claimId_

uint256

The claim ID


Read Functions info

arbitrationCost

function arbitrationCost() public view returns (uint256)

Returns the cost of arbitration for a Kleros dispute.

Return values:

Name
Type
Description

--

uint256

The arbitration cost

metaEvidenceURI

function metaEvidenceURI(uint256 claimId) public view returns (string memory)

Returns the URI of the meta-evidence for a claim

Parameters:

Name
Type
Description

claimId

uint256

The claim ID

Return values:

Name
Type
Description

--

string

The URI of the meta-evidence

coverIdToClaimIds

function coverIdToClaimIds(
    uint256 coverId_
) external view coverExists(coverId_) returns (uint256[] memory)

Returns all claim IDs associated with a cover.

Parameters:

Name
Type
Description

coverId_

uint256

The cover ID

Return values:

Name
Type
Description

--

uint256[]

All the claim IDs associated with the cover

claimInfo

function claimInfo(
    uint256 claimId_
) external view returns (ClaimManager.ClaimRead memory)

Get a claim by its ID.

Parameters:

Name
Type
Description

claimId_

uint256

The claim ID

Return values:

Name
Type
Description

--

struct ClaimManager.ClaimRead

The claim's data

claimInfos

function claimInfos(
    uint256[] memory claimIds_
) public view returns (ClaimManager.ClaimRead[] memory result)

Returns multiple claims by their IDs.

Parameters:

Name
Type
Description

claimIds_

uint256[]

The claim IDs

Return values:

Name
Type
Description

result

struct ClaimManager.ClaimRead[]

All the claims' data

claimsByCoverId

function claimsByCoverId(
    uint256 coverId_
) public view returns (ClaimManager.ClaimRead[] memory)

Returns all the claims associated with a cover.

Parameters:

Name
Type
Description

coverId_

uint256

The cover ID

Return values:

Name
Type
Description

--

struct ClaimManager.ClaimRead[]

All the cover's claims

claimsByAccount

function claimsByAccount(
    address account_
) external view returns (ClaimManager.ClaimRead[] memory result)

Returns all the claims of a user.

Parameters:

Name
Type
Description

account_

address

The user's address

Return values:

Name
Type
Description

result

struct ClaimManager.ClaimRead[]

All the user's claims

getClaimEvidence

function getClaimEvidence(
    uint256 claimId_
) external view claimsExists(claimId_) returns (string[] memory)

Returns the evidence submitted by claimant for a claim.

Parameters:

Name
Type
Description

claimId_

uint256

The claim ID

Return values:

Name
Type
Description

--

string[]

The evidence CIDs

getClaimCounterEvidence

function getClaimCounterEvidence(
    uint256 claimId_
) external view claimsExists(claimId_) returns (string[] memory)

Returns the counter-evidence submitted by prosecutor or Athena for a claim.

Parameters:

Name
Type
Description

claimId_

uint256

The claim ID

Return values:

Name
Type
Description

--

string[]

The counter-evidence CIDs


Write Functions info

submitEvidenceForClaim

function submitEvidenceForClaim(
    uint256 claimId_,
    string[] calldata ipfsEvidenceCids_
) external claimsExists(claimId_)

Adds evidence IPFS CIDs for a claim.

Parameters:

Name
Type
Description

claimId_

uint256

The claim ID

ipfsEvidenceCids_

string[]

The IPFS CIDs of the evidence

initiateClaim

function initiateClaim(
    uint256 coverId_,
    uint256 amountClaimed_
) external payable nonReentrant

Initiates a payment claim to Kleros by a cover holder.

Parameters:

Name
Type
Description

coverId_

uint256

The cover ID

amountClaimed_

uint256

The amount claimed by the cover holder

disputeClaim

function disputeClaim(
    uint256 claimId_
) external payable claimsExists(claimId_) nonReentrant

Allows a user to challenge a pending claim by creating a dispute in Kleros.

Parameters:

Name
Type
Description

claimId_

uint256

The claim ID

withdrawCompensation

function withdrawCompensation(
    uint256 claimId_
) external claimsExists(claimId_) nonReentrant

Allows the claimant to withdraw the compensation after a dispute has been resolved in their favor or the challenge period has elapsed.

Intentionally public to prevent claimant from indefinitely blocking withdrawals from a pool by not executing the claims ruling.

Parameters:

Name
Type
Description

claimId_

uint256

The claim ID


Events info

ClaimCreated

event ClaimCreated(address indexed claimant, uint256 indexed coverId, uint256 claimId)

DisputeResolved

event DisputeResolved(uint256 claimId, uint256 disputeId, uint256 ruling)

MetaEvidence

event MetaEvidence(uint256 indexedmetaEvidenceID_, stringevidence_)

To be emitted when meta-evidence is submitted.

Parameters:

Name
Type
Description

metaEvidenceID_

uint256

Unique identifier of meta-evidence.

evidence_

string

IPFS path to metaevidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/metaevidence.json'

Evidence

event Evidence(IArbitrator indexedarbitrator_, uint256 indexedevidenceGroupID_, address indexedparty_, stringevidence_)

To be raised when evidence is submitted. Should point to the resource (evidences are not to be stored on chain due to gas considerations).

Parameters:

Name
Type
Description

arbitrator_

contract IArbitrator

The arbitrator of the contract.

evidenceGroupID_

uint256

Unique identifier of the evidence group the evidence belongs to.

party_

address

The address of the party submiting the evidence. Note that 0x0 refers to evidence not submitted by any party.

evidence_

string

IPFS path to evidence, example: '/ipfs/Qmarwkf7C9RuzDEJNnarT3WZ7kem5bk8DZAzx78acJjMFH/evidence.json'

Dispute

event Dispute(IArbitrator indexedarbitrator_, uint256 indexeddisputeID_, uint256metaEvidenceID_, uint256evidenceGroupID_)

To be emitted when a dispute is created to link the correct meta-evidence to the disputeID.

Parameters:

Name
Type
Description

arbitrator_

contract IArbitrator

The arbitrator of the contract.

disputeID_

uint256

ID of the dispute in the Arbitrator contract.

metaEvidenceID_

uint256

Unique identifier of meta-evidence.

evidenceGroupID_

uint256

Unique identifier of the evidence group that is linked to this dispute.

Last updated