Skip to content

[CT-18] Build on-chain carrier certification registry contract #926

@mftee

Description

@mftee

Problem

Carrier certifications (Operating License, Insurance, Safety, Hazmat) are verified by admins in a centralised off-chain process with no on-chain proof. Verified status can be disputed, altered, or lost in a database incident, with no immutable record of who verified what and when.

Proposed Solution

Create a CertificationRegistry contract inside contracts/package/certification-registry/ that provides an immutable, admin-controlled on-chain record of carrier certifications.

Note: All work must be done inside the contracts/package/ directory. Do not modify any existing contract files outside this folder.

Acceptance Criteria

  • register_certification(carrier_wallet: Address, cert_type: Symbol, issuer_hash: BytesN<32>, expires_at: u64) — admin-only
  • Supported cert types: OPERATING_LICENSE, INSURANCE, SAFETY, HAZMAT, VEHICLE_REG
  • verify_certification(carrier_wallet, cert_type) returns { is_valid: bool, expires_at: u64, issuer_hash: BytesN<32> } — publicly callable
  • revoke_certification(carrier_wallet, cert_type) — admin-only; marks cert as revoked
  • Expired certifications (current time > expires_at) return is_valid: false from verify_certification without needing explicit revocation
  • Unit tests cover: valid certification, expired certification, revoked certification, unknown certification

Metadata

Metadata

Assignees

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions