{"id":20169146,"url":"https://github.com/developer-dao/token-airdrop-whitelist","last_synced_at":"2026-01-27T09:42:51.789Z","repository":{"id":45962016,"uuid":"427736938","full_name":"Developer-DAO/token-airdrop-whitelist","owner":"Developer-DAO","description":"Power an airdrop to a predefined set of addresses","archived":false,"fork":false,"pushed_at":"2021-12-03T20:21:18.000Z","size":1042,"stargazers_count":34,"open_issues_count":0,"forks_count":7,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-10T02:53:55.041Z","etag":null,"topics":["erc20","solidity"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","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/Developer-DAO.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}},"created_at":"2021-11-13T18:01:13.000Z","updated_at":"2024-08-10T17:55:44.000Z","dependencies_parsed_at":"2022-07-21T22:17:48.840Z","dependency_job_id":null,"html_url":"https://github.com/Developer-DAO/token-airdrop-whitelist","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Developer-DAO/token-airdrop-whitelist","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-DAO%2Ftoken-airdrop-whitelist","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-DAO%2Ftoken-airdrop-whitelist/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-DAO%2Ftoken-airdrop-whitelist/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-DAO%2Ftoken-airdrop-whitelist/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Developer-DAO","download_url":"https://codeload.github.com/Developer-DAO/token-airdrop-whitelist/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Developer-DAO%2Ftoken-airdrop-whitelist/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28811288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-27T07:41:26.337Z","status":"ssl_error","status_checked_at":"2026-01-27T07:41:08.776Z","response_time":168,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["erc20","solidity"],"created_at":"2024-11-14T01:11:33.150Z","updated_at":"2026-01-27T09:42:51.635Z","avatar_url":"https://github.com/Developer-DAO.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DevCoin\n\n## What is this?\n\nThis is a project to power an airdrop of tokens according to some predefined criteria. There is an ERC20 smart contract with a capped number of tokens.\n\nWhen the contract is deployed, some portion of the tokens reserved for the airdrop are made available to a whitelisted set of addresses, and the remaining tokens go to a treasury wallet. After some time any tokens unclaimed in the airdrop can be swept up into the treasury.\n\nThe use case is for the [Developer DAO](https://www.developerdao.com/), allowing holders of the first (free) Developer DAO NFTs to claim a number of tokens for themselves. This project can be easily modified to support any desired criteria for whitelisting airdrop recipients.\n\n## Quickstart:\n\nCreate `.env` (optional, just for testing):\n\n```\nETHERSCAN_API_KEY=$APIKEY\nROPSTEN_URL=https://eth-kovan.alchemyapi.io/v2/$APIKEY\nPRIVATE_KEY=0xabcdef1234...\nINFURA_KEY=https://mainnet.infura.io/v3/$APIKEY\n```\n\n- Modify (contracts/DevCoin.sol)[contracts/DevCoin.sol] to your liking.\n- `npm run snapshot:nft` -- gets a list of addresses who hold a given NFT.\n- `npm run generate:proofs` -- generates a mapping of address =\u003e proof.\n- `npm run build` -- compiles contract.\n- `npm test` -- tests contract. It is highly recommended to read \u003ctest/index.ts\u003e to understand how the contract works.\n- `npm run deploy:local` -- deploy to local hardhat network.\n- `npm run deploy:ropsten` -- deploy to ropsten hardhat network.\n\nAn included sample web3 script to get a proof for your wallet address is in [web/](web).\n\n## Technical details\n\nThe challenge that this project solves is defining a whitelist of approved addresses which may claim tokens in the airdrop. It is inefficient to deploy or maintain a large list of whitelisted addresses in a contract, so instead a merkle tree is used. The contract is supplied with the merkle root of a tree whose leaves consist of addresses of whitelisted recipients. For a whitelisted recipient to claim their token they must present a merkle proof that corresponds to their address (can be done via web UI).\n\nWhen a whitelisted holder presents their merkle proof to the `claim()` function, if their address matches the proof and belongs in the merkle tree, they are approved to claim their airdrop tokens, once.\n\n### Uses:\n\n- **OpenZeppelin** for contract foundation\n- **HardHat** for contract testing\n- **Ethers.js** for sample web3 app\n- **merkletree.js** for merkle proof generation\n\n## Diagram\n\n![Diagram](doc/diagram.svg)\n\n# Performance optimizations\n\nFor faster runs of your tests and scripts, consider skipping ts-node's type checking by setting the environment variable `TS_NODE_TRANSPILE_ONLY` to `1` in hardhat's environment. For more details see [hardhat documentation](https://hardhat.org/guides/typescript.html#performance-optimizations).\n\n## Credits\n\n- [Mischa Spiegelmock](https://twitter.com/spiegelmock) @DeveloperDAO @JetBridge\n\n  If you make money with this feel free to send me some at `mish.eth`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-dao%2Ftoken-airdrop-whitelist","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper-dao%2Ftoken-airdrop-whitelist","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper-dao%2Ftoken-airdrop-whitelist/lists"}