V2-SC-005 — Implement Canonical Module Registry and Dependency Validation
Overview
Implement a version-aware module registry that exposes the canonical suite and validates dependency compatibility.
Problem Context
Modular contracts require authoritative dependency addresses. Ad hoc constructor wiring and legacy deployment modules currently allow missing, zero, incompatible, or deprecated components.
This issue belongs to V2-EPIC-SC-001 — Canonical Contract Topology and Deployment. Existing repository issues are historical only; their titles, labels, closure state, or partial implementations do not satisfy this issue.
Technical Scope
- Register canonical module keys, versions, interface IDs, proxy/implementation metadata, and active status.
- Require timelocked governance for replacements and emit versioned module-change events.
- Validate nonzero code-bearing addresses, expected interfaces, release compatibility, and forbidden legacy addresses.
- Provide preflight views used by deployment and consumer-manifest tooling.
The contributor must begin by auditing current files that overlap this scope. Reusable logic may be retained only when it conforms to the governing V2 interfaces, events, authority boundaries, and tests. The pull request must identify reused, replaced, and deprecated paths.
Security and Integrity Requirements
- Prevent self-registration, circular authority, and EOA module addresses.
- Ensure a guardian cannot replace modules.
- Make replacement atomic or fail without partially changing the suite.
- Preserve blockchain authority and every applicable protocol invariant.
- Do not add secrets, production credentials, dummy production addresses, backend settlement authority, or Stellar/Freighter runtime dependencies.
Required Tests
- Registration and replacement authorization tests.
- Interface/version mismatch tests.
- Fuzz tests for invalid keys and addresses.
- Atomicity test for failed multi-module activation.
- Run the repository’s complete required Hardhat and Foundry suites and report unrelated pre-existing failures separately.
- Add regression coverage for every defect or unsafe legacy behavior removed by this work.
Acceptance Criteria
Deliverables
- Production-quality Solidity, interfaces, libraries, deployment code, or test code required by the scope.
- Unit and higher-level tests described above.
- NatSpec and contract-specific technical documentation.
- A pull-request summary covering architecture, security analysis, gas or storage impact, migration implications, and residual risks.
- Evidence of commands run and their results.
Dependencies
V2-SC-001 — Define Canonical V2 Contract Interfaces
V2-SC-004 — Implement Versioned Protocol Configuration Registry
This issue must not be assigned while any required dependency is unresolved or incompatible with the reviewed interface version.
Non-Goals
- Deploying the complete module suite.
- Providing an unrestricted service locator to external callers.
- Creating, modifying, reopening, or relabelling historical GitHub issues.
- Applying the external
Stellar Wave label.
Complexity and Review
- Complexity: high
- Repository:
DigiNodes/truthbounty-contract
- Risk: protocol-critical
- Required review: human maintainer review; automatic merge is prohibited
- Candidate state:
wave-candidate
References
- Protocol specification §§5, 18, 26, 28
- TruthBounty Protocol V2 Specification
- TruthBounty V2 Engineering Blueprint
- ADR-0001 — Canonical V2 Contract Topology
- Drips Stellar Wave Operations
🏷 Labels
- contracts
- architecture
- protocol-critical
- web3
- complexity-high
- wave-candidate
- registry
- governance
- security
V2-SC-005 — Implement Canonical Module Registry and Dependency Validation
Overview
Implement a version-aware module registry that exposes the canonical suite and validates dependency compatibility.
Problem Context
Modular contracts require authoritative dependency addresses. Ad hoc constructor wiring and legacy deployment modules currently allow missing, zero, incompatible, or deprecated components.
This issue belongs to V2-EPIC-SC-001 — Canonical Contract Topology and Deployment. Existing repository issues are historical only; their titles, labels, closure state, or partial implementations do not satisfy this issue.
Technical Scope
The contributor must begin by auditing current files that overlap this scope. Reusable logic may be retained only when it conforms to the governing V2 interfaces, events, authority boundaries, and tests. The pull request must identify reused, replaced, and deprecated paths.
Security and Integrity Requirements
Required Tests
Acceptance Criteria
Deliverables
Dependencies
V2-SC-001— Define Canonical V2 Contract InterfacesV2-SC-004— Implement Versioned Protocol Configuration RegistryThis issue must not be assigned while any required dependency is unresolved or incompatible with the reviewed interface version.
Non-Goals
Stellar Wavelabel.Complexity and Review
DigiNodes/truthbounty-contractwave-candidateReferences
🏷 Labels