{"id":15660429,"url":"https://github.com/pcaversaccio/batch-distributor","last_synced_at":"2025-08-12T18:16:45.029Z","repository":{"id":42532669,"uuid":"467431936","full_name":"pcaversaccio/batch-distributor","owner":"pcaversaccio","description":"Helper smart contract for batch sending both native and ERC-20 tokens.","archived":false,"fork":false,"pushed_at":"2025-07-30T11:15:17.000Z","size":3239,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-07-30T15:31:44.213Z","etag":null,"topics":["erc20","ether","ethereum","smart-contract","solidity"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pcaversaccio.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":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-03-08T08:48:38.000Z","updated_at":"2025-07-30T11:15:21.000Z","dependencies_parsed_at":"2024-03-30T12:23:20.991Z","dependency_job_id":"0c8c455d-231a-47ad-b75c-2c4aa9f3706f","html_url":"https://github.com/pcaversaccio/batch-distributor","commit_stats":{"total_commits":549,"total_committers":5,"mean_commits":109.8,"dds":0.04553734061930781,"last_synced_commit":"28d69493e0022bd2e6f1d7387daa8344a465a3cc"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":"pcaversaccio/hardhat-project-template-ts","purl":"pkg:github/pcaversaccio/batch-distributor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fbatch-distributor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fbatch-distributor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fbatch-distributor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fbatch-distributor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pcaversaccio","download_url":"https://codeload.github.com/pcaversaccio/batch-distributor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pcaversaccio%2Fbatch-distributor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270110809,"owners_count":24529147,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"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":["erc20","ether","ethereum","smart-contract","solidity"],"created_at":"2024-10-03T13:21:41.161Z","updated_at":"2025-08-12T18:16:44.906Z","avatar_url":"https://github.com/pcaversaccio.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Batch Distributor\n\n[![🕵️‍♂️ Test smart contracts](https://github.com/pcaversaccio/batch-distributor/actions/workflows/test-contracts.yml/badge.svg)](https://github.com/pcaversaccio/batch-distributor/actions/workflows/test-contracts.yml)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/license/mit)\n\n## Installation\n\nIt is recommended to install [`pnpm`](https://pnpm.io) through the `npm` package manager, which comes bundled with [Node.js](https://nodejs.org/en) when you install it on your system. It is recommended to use a Node.js version `\u003e=24.2.0`.\n\nOnce you have `npm` installed, you can run the following both to install and upgrade `pnpm`:\n\n```console\nnpm install -g pnpm\n```\n\nAfter having installed `pnpm`, simply run:\n\n```console\npnpm install\n```\n\n## Unit Tests\n\nYou can run the unit tests with\n\n```console\npnpm test\n```\n\n## Test Coverage\n\nThis repository implements a test coverage [plugin](https://github.com/sc-forks/solidity-coverage). Simply run:\n\n```console\npnpm coverage\n```\n\n## Implemented Functionalities\n\n- **ETH Batch Transaction:** `distributeEther(batch (tuple))`\n- **ERC20 Batch Transaction:** `distributeToken(token (address), batch (tuple))`\n\nThe parameter `batch` is a nested struct object that contains an array of tuples that contain each a recipient address \u0026 ETH/token amount. Please ensure that the amount for the ETH transactions is given in `wei` (1 wei = $10^{-18}$ ETH) and check the decimal digits for the ERC20 tokens.\n\n```typescript\n{\n  txns: [{ recipient: address, amount: amount }];\n}\n```\n\n## Caveats\n\n1. Although the batch size is only theoretically limited to the size of `uint256`, sending too many transactions in a batch will cause the block `gasLimit` to be exceeded and therefore such a transaction will revert. A large number of transactions should be split into separate batches.\n2. A low-level Solidity call will copy _any amount of bytes_ to local memory. When bytes are copied from `returndata` to `memory`, the [memory expansion cost](https://ethereum.stackexchange.com/questions/92546/what-is-the-memory-expansion-cost) is paid. This means that when using a standard Solidity call, the callee can **\"returnbomb\"** the caller, imposing an arbitrary gas cost. Because this gas is paid _by the caller_ and _in the caller's context_, it can cause the caller to run out of gas and halt execution. It is possible to prevent this attack (see e.g. [here](https://github.com/nomad-xyz/ExcessivelySafeCall)), but this contract contains no measures against it. If you need this kind of security, please do not use this contract.\n\n## Test Deployments\n\nThe smart contract [`BatchDistributor`](./contracts/BatchDistributor.sol) has been deployed to the following test networks:\n\n- **Sepolia:** [`0xE710359D8E887afDF66053E6a9e044E0499e3446`](https://sepolia.etherscan.io/address/0xE710359D8E887afDF66053E6a9e044E0499e3446)\n- **Holešky (Holešovice):** [`0xE710359D8E887afDF66053E6a9e044E0499e3446`](https://holesky.etherscan.io/address/0xE710359D8E887afDF66053E6a9e044E0499e3446)\n\n### Examples\n\n- _Example 1:_ ETH distribution [`0x1a7345857f653944d5d555a81057a1ff0e364929542ab1db2a037496f2ba6f6b`](https://sepolia.etherscan.io/tx/0x1a7345857f653944d5d555a81057a1ff0e364929542ab1db2a037496f2ba6f6b)\n  - Input tuple data `batch`: `[[[\"0x9F3f11d72d96910df008Cfe3aBA40F361D2EED03\",1],[\"0x3854Ca47Abc62A3771fE06ab45622A42C4A438Cf\",2]]]`\n- _Example 2:_ ERC-20 token distribution [`0x224448bdb43314f30236c147447e29e002515c0e285cc76132ac4a270e1f56a8`](https://sepolia.etherscan.io/tx/0x224448bdb43314f30236c147447e29e002515c0e285cc76132ac4a270e1f56a8)\n  - Input `token` address (Wrapped Ether (WETH)): [`0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14`](https://sepolia.etherscan.io/address/0xfFf9976782d46CC05630D1f6eBAb18b2324d6B14)\n  - Input tuple data `batch`: `[[[\"0x9F3f11d72d96910df008Cfe3aBA40F361D2EED03\",50],[\"0x3854Ca47Abc62A3771fE06ab45622A42C4A438Cf\",50]]]`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcaversaccio%2Fbatch-distributor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpcaversaccio%2Fbatch-distributor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpcaversaccio%2Fbatch-distributor/lists"}