Skip to content

feat: contract registry api idshashes versions#524

Merged
Cedarich merged 3 commits into
Pulsefy:mainfrom
titilayo967:feature/contract-registry-api-ids-hashes-versions
Jun 4, 2026
Merged

feat: contract registry api idshashes versions#524
Cedarich merged 3 commits into
Pulsefy:mainfrom
titilayo967:feature/contract-registry-api-ids-hashes-versions

Conversation

@titilayo967

Copy link
Copy Markdown
Contributor

Pull Request

Description

This PR implements the Contract Deployment Registry API, providing a centralized service to store and serve deployed contract metadata per network, including contract IDs, WASM hashes, initialization parameters, and schema versions. This eliminates hardcoded contract IDs in the frontend and mobile app, enabling dynamic contract discovery and full auditability of registry changes.

Related Issues

Changes Made

  • Storage Schema: Created database schema for contract deployments keyed by network + contract name, including fields for contract ID, WASM hash, init params, schema version, and network passphrase

  • Admin Endpoints: Added admin-only endpoints to upsert deployment metadata with proper authentication and authorization checks

  • Public Read Endpoints: Exposed public endpoints for frontend and mobile to fetch current contract IDs by network and contract name

  • Audit Logging: Implemented audit logging for all changes to the deployment registry, recording who made the change, when, and what changed

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update
  • Performance improvement
  • Code refactoring
  • Other (please describe):

How to Test

  1. Admin Upsert: Authenticate as an admin and POST to /api/v1/registry/deployments with network, contract name, contract ID, WASM hash, and schema version

  2. Public Read: Without authentication, GET /api/v1/registry/deployments?network=testnet&contractName=AidEscrow and verify the correct contract ID is returned

  3. Audit Trail: Make changes to a deployment entry and query the audit log endpoint to confirm the change is recorded with user identity and timestamp

Screenshots (if applicable)

N/A - API changes only

Checklist

  • My code follows the project's coding style and conventions
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings or errors
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published

Additional Notes

  • Each deployment entry includes the network passphrase for unambiguous environment identification
  • Schema version compatibility field enables graceful handling of contract upgrades
  • Frontend/mobile can now load contract IDs dynamically without redeployment

Reviewer Guidelines

  • Code quality and style
  • Functionality and logic
  • Performance implications
  • Security considerations (admin-only write access)
  • Documentation completeness

Closes #413

@titilayo967 titilayo967 marked this pull request as draft June 1, 2026 10:37
- Add public endpoints to fetch active deployment metadata by network and contract name
- Add admin-only upsert endpoint for contract deployment entries keyed by network + contract name
- Extend registry payloads with contract ID, WASM hash, schema version, schema compatibility, network passphrase, init params, and deployment metadata
- Persist new schema compatibility and init params fields with migration updates
- Enhance audit logging to capture who/when/what changed with before/after snapshots for registry upserts
- Keep existing publish/rollback flows backward compatible while exposing new deployment-read APIs
- Add unit coverage for upsert and deployment read paths
- Fix related type-check issues in ingestion/support-bundle tests and normalize DTO imports via barrel export
@drips-wave

drips-wave Bot commented Jun 3, 2026

Copy link
Copy Markdown

@titilayo967 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@titilayo967 titilayo967 marked this pull request as ready for review June 3, 2026 18:32
@titilayo967

Copy link
Copy Markdown
Contributor Author

@Cedarich please, review.

@Cedarich Cedarich merged commit ff1d5f1 into Pulsefy:main Jun 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

BE-27: Contract Deployment Registry API (Contract IDs + WASM Hashes + Versions)

2 participants