Skip to content

[Contract] Implement On-Chain Audit Logging Module #477

@yusuftomilola

Description

@yusuftomilola

An audit trail module that records significant events for each asset on-chain, accessible to any caller.

Requirements

AuditEntry struct (in audit.rs): timestamp: u64, action: String, actor: Address, details: String

append_audit_log(env, asset_id, action, actor, details) — Internal function. Reads the current log vec for the asset, appends the new entry, stores back. Used by asset, tokenization, insurance, and leasing modules to record events.

get_asset_log(env, asset_id) — Returns Vec<AuditEntry> (empty vec if no history).

Integration: Wire append_audit_log calls into register_asset, transfer_asset_ownership, retire_asset, and major state changes in tokenization/insurance/leasing.

Acceptance Criteria

  • Audit log grows correctly with each recorded action
  • Log retrieval returns entries in chronological order
  • Internal function cannot be called directly from outside the contract

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions