Skip to content

feat: mc_getStorage RPC, deploy prints contract address, DEX docs - #170

Open
SIDDHANTCOOKIE wants to merge 1 commit into
feature/dex-batch-auctionfrom
feature/dex-rpc-docs
Open

SIDDHANTCOOKIE wants to merge 1 commit into
feature/dex-batch-auctionfrom
feature/dex-rpc-docs

Conversation

@SIDDHANTCOOKIE

Copy link
Copy Markdown
Member

Summary

Phase 3, PR 2 (stacked on #169). This makes the batch-auction DEX usable from the CLI and RPC, and documents it.

Changes

  1. mc_getStorage(address) RPC (minichain/rpc.py): returns a contract's storage, such as the DEX's open orders and its last clearing price and volume. An unknown address returns {} without creating an account. It's a generic method, so it works for any contract, not only the DEX.

  2. deploy prints the contract address (main.py). Until now the CLI never showed it, and balance cuts addresses down to 12 characters, so there was no way to find the address to call. It's computed the same way the chain derives it (sender + nonce).

  3. README: a "Batch-Auction DEX" section covering:

    • how the batch auction works and why everyone gets the same price
    • the full CLI flow: deploy, init, sell, buy, cancel, clear
    • the escrow rules and the 100-order cap
    • reading the book with mc_getStorage

    mc_getStorage is added to the RPC list.

No new CLI commands: the existing call already sends multi-asset value as JSON.

Test Plan

  • tests/test_rpc.py::test_rpc_getStorage checks three things:
    • it returns a contract's storage
    • an unknown address gives {} and isn't created
    • a missing address param gives an error
  • I replayed the README's CLI commands end to end with the CLI's own parsing (shlex + parse_tx_params), mining a real block after each step:
    • deploy used 62,920 gas, within the README's 100,000 limit
    • the printed address matched the receipt's contract address
    • init, sell 10 @ 5, buy 8 @ 7 and clear all succeeded
    • it cleared 8 GOLD at a price of 5, and both traders' balances matched the README
  • Full suite: 435 passed.

mc_getStorage returns a contract's storage (e.g. the batch-auction order
book) without creating the account. The CLI deploy command now prints the
derived contract address, which was otherwise not shown anywhere. README
documents the batch-auction DEX flow.
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review: 2
  • main
  • develop

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Repository: StabilityNexus/MiniChain/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 4e6f93a3-e39f-4300-b120-88c53dab851c

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@SIDDHANTCOOKIE
SIDDHANTCOOKIE added this pull request to stack #158 October 21, 2026 06:58
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.

1 participant