Skip to content

[Feature]: Contract Audit Log APIΒ #187

Description

@SudiptaPaul-31

πŸ” Problem Statement

Description

Create an immutable application-level audit trail for contract actions. This ensures transparency, accountability, and traceability across the contract lifecycle.


Track

  • Contract creation β€” record when a new contract is initiated.
  • Milestone creation β€” log when milestones are added to a contract.
  • Milestone submission β€” track freelancer submissions for milestone deliverables.
  • Approval/rejection β€” capture client decisions on submitted milestones.
  • Dispute creation β€” record when disputes are raised, including initiator.
  • Contract completion β€” log when a contract is successfully closed.

Tasks

  • Design immutable audit schema β€” append-only records with no modification allowed.
  • Timestamp every event β€” ensure precise logging with UTC consistency.
  • Record actor wallet/user β€” store the identity of the actor performing the action.
  • Store previous and new states where applicable (e.g., milestone status changes).
  • Implement paginated history API β€” allow clients to fetch logs efficiently.
  • Add access control β€” only authorized users can view contract audit logs.
  • Include filtering options β€” by actor, action type, or date range.

Acceptance Criteria

  • βœ… Timestamp every event β€” all logs include accurate creation time.
  • βœ… Record actor wallet/user β€” identity is always captured.
  • βœ… Store previous and new states where applicable for state transitions.
  • βœ… Provide paginated history API β€” efficient retrieval of logs for large contracts.
  • βœ… Immutable records β€” audit trail cannot be altered or deleted.
  • βœ… Secure access control β€” only authorized parties can view logs.

πŸ“ˆ Expected Impact

High β€” Would significantly improve user experience

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions