Skip to content

Finalize WatchRegistry contract + Hardhat tests #3

Description

@trietlu

Description

Review WatchRegistry.sol; confirm the on-chain eventType numbering matches EVENT_TYPE_ID in onchain.service.ts; add NatSpec. Remove recordEvent (decision D1 — backend only uses anchorProof). Enable a real contract test suite.

Affected areas

contracts/contracts/WatchRegistry.sol, contracts/test/, contracts/package.json.

Dependencies / order

First task; nothing blocks it.

Acceptance criteria

  • recordEvent removed; anchorProof retained.
  • Hardhat tests cover: successful anchorProof, Unauthorized revert for a non-writer, and setAuthorizedWriter toggling access.
  • npx hardhat test passes and the contracts test script runs it (no longer a stub).
  • The eventType enum is documented and matches EVENT_TYPE_ID exactly.

Definition of done

  • Implemented on a short-lived feature branch, merged into staging (never main).
  • Verified on the staging preview stack.
  • Docs updated if infra/env/API behavior changes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent-readyScoped and specified for autonomous agent implementationblockchainOn-chain anchoring / smart-contract work

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions