chore: add registry smart contract#19
Merged
matteojug-stacks merged 8 commits intomainfrom Apr 16, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
Adds an initial Clarity “registry” smart contract (plus local Clarinet/Vitest scaffolding) to register and query sBTC deposit/reclaim scripts, with CI updated to run the new contract unit tests.
Changes:
- Introduce
registry.clarwith register/query/remove functionality backed by an incrementing ID and a map. - Add Vitest + Clarinet-SDK test harness and unit tests covering the basic flow and authorization.
- Update CI workflow action pins and run the new contracts test suite on push/PR.
Reviewed changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| contracts/contracts/registry.clar | New registry contract implementing address registration, batch reads, and owner/admin removal. |
| contracts/tests/registry.test.ts | New Vitest/Clarinet unit tests for register/get/remove flows and auth checks. |
| contracts/vitest.config.ts | Vitest configuration for clarinet simnet environment + setup hooks. |
| contracts/tsconfig.json | TypeScript config for the contracts test workspace. |
| contracts/package.json | Node test workspace definition and scripts for running contract tests. |
| contracts/pnpm-lock.yaml | Lockfile for the new contracts test workspace dependencies. |
| contracts/Clarinet.toml | Clarinet project manifest defining the registry contract (Clarity v4, epoch 3.3). |
| contracts/deployments/default.simnet-plan.yaml | Simnet deployment plan to publish the registry contract. |
| contracts/settings/Devnet.toml | Devnet configuration and pre-funded accounts for local runs. |
| contracts/README.md | Minimal setup/run instructions for contract tests. |
| contracts/.gitignore | Ignores caches, logs, coverage/cost reports, and node_modules in contracts workspace. |
| contracts/.gitattributes | Linguist attributes for contracts workspace files. |
| .github/workflows/on-push.yaml | Bump pinned action SHAs; add Node/pnpm setup and run contracts tests in CI. |
Files not reviewed (1)
- contracts/pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
djordon-stacks
left a comment
There was a problem hiding this comment.
Still thinking about some of this, but it looks good overall.
djordon-stacks
left a comment
There was a problem hiding this comment.
Looks good. I think we should make the get-single-address function read-only, because why not? I also have a few nits/suggestions about the naming.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the initial registry smart contract.
Most of the scaffolding is from clarinet, the interesting bits are the contract and the test file.
In the current design, we don't use events (to avoid requiring an event observer) but instead we active poll the contract for new addresses. It also doesn't perform any validation on the deposit and reclaim script, nor any dedup on the deposit inputs; the owner of an entry is the one that registered it, and they (or the deployer) can remove an entry. Happy to revisit any decision.
Also bump the action pin to latest.
Testing information
Add contract unit tests, the whole flow was also tested locally with spox registry aware + front end (coming soon™)