- Home
- Skills
- Multiversx
- Mx Ai Skills
- Mvx Sdk Py Contracts
mvx_sdk_py_contracts_skill
10
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill multiversx/mx-ai-skills --skill mvx_sdk_py_contracts- SKILL.md2.7 KB
Overview
This skill provides Python tools for working with MultiversX smart contracts: loading ABIs, preparing and sending deploys, upgrades, execute calls, and VM queries. It wraps low-level transaction construction with typed encoding when an ABI is available and offers fallbacks for manual typing. The skill focuses on reliable transaction lifecycle handling and parsed outcomes for easier integration.
How this skill works
Load a contract ABI to get a smart contract controller that builds typed transactions and decodes responses. Use controller methods to create deploy, execute, upgrade, or query requests, then send transactions and await parsed completion results. If no ABI is available, a transactions factory can build basic, manually typed calls but without automatic encoding/decoding.
When to use it
- Deploy a new smart contract from Python with bytecode and ABI.
- Execute state-changing functions with proper gas and optional native token transfer.
- Perform read-only VM queries to return typed state without consuming gas.
- Upgrade contract bytecode while preserving on-chain state and calling upgrade endpoints.
- Build manual transactions when ABI is unavailable or for custom low-level flows.
Best practices
- Always use the contract ABI to ensure correct argument encoding and typed decoding of results.
- Prefer VM queries for reads: they are free and return immediate typed outputs.
- Wait for transaction completion via controller helpers to get parsed outcomes and contract addresses.
- Provision sufficient gas for computation plus storage changes; set conservative gas limits for complex operations.
- Use nonces correctly (get and increment) to avoid transaction collisions.
Example use cases
- Deploy a new token or dApp: load ABI, read wasm bytes, create deploy transaction, send and await parsed deploy outcome.
- Call a payable contract function: create execute transaction with native_amount to transfer tokens and invoke logic in one step.
- Read contract state: run query for getSum or other getters to obtain typed values without gas costs.
- Upgrade contract implementation: prepare new bytecode, create upgrade transaction, send and verify parsed completion.
- Create manual execute transactions when working with minimal ABI info or custom typed arguments.
FAQ
No, but using an ABI is strongly recommended. ABI enables correct encoding/decoding and typed results; without it you must manually manage types.
Are VM queries free and safe to use?
Yes. VM queries are read-only calls that do not consume gas and return instant, typed results when using the controller.