-
Notifications
You must be signed in to change notification settings - Fork 71
Open
Labels
Description
On-chain insurance policy management for tokenized assets. Policies track coverage, premiums, and validity periods.
Requirements
InsurancePolicy struct: policy_id: BytesN<32>, holder: Address, insurer: Address, asset_id: BytesN<32>, policy_type: PolicyType (enum: Liability, Property, Comprehensive, Custom), coverage_amount: i128, deductible: i128, premium: i128, start_date: u64, end_date: u64, status: PolicyStatus (Active, Suspended, Expired, Cancelled), auto_renew: bool, last_payment: u64
Functions:
create_insurance_policy(...)— Validates dates, stores policy, indexes by asset IDcancel_insurance_policy(env, policy_id, caller)— caller must be holder or insurersuspend_insurance_policy(env, policy_id, insurer)— insurer onlyexpire_insurance_policy(env, policy_id)— permissionless; validatesend_date < current timestamprenew_insurance_policy(env, policy_id, new_end_date, insurer)— insurer onlyget_insurance_policy,get_asset_insurance_policies
Acceptance Criteria
- Policy status transitions are valid (Active → Cancelled, Active → Suspended, etc.)
-
expire_policyfails ifend_datehas not yet passed - Asset index maintains all policy IDs for that asset
Reactions are currently unavailable