{"id":13408634,"url":"https://github.com/Combased/elrond-lkmex-distribution","last_synced_at":"2025-03-14T13:31:49.237Z","repository":{"id":42032905,"uuid":"455987078","full_name":"Combased/elrond-lkmex-distribution","owner":"Combased","description":"LKMEX (or other ESDT token) distribution to the NFTs collection owners in the Elrond blockchain","archived":false,"fork":false,"pushed_at":"2022-08-21T09:02:34.000Z","size":310,"stargazers_count":11,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-07-31T20:31:34.654Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/Combased.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}},"created_at":"2022-02-05T21:13:58.000Z","updated_at":"2022-05-24T19:43:04.000Z","dependencies_parsed_at":"2022-08-12T03:00:17.049Z","dependency_job_id":null,"html_url":"https://github.com/Combased/elrond-lkmex-distribution","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Combased%2Felrond-lkmex-distribution","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Combased%2Felrond-lkmex-distribution/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Combased%2Felrond-lkmex-distribution/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Combased%2Felrond-lkmex-distribution/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Combased","download_url":"https://codeload.github.com/Combased/elrond-lkmex-distribution/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243584378,"owners_count":20314748,"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":[],"created_at":"2024-07-30T20:00:54.242Z","updated_at":"2025-03-14T13:31:48.141Z","avatar_url":"https://github.com/Combased.png","language":"Python","funding_links":[],"categories":["MultiversX community"],"sub_categories":["SDKs and dev tools"],"readme":"### elrond-lkmex-distribution\n\n**The script for distributing LKMEX (or any other [ESDT](https://docs.elrond.com/developers/esdt-tokens/) token!) to all Your NFTs collection holders 😎!**\n\n[//]: # (Inspired by the [Elrond script utils]\u0026#40;https://github.com/ElrondNetwork/script-utils\u0026#41; \u0026#40;we'll unify our scripts in near future\u0026#41;.)\n\n**Now, we also support NFTs holders' reports, which is huge! Read [here](#nfts-holder-report)** 😇.\n\n## Table of contents\n* [LKMEX Script](#lkmex-script)\n  * [How it works](#how-it-works)\n  * [Getting started](#getting-started)\n  * [Generation based on duration of holding](#generation-based-on-duration-of-holding)\n  * [Generation based on NFTs attributes](#generation-based-on-nfts-attributes)\n* [NFTs holder report](#nfts-holder-report)\n  * [How it works](#how-it-works)\n  * [Getting started](#getting-started)\n  \n  \n## LKMEX Script\n#### How it works\nThe script gets the addresses from all collection holders; it excludes **marketplaces** and the owner address/SC address.\n\nThen it distributes your **total** provided LKMEX (ESDT token) for all NFTs holders. The more NFTs the wallet address has - the more LKMEX it gets 🤑.\n\n#### Getting started\n\nYou need to interact only with the **distribute.sh** file.\n\nTo make this distribution work for your NFTs collection you can configure it like this:\n\n##### 1. Configuring Python\nYou need to have Python installed on your machine or in the virtual environment 🤓.\n\nCheck your Python version by running:\n\n```shell\n$ python3 --version\n```\n\nThen you should modify the **distribute.sh** script to match your Python version: \n\n**PYTHON_BINARY=python3.8**\n\nAfter that run\n\n```shell\n$ pip install -r requirements.txt\n```\n\n##### 2. Provide the wallet.pem file\nYou need to generate a wallet.pem file from your secret seed phrase. You can read [here](https://docs.elrond.com/sdk-and-tools/erdpy/deriving-the-wallet-pem-file/) (**check the warning**).\n\n##### 3. Modifying the constants\n\nYou need to modify the following constants:\n\n```shell\n# Identifier of the collection. Check the collection row https://explorer.elrond.com/collections/COMBEYS-bc640d\nNFT_COLLECTION_IDENTIFIER=Your collection identifier\n# Null if Smart Contract does not hold NFTs for distribution. Provide an address if it holds.\nSMART_CONTRACT_ADDRESS=null\n# The collection identifier of the tokens that will be distributed. Check the collection row in the example: https://explorer.elrond.com/nfts/LKMEX-aab910-22e4ef\nTOKEN_COLLECTION_IDENTIFIER=LKMEX-aab910\n# Check the identifier row and extract the nonce. As an example: LKMEX-aab910-22e4ef has the nonce 22e4ef \nTOKEN_NONCE=22e4ef\n# The number of decimals of the token. Check the decimals row in the example: https://explorer.elrond.com/nfts/LKMEX-aab910-22e4ef For LKMEX it is 18\nTOKEN_DECIMALS=18\n# The total amount will be divided and distributed to all NFTs owners.\nTOKEN_TOTAL=500000\n# Select `mainnet`, `testnet` or `devnet`\nPROXY=\"mainnet\"\n```\n\n##### 4. Select the distribution method\nIf you want to distribute LKMEX or any other NFT-based ESDT you need to use this method in **./distribute.sh**:\n```shell\nerdpy contract call $OWNER_ADDRESS --function ESDTNFTTransfer --arguments $token_in_hex $token_nonce_in_hex \"${esdt_value_colum}\" $destination_address --proxy $PROXY --recall-nonce --gas-limit $GAS_LIMIT --chain $CHAIN --pem wallet.pem --send\n```\n\nIf you want to distribute ESDT (except EGLD) you need to use this method in **./distribute.sh**:\n```shell\nerdpy contract call $address_column --function ESDTTransfer --arguments $token_in_hex \"${esdt_value_colum}\" --proxy $PROXY --recall-nonce --gas-limit $GAS_LIMIT --chain $CHAIN --pem wallet.pem --send\n```\n\nIf you want to distribute ESDT you need to use this method in **./distribute.sh**:\n```shell\nerdpy --verbose tx new --receiver $address_column --value=${esdt_value_colum} --proxy $PROXY --recall-nonce --gas-limit $GAS_LIMIT --chain $CHAIN --pem wallet.pem --send\n```\n\nComment all other 2 methods; you need to have **only 1** active!\n##### 5. Run the script!\nCongrats, open the terminal and run **./distribute.sh**. Check the **output** folder for information, which can be displayed on Discord or your website 🥳! \n\n#### Generation based on the duration of holding\n\nOne of the most useful features is to distribute ESDT based on NFTs duration. To enable it all you need is to set a number in the **DURATION_OF_HOLDING**.\n\nThe script will check whether wallet address held NFT and **did not many any transactions** with it during specified days timeframe. \n\n#### Generation based on NFTs attributes\nAnother unique feature is to distribute ESDT based on a specific attribute. Suppose you have these attributes: Hat, Body, Top, Accessories. And you would like to reward only those NFTs holders with 'Golden Chain' of Accessories attribute.\n\nIf so, you need to provide these values in the settings:\n\nFILTER_TRAIT_TYPE=Accessories\n\nFILTER_TRAIT_VALUE=Golden Chain\n\n\n## NFTs holder report\nNow you can generate a CSV report, which shows your NFTs holders and displays a column of how many NFTS **is in the wallet** for **specified days** 😎.\n\n![CSV report example](assets/example-holders-report.png \"\")\n#### How it works\nThe script gets the addresses from all collection holders, it excludes **marketplaces** and the owner address/SC address 🥸.\n\nThen it checks the duration of holding (no transactions should occur within the particular time frame (10 days e.g.). Here is an example:\n\nThe address **A** received an NFT 3 days ago. If you specify that all holders should hold this NFT for 5 days, then this NFT **won't be added to the total eligible NFTs 😜**\n\nIf this address had received NFT 6 days ago, it would be eligible and would be displayed on the report.\n\nYou should run this report **every day** to use for your custom logic.\n\n#### Getting started\n##### 1. Configuring Python\nYou need to have Python installed on your machine or in the virtual environment 🤓.\n\nCheck your Python version by running:\n\n```shell\n$ python3 --version\n```\n\nThen you should modify the **distribute.sh** script to match your Python version: \n\n**PYTHON_BINARY=python3.8**\n\nAfter that run\n\n```shell\n$ pip install -r requirements.txt\n```\n\n##### 2. Modifying the env variables\n\nBasically you need to modify these values:\n\n```shell\n# Identifier of the collection. Check the collection row in the example: https://explorer.elrond.com/collections/COMBEYS-bc640d\nNFT_COLLECTION_IDENTIFIER=COMBEYS-bc640d\n# Leave it `null` if the Smart Contract does not hold NFTs for distribution. Provide an address if it holds.\nSMART_CONTRACT_ADDRESS=erd1qqqqqqqqqqqqqpgqxesrq4yltexyy29ejwj8qrc9cz8p08evmkdqqxl7e4\n# Select `mainnet`, `testnet` or `devnet`\nPROXY=\"mainnet\"\n# Owner address or could be the holder address of the most NFTs, which should not be counted :)\nOWNER_ADDRESS=erd1gkn5eppdkrkpyaq852vkgkqudg62qmsfy4nvdyj9w07eed2nmkdq9rgrk5\n# Specify how many consecutive days the holder address should keep NFT without performing transactions\nDAYS_OF_HOLDING_NFT=10\n```\n\n##### 3. Run the script\nCongrats, open the terminal and run **./nfts_holders_report.sh**. The script could run up to **60 minutes**, so be patient! 🥳\n\nThe final result will be a txt file in the /output folder and csv report as well. Check the [sample report](assets/Feb-20-2022-with-duration-COMBEYS-bc640d.csv)\n\n#### Contact me\n- [Twitter](https://twitter.com/wellbranding)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCombased%2Felrond-lkmex-distribution","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCombased%2Felrond-lkmex-distribution","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCombased%2Felrond-lkmex-distribution/lists"}