{"id":31619381,"url":"https://github.com/multiversx/mx-chain-simulator-examples-py","last_synced_at":"2026-07-27T21:31:53.850Z","repository":{"id":257365779,"uuid":"857992681","full_name":"multiversx/mx-chain-simulator-examples-py","owner":"multiversx","description":"Example scripts for chain simulator","archived":false,"fork":false,"pushed_at":"2024-09-16T19:03:03.000Z","size":26,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":9,"default_branch":"main","last_synced_at":"2025-10-06T14:11:26.376Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/multiversx.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-16T05:26:45.000Z","updated_at":"2024-09-16T19:02:38.000Z","dependencies_parsed_at":"2024-09-16T09:42:51.067Z","dependency_job_id":null,"html_url":"https://github.com/multiversx/mx-chain-simulator-examples-py","commit_stats":null,"previous_names":["multiversx/mx-chain-simulator-examples-py"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/multiversx/mx-chain-simulator-examples-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-chain-simulator-examples-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-chain-simulator-examples-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-chain-simulator-examples-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-chain-simulator-examples-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/multiversx","download_url":"https://codeload.github.com/multiversx/mx-chain-simulator-examples-py/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/multiversx%2Fmx-chain-simulator-examples-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35966479,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-07-20T02:08:10.276Z","status":"online","status_checked_at":"2026-07-27T02:00:06.776Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-10-06T14:05:48.488Z","updated_at":"2026-07-27T21:31:53.820Z","avatar_url":"https://github.com/multiversx.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mx-chain-simulator-examples-py\nExample scripts for chain simulator\n\n## 1. Move balance script `./01-move-balance/main.py`\n\nThis script does the following:\n* generates a new key: the sender key\n* calls the special `send-user-funds` REST API endpoint route so the provided sender address will be minted with native tokens. \nThis is a mandatory step in almost all tests and examples as we need native tokens to succeed in issuing transactions.\n* generates a new key: the receiver key\n* creates a transaction from sender -\u003e receiver having the amount of 1 eGLD (1*10^18 = 1000000000000000000)\n* tests \u0026 prints the amount remaining in sender's account \u0026 the balance of the receiver account.\n\n\n## 2. Issue and transfer a fungible token script `./02-fungible-esdt-interaction/main.py`\n\nThis script does the following:\n* generates a new key: the sender key\n* calls the special `send-user-funds` REST API endpoint route so the provided sender address will be minted with native tokens.\n  This is a mandatory step in almost all tests and examples as we need native tokens to succeed in issuing transactions.\n* creates a special issuing ESDT transaction to create a `TTKN-xxyyzz` token identifier. Note that the sequence `xxyyzztt` will \nbe automatically generated by the blockchain\n* generates a new key: the receiver key\n* creates a transaction from sender -\u003e receiver transferring the amount of 500 TTKN-xxyyzz\n* tests \u0026 prints the ESDT amount remaining in sender's account \u0026 the ESDT balance of the receiver account.\n\n\n## 3. Deploy and interact with a smartcontract `./03-smartcontract-interaction/main.py`\n\nThis script does the following:\n* generates a new key: the sender key\n* calls the special `send-user-funds` REST API endpoint route so the provided sender address will be minted with native tokens.\n  This is a mandatory step in almost all tests and examples as we need native tokens to succeed in issuing transactions.\n* opens and loads the file `./adder.wasm`\n* deploys the adder contract. The owner of the contract is the sender address.\n* performs a vm-query operation that will execute (in a sandbox environment) a specified contract endpoint. The endpoint is \n`getSum` and returns an integer value corresponding to a variable in the contract instance. After the contract deployment\nthe value returned will be `0` (up until we will change it through another endpoint call)\n* creates a new transaction that will call the endpoint `add` and provide a dummy value of `10`. The contract's endpoint is \nwritten in such a way that the internal contract's variable will be incremented with the provided value.\n* performs another vm-query operation that will execute the `getSum` endpoint, \nreturning the integer value of `10`.\n\nFor reference, this is how the adder contract can be written in Rust:\n```rust\n#![no_std]\n\nuse multiversx_sc::imports::*;\n\npub mod adder_proxy;\n\n/// One of the simplest smart contracts possible,\n/// it holds a single variable in storage, which anyone can increment.\n#[multiversx_sc::contract]\npub trait Adder {\n    #[view(getSum)]\n    #[storage_mapper(\"sum\")]\n    fn sum(\u0026self) -\u003e SingleValueMapper\u003cBigUint\u003e;\n\n    #[init]\n    fn init(\u0026self, initial_value: BigUint) {\n        self.sum().set(initial_value);\n    }\n\n    #[upgrade]\n    fn upgrade(\u0026self, initial_value: BigUint) {\n        self.init(initial_value);\n    }\n\n    /// Add desired amount to the storage variable.\n    #[endpoint]\n    fn add(\u0026self, value: BigUint) {\n        self.sum().update(|sum| *sum += value);\n    }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiversx%2Fmx-chain-simulator-examples-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmultiversx%2Fmx-chain-simulator-examples-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmultiversx%2Fmx-chain-simulator-examples-py/lists"}