feat: add interactive contract playground script (#517)#551
Merged
nanaf6203-bit merged 1 commit intoJun 24, 2026
Merged
Conversation
Adds scripts/playground.sh, an interactive CLI for exercising the most common contract calls without hand-writing cargo-contract commands: 1) Register Property (property-token :: register_property_with_token) 2) Create Escrow (escrow :: create_escrow_advanced) 3) Stake Tokens (staking :: stake) 4) Vote on Proposal (governance :: vote) 5) Create Insurance Policy (insurance :: create_policy) - Resolves contract addresses from deployments/<network>/<contract>.json (written by scripts/deploy.sh), falling back to manual entry if a contract hasn't been deployed yet. - Prints the full cargo-contract call output plus an isolated "Emitted events" section. - Supports --help / -h with full usage instructions. - Documented in docs/onboarding-checklist.md under Hands-On Exploration. Follows the existing scripts/deploy.sh conventions for logging, network selection (NETWORK env var) and signer selection (SURI env var). Closes MettaChain#517
|
@B3rnard601 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! 🚀 |
Contributor
Author
|
The failing checks (Rustfmt, Clippy, and the contracts/analytics/contracts/fractional build/test jobs) appear to be pre-existing issues on main unrelated to this PR — this change only touches scripts/playground.sh and docs/onboarding-checklist.md. The analytics Clippy failure, for example, is in contracts/analytics/src/lib.rs:272-274, a file this PR doesn't modify. |
4 tasks
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.
Adds scripts/playground.sh, an interactive CLI for exercising the most common contract calls without hand-writing cargo-contract commands:
Follows the existing scripts/deploy.sh conventions for logging, network selection (NETWORK env var) and signer selection (SURI env var).
Closes #517