feat(soroban): add example compliant token and deploy scripts#61
Open
alex-predicate wants to merge 2 commits intomainfrom
Open
feat(soroban): add example compliant token and deploy scripts#61alex-predicate wants to merge 2 commits intomainfrom
alex-predicate wants to merge 2 commits intomainfrom
Conversation
- example-compliant-token: minimal token contract that requires Predicate attestation for transfers, demonstrating predicate-client integration (2 tests: compliant transfer + invalid attestation rejection) - deploy-registry.sh: deploy PredicateRegistry with optional attester registration - deploy-compliant-token.sh: deploy compliant token wired to a registry Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
Code review is billed via overage credits. To resume reviews, an organization admin can raise the monthly limit at claude.ai/admin-settings/claude-code.
Once credits are available, reopen this pull request to trigger a review.
- Move types (Statement, Attestation, RegistryError) into predicate-client directly instead of re-exporting from predicate-registry. This prevents the registry's #[contract] and #[contractimpl] from leaking into downstream cdylib crates (which caused duplicate __constructor exports). - predicate-registry is now a dev-dependency only for both predicate-client and example-compliant-token - Extract policy registration from constructor into separate register_policy() function (cross-contract calls not supported during construction) - Deploy scripts updated to call register_policy after deployment Tested on Stellar testnet: Registry: CAZYOJMAAQEH3R4DVIHJLWTLLDAT45FEX2QXZQXKNF3YO4QTUKJEKYZC Token: CAWHQ5EUC5MTWBHOUMMIVFDHZ37BXOD6GRG5OARGXG26UFASIQLE3HXV Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
balesandrew
approved these changes
Apr 3, 2026
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.
Summary
example-compliant-token— a minimal Soroban token contract demonstratingpredicate-clientintegration. Transfers require a valid Predicate attestation, showing the end-to-end application compliance flow.Details
example-compliant-tokencontractmint()— admin-only, no attestation neededtransfer()— requires a validAttestationargument; callspredicate_client::authorize_transaction()before moving tokensDeploy scripts
scripts/deploy-registry.sh— builds + deployspredicate-registry, optionally registers an attesterscripts/deploy-compliant-token.sh— builds + deploysexample-compliant-tokenwired to a registry + policyTest plan
test_compliant_transfer— end-to-end: deploy registry, register attester, deploy token, mint, transfer with valid attestationtest_transfer_without_valid_attestation— transfer with garbage attestation is rejected🤖 Generated with Claude Code