Skip to content

feat: add interactive contract playground script (#517)#551

Merged
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
B3rnard601:feat/issue-517-contract-playground
Jun 24, 2026
Merged

feat: add interactive contract playground script (#517)#551
nanaf6203-bit merged 1 commit into
MettaChain:mainfrom
B3rnard601:feat/issue-517-contract-playground

Conversation

@B3rnard601

Copy link
Copy Markdown
Contributor

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//.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 #517

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
@drips-wave

drips-wave Bot commented Jun 23, 2026

Copy link
Copy Markdown

@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! 🚀

Learn more about application limits

@B3rnard601 B3rnard601 marked this pull request as draft June 23, 2026 21:51
@B3rnard601 B3rnard601 marked this pull request as ready for review June 23, 2026 22:11
@B3rnard601

Copy link
Copy Markdown
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.

@nanaf6203-bit nanaf6203-bit merged commit ea634be into MettaChain:main Jun 24, 2026
2 of 14 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.

dx: Create contract interaction playground script for local development

2 participants