{"id":18665256,"url":"https://github.com/avaprotocol/xcm-demo","last_synced_at":"2025-04-11T22:31:00.095Z","repository":{"id":65605500,"uuid":"538711661","full_name":"AvaProtocol/xcm-demo","owner":"AvaProtocol","description":"Javascript usage of OAK’s XCM automation with parachains including Moonbeam, Astar and Mangata.","archived":false,"fork":false,"pushed_at":"2025-02-15T09:12:44.000Z","size":1473,"stargazers_count":4,"open_issues_count":8,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-25T19:21:48.463Z","etag":null,"topics":["blockchain","polkadot","substrate","xcm"],"latest_commit_sha":null,"homepage":"https://docs.oak.tech/docs/xcm/integration-overview/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AvaProtocol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2022-09-19T21:58:33.000Z","updated_at":"2024-12-11T18:03:52.000Z","dependencies_parsed_at":"2024-02-16T19:27:44.065Z","dependency_job_id":"528ca01d-6eb6-4427-a7ce-2a47342e8cc2","html_url":"https://github.com/AvaProtocol/xcm-demo","commit_stats":null,"previous_names":["avaprotocol/xcm-demo"],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvaProtocol%2Fxcm-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvaProtocol%2Fxcm-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvaProtocol%2Fxcm-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvaProtocol%2Fxcm-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AvaProtocol","download_url":"https://codeload.github.com/AvaProtocol/xcm-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248489522,"owners_count":21112588,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["blockchain","polkadot","substrate","xcm"],"created_at":"2024-11-07T08:26:57.345Z","updated_at":"2025-04-11T22:30:59.165Z","avatar_url":"https://github.com/AvaProtocol.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAK Network XCM Automation Demos\n\n## Overview\n![Automation Integration Flow Chart](./assets/flow-technical.png)\n\n## Installation\n1. Install dependencies, `npm i`\n1. Run a local Rococo-Mangata-Turing network with instructions in [Run local network with Zombienet](https://github.com/OAK-Foundation/OAK-blockchain#quickstart-run-local-network-with-zombienet)\n1. Run a demo by `npm run \u003cfile_name\u003e`, defined in package.json.\n\n## Mangata Auto-compound Demo\n### Pre-requisites\n| Chain      | Version | \n| :---        |    :----:   | \n| Polkadot      | [v0.9.38](https://github.com/paritytech/polkadot/releases/tag/v0.9.38)       |\n| OAK-blockchain   | [v1.9.0](https://github.com/OAK-Foundation/OAK-blockchain/releases/tag/v1.9.0)     |\n| Mangata-node | [v0.30.1](https://github.com/mangata-finance/mangata-node/releases/tag/v0.30.1)   |\n### Steps \u0026 Logs\n\u003cdetails\u003e\n\u003csummary\u003eDev environment\u003c/summary\u003e\n\u003cbr\u003e\n\n1. Launch OAK-blockchain, Rococo and Mangata.\n\n\t- Compile oak-collator v1.9.0\n\n\t\thttps://github.com/OAK-Foundation/OAK-blockchain/\n\n\t\t```\n\t\tcargo build --release --features turing-node --features dev-queue\n\t\t```\n\n\n\t- Compile modified Mangata\n\n\t\thttps://github.com/mangata-finance/mangata-node/releases/tag/v0.30.1\n\n\t\t```\n\t\tcargo build --release --features mangata-rococo,fast-runtime\n\t\t```\n\n\n\t- Clear the relay chain directory of mangata-node before running zombienet command, because currently mangata-node couldn’t auto-purge.\n\n\t\t```\n\t\t./target/release/mangata-node purge-chain\n\t\t```\n\n\t- Launch zombie in OAK-blockchain project root with modified Mangata and OAK.\n\n\t\t```\n\t\tzombie spawn zombienets/turing/mangata.toml\n\t\t```\n\n2. Set up accounts and pools\n\t```\n\tnpm run setup-mangata\n\t```\n3. Run the program to schedule automation and wait for cross-chain execution\n   ```\n   npm run mangata-local\n   ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eMangata Rococo environment(Rococo)\u003c/summary\u003e\n\u003cbr\u003e\nFirst, you need to prepare a wallet for the program to run on production environment. Simply export a json file from Mangata Rococo‘s dashboard, name it `seed.json` and place it in the `./private` folder.\n\nThen, run the below command with the pass phrase to unlock the seed.json in order to schedule automation and wait for execution.\n```\nPASS_PHRASE=\u003cpass_phrase\u003e npm run mangata-rococo\n```\n\nBelow are the console logs from `npm run mangata-rococo`\n```\nInitializing APIs of both chains ...\nTuring chain name: turing-staging, native token: {\"symbol\":\"TUR\",\"decimals\":10}\nMangata chain name: mangata-rococo, native token: {\"id\":\"0\",\"chainId\":0,\"decimals\":18,\"name\":\"Mangata\",\"symbol\":\"MGR\",\"address\":\"\"}\n\n1. Reading token and balance of account ...\n[\n  {\n    tokens: [\n      {\n        symbol: 'TUR',\n        balance: 10187,\n        balanceBN: \u003cBN: 5ca85fcf64ae\u003e,\n        reserved: 20,\n        miscFrozen: 1000,\n        feeFrozen: 0\n      }\n    ],\n    chain: 'turing-staging',\n    address: '66RxduFvFDjfQjYJRnX4ywgYm6w2SAiHqtqGKgY1qdfYCj3g'\n  },\n  {\n    tokens: [\n      {\n        symbol: 'MGR',\n        id: '0',\n        decimals: 18,\n        balance: 9953621,\n        reserved: 5029,\n        frozen: 0\n      },\n      {\n        symbol: 'TUR',\n        id: '7',\n        decimals: 10,\n        balance: 3614268,\n        reserved: 0,\n        frozen: 0\n      }\n    ],\n    chain: 'mangata-rococo',\n    address: '5CM2JyPHnbs81Cu8GzbraqHiwjeNwX3c9Rr5nXkJfwK9fwrk'\n  }\n]\n\n2. Add a proxy on Mangata for paraId 2114, or skip this step if that exists ...\nFound proxy of 5CM2JyPHnbs81Cu8GzbraqHiwjeNwX3c9Rr5nXkJfwK9fwrk on Mangata, and will skip the addition ...  {\n  delegate: '5DNrXjfyMuukK3zrMs2T9i2E2VjYfCnA8rCxjk5DDeTeyhtM',\n  proxyType: 'AutoCompound',\n  delay: 0\n}\n\nAccount balance check is completed and proxy is set up. Press ENTRE to mint MGR-TUR. yes\nFound a pool of MGR-TUR {\n  firstTokenId: '0',\n  secondTokenId: '7',\n  firstTokenAmount: \u003cBN: 87059378c54472fe212d2b\u003e,\n  secondTokenAmount: \u003cBN: 4ef251c4f52ea1\u003e,\n  liquidityTokenId: '10',\n  firstTokenRatio: \u003cBN: 81d4100\u003e,\n  secondTokenRatio: \u003cBN: 17bc2ecb00abbf4e0731373b\u003e,\n  isPromoted: false,\n  firstTokenAmountFloat: \u003cBN: 9bab655\u003e,\n  secondTokenAmountFloat: \u003cBN: 21e844\u003e\n}\nChecking how much reward available in MGR-TUR pool, tokenId: 10 ...\nClaimable reward in MGR-TUR:  74\nBefore auto-compound, 1st Account reserved \"MGR-TUR\": 1825 ...\n\nDo you want to continue to schedule auto-compound. Press ENTRE to continue. yes\n\n4. Start to schedule an auto-compound call via XCM ...\nencodedMangataProxyCall:  0x0500000c720beb3f580f0143f9cb18ae694cddb767161060850025a57a4f72a71bf47501000d080a00000064000000\nmangataProxyCallFees:  {\n  weight: { refTime: '2,905,398,711', proofSize: '3,716' },\n  class: 'Normal',\n  partialFee: '27.0780 MGAT'\n}\n\na) Create the call for scheduleXcmpTask \nxcmpCall:  Submittable { initialU8aLength: undefined, registry: TypeRegistry {} }\n\nb) Query automationTime fee details \nautomationFeeDetails:  { executionFee: '1.8671 TUR', xcmpFee: '9.5750 TUR' }\nTaskId: 0x821644ec6636d29e22a29cef36473c566d0f53681198b58995dfcf48b09bfc9b\n\nc) Sign and send scheduleXcmpTask call ...\nStatus: Ready\nStatus: Broadcast\nSuccessful with hash 0x3dc83fcf8981e05fd5a9cb3e3e1974f3fc85ea6351edd8c6c2cdf556c141155b\nTask: {\n  ownerId: '66RxduFvFDjfQjYJRnX4ywgYm6w2SAiHqtqGKgY1qdfYCj3g',\n  providedId: 'xcmp_automation_test_rf4ja',\n  schedule: { Fixed: { executionTimes: [Array], executionsLeft: '2' } },\n  action: {\n    XCMP: {\n      paraId: '2,110',\n      currencyId: '0',\n      xcmAssetLocation: [Object],\n      encodedCall: '0x0500000c720beb3f580f0143f9cb18ae694cddb767161060850025a57a4f72a71bf47501000d080a00000064000000',\n      encodedCallWeight: [Object],\n      scheduleAs: null\n    }\n  }\n}\n\n5. Keep Listening XCM events on mangata-rococo until 2023-06-05 14:00:00(1685998800) to verify that the task(taskId: 0x821644ec6636d29e22a29cef36473c566d0f53681198b58995dfcf48b09bfc9b, providerId: xcmp_automation_test_rf4ja) will be successfully executed ...\n\tproxy:ProxyExecuted:: (phase={\"applyExtrinsic\":0})\n\t\t\tResult\u003cNull, SpRuntimeDispatchError\u003e: Ok\n\tproxy:ProxyExecuted:: (phase={\"applyExtrinsic\":0})\n\t\t\tResult\u003cNull, SpRuntimeDispatchError\u003e: Ok\nTask has been executed!\n\nWaiting 20 seconds before reading new chain states ...\n\nAfter auto-compound, reserved MGR-TUR is: 1825745863799688808931 planck ...\n1st Account has compounded 684882028361671 planck more MGR-TUR ...\n\n```\n\n**Results:**\n\nSchedule on Turing Staging: https://polkadot.js.org/apps/#/explorer/query/0x3dc83fcf8981e05fd5a9cb3e3e1974f3fc85ea6351edd8c6c2cdf556c141155b\n\nTrigger on Turing Staging: https://polkadot.js.org/apps/#/explorer/query/0x0d03ccf0df6859ff6d8bded0ab8389a08a35a5bf359bd7c7761f8735937a9ae2 -\u003e Execution on Mangata Rococo: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fcollator-01-ws-rococo.mangata.online#/explorer/query/0x7f382298847bd6eaaa8c1541904366cdaefae64fa82ab004e18a42c8813f7c37\n\nMessageHash: 0x6f20ebf887af395f20f4e12e0289ac9938c0119152c18e1ebeca6af945122d3f\n\u003c/details\u003e\n\n## Shibuya Auto-restake Demo\n### Pre-requisites\n| Chain      | Version | \n| :---        |    :----:   | \n| Kusama      | [v0.9.43](https://github.com/paritytech/polkadot/releases/tag/v0.9.43)      |\n| Turing Network   | [2.0.0](https://github.com/OAK-Foundation/OAK-blockchain/releases/tag/v2.0.0)   |\n| Shiden Network | [v5.10.0(shibuya/100)](https://github.com/AstarNetwork/Astar/releases/tag/v5.10.0) |\n\n### Steps \u0026 Logs\n\n\u003cdetails\u003e\n\u003csummary\u003eShibuya environment(Dev)\u003c/summary\u003e\n\u003cbr\u003e\n\n1. Launch OAK-blockchain, Rococo and Shibuya.\n\n\tRun the zombienet command in OAK-blockchain’s root directory to spin up Shibuya and Turing Dev.\n\n\t```\n\tzombienet spawn zombienets/turing/shibuya.toml\n\t```\n\n2. Run the program to schedule automation and wait for cross-chain execution\n   ```\n   npm run shibuya\n   ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eRocstar environment(Rococo)\u003c/summary\u003e\n\u003cbr\u003e\n\nRun the program to schedule automation and wait for cross-chain execution\n```\nPASS_PHRASE=\u003cPASS_PHRASE\u003e npm run rocstar\n```\n\nBelow are the console logs from `PASS_PHRASE=\u003cPASS_PHRASE\u003e npm run rocstar`.\n```\nTuring chain key: turing-staging\nParachain name: rocstar, native token: {\"symbol\":\"RSTR\",\"decimals\":18}\n\n[\n  {\n    tokens: [\n      {\n        symbol: 'TUR',\n        balance: 10166,\n        balanceBN: \u003cBN: 5c7624d7ef80\u003e,\n        reserved: 20,\n        miscFrozen: 1000,\n        feeFrozen: 0\n      }\n    ],\n    chain: 'turing-staging',\n    address: '66RxduFvFDjfQjYJRnX4ywgYm6w2SAiHqtqGKgY1qdfYCj3g'\n  },\n  {\n    tokens: [\n      {\n        symbol: 'RSTR',\n        balance: 398,\n        balanceBN: \u003cBN: 159c3dd9213b7be78a\u003e,\n        reserved: 1,\n        miscFrozen: 0,\n        feeFrozen: 0\n      }\n    ],\n    chain: 'rocstar',\n    address: 'WDckGMNZqWEE2vxmJ3ycVT12nMVujkMAdME2ExAYJK7FnQc'\n  }\n]\n\nUser 1st Account turing-staging address: 66RxduFvFDjfQjYJRnX4ywgYm6w2SAiHqtqGKgY1qdfYCj3g, rocstar address: WDckGMNZqWEE2vxmJ3ycVT12nMVujkMAdME2ExAYJK7FnQc\nRocstar ID on Turing:  9\n\n1. One-time proxy setup on rocstar ...\n\na) Add a proxy for 1st Account If there is none setup on rocstar (paraId:2114) \n\nProxy address XFSy2e499YrXt2grAUaBNBW7YSfdRUuA3i6yTH561TcZnvY for paraId: 2114 and proxyType: Any already exists; skipping creation ...\n\nb) Proxy’s balance on rocstar is 100 RSTR.\n\nb) Proxy’s balance on rocstar is 100 RSTR.\n\n2. One-time proxy setup on Turing\n\na) Add a proxy for Alice If there is none setup on Turing (paraId:2006)\n\nAdd a proxy of rocstar (paraId:2006) and proxyType: Any on Turing ...\n Proxy address: 6A1gAyhvknS97rKJmC8aC5jcKdkXBeE93A2xQdvuTxE3Y9W1\n\nstatus.type Ready\nstatus.type Broadcast\nstatus.type InBlock\nstatus.type Finalized\n\nTopping up the proxy account on turing-staging via reserve transfer ...\nstatus.type Ready\nstatus.type Broadcast\nstatus.type InBlock\nstatus.type Finalized\n\nb) Proxy’s balance on turing-staging is 0 RSTR.\n\n3. Execute an XCM from rocstar to schedule a task on turing-staging ...\n\na). Create a payload to store in Turing’s task ...\nEncoded call data: 0x1200000c720beb3f580f0143f9cb18ae694cddb767161060850025a57a4f72a71bf47501000a073048656c6c6f20776f726c6421\nEncoded call weight: {\"refTime\":173833787,\"proofSize\":3716}\n\nb) Prepare automationTime.scheduleXcmpTask extrinsic for XCM ...\nEncoded call data: 0x3c036878636d705f6175746f6d6174696f6e5f746573745f387030316b01d04c7e6400000000100e000000000000d60700000900000001010100591fd01200000c720beb3f580f0143f9cb18ae694cddb767161060850025a57a4f72a71bf47501000a073048656c6c6f20776f726c6421eef87129113a0c720beb3f580f0143f9cb18ae694cddb767161060850025a57a4f72a71bf475\nrequireWeightAtMost: 1332429446\n\nc) Execute the above an XCM from Rocstar Testnet to schedule a task on Turing Staging ...\nrequireWeightAtMost:  1332429446\ntotalInstructionWeight:  6000000000\ntargetParaId:  2114\nstatus.type Ready\nstatus.type Broadcast\nstatus.type InBlock\nstatus.type Finalized\n\nAt this point if the XCM succeeds, you should see the below events on both chains:\n\n  1. Shibuya\n\n  xcmpQueue.XcmpMessageSent and polkadotXcm.Sent - an XCM is successfully sent from Shibuya to Turing to schedule a task.\n\n  2. Turing Dev\n\n  a) proxy.ProxyExecuted and automationTime.TaskScheduled - the above XCM is received and executed on Turing.\n\n  b) xcmpHandler.XcmTransactedLocally, xcmpQueue.XcmpMessageSent, xcmpHandler.XcmSent and automationTime.XcmpTaskSucceeded - the task is triggered and its payload is sent to Shibuya via XCM.\n\n  3. Shibuya\n\n  proxy.ProxyExecuted and xcmpQueue.Success - the above payload is received and executed.\n\n\n4. Keep Listening events on rocstar until 2023-06-05 14:00:00(1685998800) to verify that the task(taskId: 0x6e2da72aa52b482fa3cfc0e9ff7d300b7743d37c7698d5eb20bed95e03c8a100, providerId: xcmp_automation_test_8p01k) will be successfully executed ...\n\tproxy:ProxyExecuted:: (phase={\"applyExtrinsic\":1})\n\t\t\tResult\u003cNull, SpRuntimeDispatchError\u003e: Ok\n\tproxy:ProxyExecuted:: (phase={\"applyExtrinsic\":1})\n\t\t\tResult\u003cNull, SpRuntimeDispatchError\u003e: Ok\n\nTask has been executed! Waiting for 20 seconds before reading proxy balance.\n\nAfter execution, Proxy’s balance is 99.9382 RSTR. The delta of proxy balance, or the XCM fee cost is 0.0617 RSTR.\n```\n\n**Results:**\n\nSchedule on Rocstar: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frocstar.astar.network#/explorer/query/0x8336735feb6e72c675409840836946934ee9731dad78c6b04cdde54810e125ca -\u003e Recipient on Turing Staging: https://polkadot.js.org/apps/#/explorer/query/0xb2e0d98aa1c3f38812c7195be44d5d7fa41be246d64cac63ce0d34e74bb764b2\n\nTrigger on Turing Staging: https://polkadot.js.org/apps/#/explorer/query/0x0d03ccf0df6859ff6d8bded0ab8389a08a35a5bf359bd7c7761f8735937a9ae2 -\u003e Execution on Rocstar: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Frocstar.astar.network#/explorer/query/0xdee7639ed6585dd71de78a25c5f809ba877732a3715d05cc39ad8d9043ed28e8\n\nMessageHash: 0xff304ed6aeab3e174ec667e9f69a18ebe23506836c4f53bd35aeb78503193453\n\u003c/details\u003e\n\n## Moonbeam EVM smart contract automation\n### Pre-requisites\n| Chain      | Version | \n| :---        |    :----:   | \n| Kusama      | [v1.11.0](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.11.0)      |\n| Turing Network   | [v2.1.4](https://github.com/OAK-Foundation/OAK-blockchain/releases/tag/v2.1.4)     |\n| Moonriver | [runtime-2500](https://github.com/moonbeam-foundation/moonbeam/releases/tag/runtime-2500)   |\n\n### Steps \u0026 Logs\n\n\u003cdetails\u003e\n\u003csummary\u003eMoonbase Local environment (dev)\u003c/summary\u003e\n\u003cbr\u003e\n\nThe local environment of Moonbeam is named Moonbase Local in its chain config.\n\n1. Launch OAK-blockchain, Rococo and Moonriver.\n\n\t- Compile oak-collator v2.1.4\n\n\t\thttps://github.com/OAK-Foundation/OAK-blockchain/releases/tag/v2.1.4\n\n\t\t```\n\t\tcargo build --release --features turing-node --features dev-queue\n\t\t```\n\n\n\t- Compile moonbase\n\n\t\thttps://github.com/moonbeam-foundation/moonbeam/releases/tag/runtime-2500\n\n\t\t```\n\t\tcargo build --release\n\t\t```\n\n1. Launch Rococo Local, Turing Dev and Moonbase Local with zombienet. The zombienet config file is located at [OAK-blockchain repo](https://github.com/OAK-Foundation/OAK-blockchain/blob/master/zombienets/turing/moonbase.toml). Assuming you are at OAK-blockchain’s root folder, run the below command to spin up the networks.\n\n\t```\n\tzombienet spawn zombienets/turing/moonbase.toml\n\t```\n\n1. Run this program to schedule automation and wait for cross-chain execution\n\t```\n\tnpm run moonbase-local\n\t```\n\n1. The above step outlines the process of XCM automation with Moonbase Local. Upon completing the program, an 'ethereum.executed' event from Moonbase Local will be emitted. However, the event will exit with an EvmCoreErrorExitReason, which occurs because a smart contract has not been deployed yet. To successfully demonstrate smart contract automation, please follow the subsequent steps to set up a test smart contract.\n\n    The default sudo wallet of Moonbase Local Alith is used to deploy a smart contract. Run the below commands to deploy a smart contract to Moonbase Local.\n\n    ```\n    pushd src/moonbeam/contracts\n    npm install\n    npx hardhat compile   # Compile smart contract\n    npx hardhat run scripts/deploy.js   # Deploy smart contract to Moonbase\n    ```\n\n    The commands, if successful, will print out the newly deployed smart contract. Take the Incrementer contract’s Ethereum address, and environmental variable CONTRACT_ADDRESS value when running src/moonbeam/moonbase-local.js. You do not need to change the value CONTRACT_INPUT;\n\n    Deployment output\n    ```\n    Deploying Incrementer...\n    Incrementer deployed to:  0x711F8F079b0BB4D16bd8C5D049358d31a1694755\n    ```\n    \n    Then, run\n    ```\n    popd  // Return the current directory to the root folder of this project\n    CONTRACT_ADDRESS=0x711F8F079b0BB4D16bd8C5D049358d31a1694755 npm run moonbase-local\n    ```\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eMoonbase Alpha environment(Moonbase)\u003c/summary\u003e\n\u003cbr\u003e\n\nThe default staging environment of Moonbeam is Moonbase Alpha, since Moonbeam doesn’t have a parachain set up on Rococo.\n\n1. First, we will need to set up wallets for the transactions in this demo.\n   1. Assuming you have a wallet created and imported to both Turing Moonbase and Moonbase Alpha’s polkadot.js dashboard.\n   2. Export a json file from Turing Moonbase‘s dashboard, name it `seed.json` and place it in the ./private folder.\n   3. Export a json file from Moonbase Alpha’s dashboard, name it `seed-eth.json` and place it in the ./private folder. Please note that the account exported should be an Ethereum account.  \n\n  \u003e How to add a polkadot account to Moonbase Alpha: https://docs.moonbeam.network/tokens/connect/polkadotjs/\n\n1. Make sure your wallet is topped up with 25 TUR on Turing Moonbase for fees required to set up a proxy wallet and task execution.\n\n2. Make sure your wallet is topped up with 5 DEV on Moonbase Alpha for fees required to set up a proxy wallet and execute task scheduling.\n\n3. Run the below command to kick off the demo. The \u003cPASS_PHRASE\u003e is your password to unlock the wallet on Turing Moonbase, and the \u003cPASS_PHRASE_ETH\u003e is your password to unlock the ethereum wallet on Moonbase Alpha.\n\t```\n\tPASS_PHRASE=\u003cPASS_PHRASE\u003e PASS_PHRASE_ETH=\u003cPASS_PHRASE_ETH\u003e npm run moonbase-alpha\n\t```\n\nBelow are the console logs from `PASS_PHRASE=\u003cPASS_PHRASE\u003e PASS_PHRASE_ETH=\u003cPASS_PHRASE_ETH\u003e npm run moonbase-alpha`.\n\n```\n1. Setup accounts on turing-moonbase and moonbase-alpha\nParachain address:  0xc60e71bd0f2e6d8832Fea1a2d56091C48493C788\nParachain balance: 1596684252552963865\n[\n  {\n    tokens: [],\n    chain: 'turing-moonbase',\n    address: '66RxduFvFDjfQjYJRnX4ywgYm6w2SAiHqtqGKgY1qdfYCj3g'\n  }\n]\nparaTokenIdOnTuring:  1\nproxyOnTuring:  6Ayu5KXqm1c8CpbWUmJ54CLmrPHSQbKDAqi8JQLS2KuZ2gkE\n\n2. One-time proxy setup on Turing\n\na) Add a proxy for Alice If there is none setup on Turing (paraId:1000)\n\nProxy address 6Ayu5KXqm1c8CpbWUmJ54CLmrPHSQbKDAqi8JQLS2KuZ2gkE for paraId: 1000 and proxyType: Any already exists; skipping creation ...\n\nb) Reserve transfer DEV to the proxy account on Turing: \nminBalanceOnTuring:  \u003cBN: de0b6b3a7640000\u003e\nparaTokenbalanceOnTuring.free:  1762675854400000000\n\nb) Proxy’s parachain token balance is 1762675854400000000 blanck, no need to top it up with reserve transfer ...\n\n3. One-time proxy setup on Moonbase\n\na) Add a proxy for Alice If there is none setup on Moonbase (paraId:1000)\n\nparachainAddress: 0xc60e71bd0f2e6d8832Fea1a2d56091C48493C788, proxyOnMoonbase: 0x3a13d93eb4e2e2b7ed6d21bce1006acba19b4dbc\nproxiesOnMoonbase:  [\n  {\n    delegate: '0x3A13d93eB4e2e2b7ed6d21bCE1006AcbA19B4DBC',\n    proxyType: 'Any',\n    delay: 0\n  }\n]\nAdd a proxy of moonbase-alpha (paraId:1000) and proxyType: Any on Turing ...\n Proxy address: 0x3a13d93eb4e2e2b7ed6d21bce1006acba19b4dbc\n\nstatus.type Ready\nstatus.type Broadcast\nstatus.type InBlock\nproxy.Duplicate: Account is already a proxy.\nstatus.type Finalized\nproxy.Duplicate: Account is already a proxy.\n\nb) Topping up the proxy account on Moonbase with DEV ...\n\n\nMoonbase proxy account balance is 1000000000000000000 blanck, no need to top it up with reserve transfer ...\n\nUser 1st Account turing-moonbase address: 66RxduFvFDjfQjYJRnX4ywgYm6w2SAiHqtqGKgY1qdfYCj3g, moonbase-alpha address: 0xc60e71bd0f2e6d8832Fea1a2d56091C48493C788\n\n4. Execute an XCM from moonbase-alpha to turing-moonbase ...\n\na). Create a payload to store in Turing’s task ...\nTask extrinsic encoded call data: 0x3c036878636d705f6175746f6d6174696f6e5f746573745f39726869640008d04c7e6400000000e05a7e6400000000e80300000100000001010200a10f0403c9012601c60e71bd0f2e6d8832fea1a2d56091c48493c78801581501000000000000000000000000000000000000000000000000000000000000a72f549a1a12b9b49f30a7f3aeb1f4e96389c5d8000000000000000000000000000000000000000000000000000000000000000010d09de08a000300286bee000c720beb3f580f0143f9cb18ae694cddb767161060850025a57a4f72a71bf475\nEncoded call data: 0x3c036878636d705f6175746f6d6174696f6e5f746573745f39726869640008d04c7e6400000000e05a7e6400000000e80300000100000001010200a10f0403c9012601c60e71bd0f2e6d8832fea1a2d56091c48493c78801581501000000000000000000000000000000000000000000000000000000000000a72f549a1a12b9b49f30a7f3aeb1f4e96389c5d8000000000000000000000000000000000000000000000000000000000000000010d09de08a000300286bee000c720beb3f580f0143f9cb18ae694cddb767161060850025a57a4f72a71bf475\nrequireWeightAtMost: 1486889856\n\nb) Execute the above an XCM from Moonbase Alpha to schedule a task on Turing Moonbase ...\ntransactRequiredWeightAtMost:  2486889856\noverallWeight:  8170208000\nfungible:  548688985600000000\ntransactExtrinsic Encoded call data: 0x15040421060101010009210000010080dbaeb9559d07000000000000000065033c036878636d705f6175746f6d6174696f6e5f746573745f39726869640008d04c7e6400000000e05a7e6400000000e80300000100000001010200a10f0403c9012601c60e71bd0f2e6d8832fea1a2d56091c48493c78801581501000000000000000000000000000000000000000000000000000000000000a72f549a1a12b9b49f30a7f3aeb1f4e96389c5d8000000000000000000000000000000000000000000000000000000000000000010d09de08a000300286bee000c720beb3f580f0143f9cb18ae694cddb767161060850025a57a4f72a71bf4750380ed3a94000107007bfbe60100\nstatus.type Ready\nstatus.type Broadcast\nstatus.type InBlock\nstatus.type Finalized\n```\n\n**Results:**\n\nSchedule on Moonbase Alpha: https://moonbase.subscan.io/extrinsic/4486793-5 -\u003e Recipient on Turing Moonbase: http://167.99.226.24:3000/?rpc=ws%3A%2F%2F167.99.226.24%3A8846#/explorer/query/0x59c7e74b9c75bf7fdca104ad899702656ddd225cf4d01f6291bdb666d0862d82\n\nTrigger on Turing Moonbase: http://167.99.226.24:3000/?rpc=ws%3A%2F%2F167.99.226.24%3A8846#/explorer/query/0x3397f884b15fbc43c6241658894ede603e98daf91a3175055f1af1aadb394b2c -\u003e Execution on Moonbase Alpha: https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fwss.api.moonbase.moonbeam.network#/explorer/query/0x9b2a8fd0ffb8be910d604e39d742fea0e78efec02d9028da1971a3a815e577af\n\nMessageHash: 0x9a818c1110de617e3e5cce7ecb23c8920041aab5d8e56ba541ea02c63f5b6864\n\u003c/details\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favaprotocol%2Fxcm-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favaprotocol%2Fxcm-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favaprotocol%2Fxcm-demo/lists"}