Skip to content

sc-meta tx CLI, part 1#2362

Draft
andrei-marinica wants to merge 26 commits intorc/v0.66from
mxpy1
Draft

sc-meta tx CLI, part 1#2362
andrei-marinica wants to merge 26 commits intorc/v0.66from
mxpy1

Conversation

@andrei-marinica
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 5, 2026

Contract comparison - from 518b752 to 28bb44d

Path                                                                                             size                  has-allocator                     has-format
esdt-transfer-with-fee.wasm 7502 false without message
factorial.wasm 579 false None
crypto-bubbles.wasm 2541 false None
order-book-factory.wasm 3401 false None
order-book-pair.wasm 14229 false None
adder.wasm 699 false None
fractional-nfts.wasm 8306 false without message
lottery.wasm 12843 false without message
multisig-full.wasm 15130 false without message
multisig-view.wasm 5590 false None
multisig.wasm 13442 false without message
crypto-zombies.wasm 9255 false without message
digital-cash.wasm 9845 false None
nft-minter.wasm 9725 false without message
nft-storage-prepay.wasm 2606 false None
kitty-ownership.wasm 12965 false without message
kitty-auction.wasm 9411 false without message
kitty-genetic-alg.wasm 3494 false without message
proxy-pause.wasm 4148 false None
nft-subscription.wasm 8840 false without message
ping-pong-egld.wasm 6397 false None
crowdfunding.wasm 3557 false None
empty.wasm 244 false None
bonding-curve-contract.wasm 14132 false None
token-release.wasm 6977 false without message
rewards-distribution.wasm 9605 false without message
seed-nft-minter.wasm 14443 false without message
check-pause.wasm 1260 false None
multiversx-price-aggregator-sc.wasm 17910 false without message
multiversx-wegld-swap-sc.wasm 4492 false None
std-contract.wasm 3469 true without message
vault.wasm 9035 false None
vault-upgrade.wasm 708 false None
recursive-caller.wasm 5163 false without message
forwarder-blind.wasm 14242 false without message
transfer-role-features.wasm 8667 false without message
proxy-test-second.wasm 2329 false without message
second-contract.wasm 1158 false None
first-contract.wasm 3433 false None
parent.wasm 1979 false None
child.wasm 3982 false without message
forwarder-legacy.wasm 33668 false without message
local-esdt-and-nft.wasm 12568 false without message
proxy-test-first.wasm 5719 false without message
mesh-node.wasm 16145 false without message
forwarder-raw.wasm 13193 false None
forwarder-raw-init-async-call.wasm 2357 false None
forwarder-raw-init-sync-call.wasm 2938 false None
forwarder.wasm 49178 false without message
builtin-func-features.wasm 3820 false None
panic-message-std.wasm 16074 false with message
panic-message-features.wasm 13036 false with message
abi-tester.wasm 8607 true without message
abi-tester-ev.wasm 760 false None
scenario-tester.wasm 1374 false None
forbidden-opcodes.wasm 842 false None
rust-testing-framework-tester.wasm 8608 false None
rust-snippets-generator-test.wasm 4710 false None
alloc-features.wasm 23267 false without message
alloc-mem-fail.wasm 17819 true without message
alloc-mem-leaking.wasm 23424 false without message
esdt-system-sc-mock.wasm 4623 false None
use-module.wasm 32741 false without message
use-module-view.wasm 736 false None
payable-features.wasm 5872 false None
exchange-features.wasm 1514 false None
big-float-features.wasm 6373 false without message
basic-features.wasm 87721 false without message
basic-features-small-int-bug.wasm 824 false None
basic-features-storage-bytes.wasm 541 false None
erc1155.wasm 12023 false without message
erc1155-marketplace.wasm 10602 false without message
erc20.wasm 1870 false None
erc721.wasm 2232 false None
erc1155-user-mock.wasm 1229 false None
crowdfunding-erc20.wasm 4910 false without message
lottery-erc20.wasm 12893 false without message
formatted-message-features.wasm 3600 false without message
multi-contract-features.wasm 681 false None
multi-contract-features-view.wasm 1113 false None
multi-contract-alt-impl.wasm 353 false None
multi-contract-example-feature.wasm 680 false None
send-tx-repeat.wasm 1292 false None
vec-repeat.wasm 4876 false None
linked-list-repeat.wasm 6842 false without message
set-repeat.wasm 6515 false None
map-repeat.wasm 7367 false without message
queue-repeat.wasm 5540 false None
single-value-repeat.wasm 4257 false None
str-repeat-mb-builder-basic.wasm 757 false None
str-repeat.wasm 2733 false without message
str-repeat-mb-builder-cached.wasm 1109 false without message
large-storage.wasm 1656 false None

⚠️ Could not download the report for the base branch. Displaying only the report for the current branch. ⚠️

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds the first slice of a new sc-meta tx CLI (plus a data helper CLI) and refactors deterministic address computation into a shared chain-core utility, with new chain-simulator-backed tests and CI coverage.

Changes:

  • Introduce sc-meta tx and sc-meta data subcommands (clap args + command dispatch + tx JSON output helpers).
  • Extend snippets interactor traits to expose into_sdk_transaction() and centralize deterministic contract address computation (compute_new_address*).
  • Add chain-simulator integration tests + a dedicated GitHub Actions workflow for the new tx CLI flow.

Reviewed changes

Copilot reviewed 40 out of 42 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
sdk/core/src/wallet.rs Generalize Wallet::from_pem_file to accept AsRef<Path>.
framework/snippets/src/network_response.rs Use centralized compute_new_address for deployed SC address derivation.
framework/snippets/src/interactor/interactor_tx/interactor_run_trait.rs New traits for async run/simulate + SDK tx extraction.
framework/snippets/src/interactor/interactor_tx/interactor_query_call.rs Implements new trait method for queries (currently panics for tx extraction).
framework/snippets/src/interactor/interactor_tx/interactor_prepare_async.rs Removed/migrated into interactor_run_trait.
framework/snippets/src/interactor/interactor_tx/interactor_exec_upgrade.rs Add into_sdk_transaction() for upgrade steps.
framework/snippets/src/interactor/interactor_tx/interactor_exec_transf.rs Add into_sdk_transaction() for EGLD transfers.
framework/snippets/src/interactor/interactor_tx/interactor_exec_deploy.rs Add into_sdk_transaction() for deploy steps; update imports.
framework/snippets/src/interactor/interactor_tx/interactor_exec_call.rs Add into_sdk_transaction() for call steps; update imports.
framework/snippets/src/interactor/interactor_tx.rs Wire new module + re-export updated traits.
framework/snippets/src/interactor/interactor_dns.rs Switch to centralized compute_new_address for DNS address derivation.
framework/meta/tests/cs_tx_cli_test/cs_tx_test_owner.pem Add test PEM wallet fixture for chain-simulator CLI tests.
framework/meta/tests/cs_tx_cli_test.rs Add end-to-end chain-simulator tests for sc-meta tx deploy/call/query and tx new transfer.
framework/meta/src/cmd/tx/tx_send.rs New tx send command (broadcast tx from file, optionally wait for result).
framework/meta/src/cmd/tx/tx_query.rs New tx query command (gateway VM query, mxpy-like output).
framework/meta/src/cmd/tx/tx_new.rs New tx new command (create/sign optional send of a generic tx).
framework/meta/src/cmd/tx/tx_deploy.rs New tx deploy command (build tx via interactor + deterministic contract address).
framework/meta/src/cmd/tx/tx_common.rs Shared helpers for wallet loading, arg encoding, signing + dispatch/output.
framework/meta/src/cmd/tx/tx_cli_args.rs Clap definitions for tx subcommands and shared argument groups.
framework/meta/src/cmd/tx/tx_call.rs New tx call command (build SC call tx via interactor).
framework/meta/src/cmd/tx/output.rs Define mxpy-compatible JSON output struct for signed/broadcast tx flows.
framework/meta/src/cmd/tx.rs New tx CLI dispatcher (some subcommands still TODO).
framework/meta/src/cmd/data.rs New data CLI for store/load/parse of a mxpy-like data storage JSON.
framework/meta/src/cmd.rs Export new tx and data command modules.
framework/meta/src/cli/cli_standalone_main.rs Dispatch tx and data in standalone CLI main.
framework/meta/src/cli/cli_args_standalone.rs Add top-level tx and data CLI variants + args structs for data.
framework/meta/Cargo.toml Add chain-simulator-tests feature gate for new tests.
framework/meta/.gitignore Ignore chain-simulator test output artifacts.
contracts/examples/order-book/.gitignore Broaden ignore pattern to *.data-storage.json.
contracts/examples/adder/snippets/adder.snippets.sh Add/replace adder example script using sc-meta tx + sc-meta data.
contracts/examples/adder/mxpy/testnet.snippets.sh Remove old mxpy script variant.
contracts/examples/adder/mxpy/devnet.snippets.sh Remove old mxpy script variant.
chain/vm/src/host/context/tx_cache.rs Move mock address generation to chain_core::std::new_address.
chain/core/src/types/address.rs Remove VM-type constants + mock SC address generation from Address.
chain/core/src/std/new_address.rs New centralized utilities for deterministic SC address computation + mock address generation.
chain/core/src/std.rs Export new_address module.
.gitignore Broaden ignore pattern to *.data-storage.json.
.github/workflows/template-test-released.yml Rename workflow display name to “sc-meta CI”.
.github/workflows/template-test-current.yml Rename workflow display name to “sc-meta CI”.
.github/workflows/sc-meta-tx-cli-test.yml New workflow running chain-simulator-based tx CLI tests.
.github/prompts/plan-scMetaContract.prompt.md Add planning prompt doc for sc-meta tx CLI implementation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +57 to +60

/// Wallet index used when deriving from a PEM with multiple entries (default: 0).
#[arg(long, default_value = "0")]
pub sender_wallet_index: u32,
Comment thread framework/meta/src/cmd/tx/tx_call.rs
Comment on lines +33 to +43
// Build call transaction.
let arg_buffer = build_arg_buffer(&args.arguments)?;
let tx_builder = interactor
.tx()
.from(&sender_bech32)
.to(&contract)
.gas(args.tx.gas_limit)
.egld(args.tx.value)
.raw_call(args.function.as_str())
.arguments_raw(arg_buffer);

Comment thread framework/meta/src/cmd/tx/tx_query.rs Outdated
Comment thread framework/meta/src/cmd/tx/tx_new.rs Outdated
Comment on lines +29 to +34
let result_json = if args.wait_result {
let on_network = fetch_tx_on_network(&args.proxy, &tx_hash).await?;
serde_json::to_string_pretty(&on_network).context("failed to serialize result")?
} else {
serde_json::json!({ "txHash": tx_hash }).to_string()
};
Comment on lines +17 to +25
pub async fn tx_cli(args: &TxCliArgs) {
match &args.command {
TxCliAction::Deploy(deploy_args) => tx_deploy(deploy_args).await,
TxCliAction::Call(call_args) => tx_call(call_args).await,
TxCliAction::Upgrade(_upgrade_args) => todo!("tx upgrade not yet implemented"),
TxCliAction::Query(query_args) => tx_query(query_args).await,
TxCliAction::New(new_args) => tx_new(new_args).await,
TxCliAction::Send(send_args) => tx_send(send_args).await,
TxCliAction::Sign(_sign_args) => todo!("tx sign not yet implemented"),
Comment on lines +15 to +20
/// Global storage lives in ~/multiversx-sdk, same as mxpy.
fn global_storage_path() -> PathBuf {
let home = std::env::var_os("HOME")
.map(PathBuf::from)
.unwrap_or_else(|| PathBuf::from("."));
home.join("multiversx-sdk").join(STORAGE_FILE)
Comment on lines 47 to +53
fn run(self) -> impl std::future::Future<Output = Self::Result> {
run_async_query(self)
}

fn into_sdk_transaction(self) -> Transaction {
unimplemented!("SC queries don't produce blockchain transactions")
}
Comment thread chain/core/src/types/address.rs
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.

2 participants