{"id":13408476,"url":"https://github.com/xdevguild/sc-multi-sender-rs","last_synced_at":"2025-03-14T13:31:13.160Z","repository":{"id":80945655,"uuid":"526562937","full_name":"xdevguild/sc-multi-sender-rs","owner":"xdevguild","description":"A multi-sender smart contract that allows you to send EGLD, ESDTs and NFTs to multiple addresses in one transaction","archived":false,"fork":false,"pushed_at":"2022-08-19T15:14:30.000Z","size":10,"stargazers_count":5,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-31T20:30:52.526Z","etag":null,"topics":["elrond","rust","smart-contract"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/xdevguild.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-08-19T10:30:06.000Z","updated_at":"2022-11-24T16:04:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"e2e84a3d-48fa-4c6f-a57a-55e6ba28b188","html_url":"https://github.com/xdevguild/sc-multi-sender-rs","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdevguild%2Fsc-multi-sender-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdevguild%2Fsc-multi-sender-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdevguild%2Fsc-multi-sender-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xdevguild%2Fsc-multi-sender-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xdevguild","download_url":"https://codeload.github.com/xdevguild/sc-multi-sender-rs/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243584199,"owners_count":20314716,"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":["elrond","rust","smart-contract"],"created_at":"2024-07-30T20:00:53.103Z","updated_at":"2025-03-14T13:31:13.141Z","avatar_url":"https://github.com/xdevguild.png","language":"Shell","readme":"# Multi Sender smart contract\n\nThe multi sender smart contract is a smart contract that allows you to send EGLD, ESDTs and NFTs to multiple addresses in one transaction.\n\n### The smart contract \n\n## multiSendEgld\n```rust\n    #[payable(\"EGLD\")]\n    #[endpoint(multiSendEgld)]\n    fn multi_send_egld(\n        \u0026self,\n        args: MultiValueEncoded\u003cMultiValue2\u003cManagedAddress, BigUint\u003e\u003e\n    );\n ```\n\n The Multi Send Egld function only accepts EGLD as payment. It receives the following arguments: \n\n* One address you want to send to\n* The amount you want to send to the address\n\nYou can add as many addresses and amounts as you want in the arguments but it must remain in order : Address A, Amount A.\n\nExample of data for a transaction where there are 2 addresses:\n\n```\n multiSendEgld +\n@ + Address A in hexadecimal +\n@ + Amount to send to Address A in hexadecimal +\n@ + Address B in hexadecimal +\n@ + Amount to send to Address B in hexadecimal \n```\n\nNote that the amount you send to the endpoint must equal the total amount you want to send between all addresses.\n\n## multiSendEsdt\n```rust\n    #[payable(\"*\")]\n    #[endpoint(multiSendEsdt)]\n    fn multi_send_esdt(\n        \u0026self,\n        token_id: TokenIdentifier,\n        args: MultiValueEncoded\u003cMultiValue2\u003cManagedAddress, BigUint\u003e\u003e\n    );\n ```\n\nThe Multi Send Esdt function only accepts ESDT as payment. It receives the following arguments:\n\n* The token identifier of the ESDT you want to send\n* One address you want to send to \n* The amount you want to send to the address\n\nYou can add as many addresses and amounts as you want in the arguments but it must remain in order : Address A, Amount A.\n\nExample of data for a transaction where there are 2 addresses:\n\n```\n ESDTTransfer +\n@ + Token Identifier in hexadecimal +\n@ + Total amount in hexadecimal +\n@ + multiSendEsdt in hexadecimal +\n@ + Token Identifier in hexadecimal +\n@ + Address A in hexadecimal +\n@ + Amount to send to Address A in hexadecimal +\n@ + Address B in hexadecimal +\n@ + Amount to send to Address B in hexadecimal \n```\n\nThe token you send to the endpoint must be the same as the token identifier you pass in the arguments and the total amount send must egal to the total amount you want to send between all addresses you pass in the arguments.\n\n## multiSendNft\n```rust\n    #[payable(\"*\")]\n    #[endpoint(multiSendNft)]\n    fn multi_send_nft(\n        \u0026self,\n        collection_id: TokenIdentifier,\n        args: MultiValueEncoded\u003cMultiValue2\u003cManagedAddress, u64\u003e\u003e\n    );\n ```\n\n The Multi Send Nft function only accepts NFT. It receives the following arguments:\n\n* The NFT Collection Identifier you want to send \n* One address you want to send to \n* The nonce OF the NFT you want to send to the address\n\nYou can add as many addresses and nonce as you want in the arguments but it must remain in order : Address A, Nonce A.\n\nExample of data for a transaction where there are 2 addresses:\n\n```\n MultiESDTNFTTransfer +\n@ + Smart Contract address in hexadecimal +\n@ + Number of NFT you want to send in hexadecimal +\n@ + NFT Collection Identifier in hexadecimal +\n@ + Nonce of one NFT you want to send in hexadecimal +\n@ + 01 +\n@ + NFT Collection Identifier in hexadecimal +\n@ + Nonce of one NFT you want to send in hexadecimal +\n@ + 01 +\n@ + multiSendNft in hexadecimal +\n@ + NFT Collection Identifier in hexadecimal +\n@ + Address A in hexadecimal +\n@ + Nonce to send to Address A in hexadecimal +\n@ + Address B in hexadecimal +\n@ + Nonce to send to Address B in hexadecimal \n```\n\nThe NFT collection identifier you want to send must be the same as the collection identifier you pass in the arguments.\n\n## Deployment\n\n1. You have to build the contract `erdpy contract build`\n2. You have to deploy the contract\n\nThere is a set of snippets you can use in [interaction](https://github.com/SkyzoxRobin/sc-multi-sender-rs/blob/main/interaction/devnet.snippets.sh)\n\n## deploy\n```shell\ndeploy() {\n    erdpy --verbose contract deploy --bytecode=\"$CONTRACT\" --recall-nonce \\\n        --pem=$OWNER \\\n        --gas-limit=599000000 \\\n        --proxy=$PROXY --chain=$CHAIN \\\n        --outfile=\"deploy-devnet.interaction.json\" --send || return\n\n    TRANSACTION=$(erdpy data parse --file=\"deploy-devnet.interaction.json\" --expression=\"data['emittedTransactionHash']\")\n    ADDRESS=$(erdpy data parse --file=\"deploy-devnet.interaction.json\" --expression=\"data['contractAddress']\")\n\n    erdpy data store --key=address-devnet --value=${ADDRESS}\n    erdpy data store --key=deployTransaction-devnet --value=${TRANSACTION}\n\n    echo \"Smart contract address: ${ADDRESS}\"\n}\n```\n\n## multiSendEgld interaction\n```shell\nmultiSendEgld() {\n    erdpy --verbose contract call ${SC_ADDRESS} --recall-nonce \\\n        --pem=$OWNER \\\n        --gas-limit=5000000 \\\n        --proxy=$PROXY --chain=$CHAIN \\\n        --value=20000000 \\\n        --function=\"multiSendEgld\" \\\n        --arguments $ADDRESS_1 $AMOUNT_1 $ADDRESS_2 $AMOUNT_2  \\\n        --send || return\n}\n```\n\n## multiSendEsdt interaction\n```shell\nmultiSendEsdt() {\n    token_id=str:RIDE-6e4c49 # the token id you want to send \n    amount=20000000 # the total amount to send\n    method_name=str:multiSendEsdt\n\n        erdpy --verbose contract call ${SC_ADDRESS} --recall-nonce \\\n        --pem=$OWNER \\\n        --gas-limit=5000000 \\\n        --proxy=$PROXY --chain=$CHAIN \\\n        --function=\"ESDTTransfer\" \\\n        --arguments $token_id $amount $method_name $token_id $ADDRESS_1 $AMOUNT_1 $ADDRESS_2 $AMOUNT_2  \\\n        --send || return\n}\n```\n\n## multiSendNft interaction\n```shell\nmultiSendNft() {\n    user_address=$(erdpy wallet pem-address ${OWNER}) # Your address\n    number_of_token_to_send=02 # Number of NFTs you want to transfer\n    collection_id=str:XGUARDIAN-abfbee # The NFT collection ID you want to send\n    nonce_1=0x0a70 # The nonce of the first NFT you want to send\n    nonce_2=0x0a71 # The nonce of the second NFT you want to send\n    method_name=str:multiSendNft\n\n        erdpy --verbose contract call ${user_address} --recall-nonce \\\n        --pem=$OWNER \\\n        --gas-limit=5000000 \\\n        --proxy=$PROXY --chain=$CHAIN \\\n        --function=\"MultiESDTNFTTransfer\" \\\n        --arguments $SC_ADDRESS \\\n                    $number_of_token_to_send \\\n                    $collection_id \\\n                    $nonce_1 \\\n                    $NFT_AMOUNT \\\n                    $collection_id \\\n                    $nonce_2 \\\n                    $NFT_AMOUNT \\\n                    $method_name \\\n                    $collection_id \\\n                    $ADDRESS_1 \\\n                    $nonce_1 \\\n                    $ADDRESS_2 \\\n                    $nonce_2 \\\n        --send || return\n}\n```\n","funding_links":[],"categories":["MultiversX community"],"sub_categories":["Smart contracts"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdevguild%2Fsc-multi-sender-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxdevguild%2Fsc-multi-sender-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxdevguild%2Fsc-multi-sender-rs/lists"}