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:

claimsExists

modifier claimsExists(uint256 claimId_)

Check that the claim exists

Parameters:


Read Functions info

arbitrationCost

function arbitrationCost() public view returns (uint256)

Returns the cost of arbitration for a Kleros dispute.

Return values:

metaEvidenceURI

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

Returns the URI of the meta-evidence for a claim

Parameters:

Return values:

coverIdToClaimIds

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

Returns all claim IDs associated with a cover.

Parameters:

Return values:

claimInfo

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

Get a claim by its ID.

Parameters:

Return values:

claimInfos

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

Returns multiple claims by their IDs.

Parameters:

Return values:

claimsByCoverId

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

Returns all the claims associated with a cover.

Parameters:

Return values:

claimsByAccount

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

Returns all the claims of a user.

Parameters:

Return values:

getClaimEvidence

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

Returns the evidence submitted by claimant for a claim.

Parameters:

Return values:

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:

Return values:


Write Functions info

submitEvidenceForClaim

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

Adds evidence IPFS CIDs for a claim.

Parameters:

initiateClaim

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

Initiates a payment claim to Kleros by a cover holder.

Parameters:

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:

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:


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:

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:

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:

Last updated