{"id":20001895,"url":"https://github.com/pooltogether/merkle-distributor","last_synced_at":"2025-05-04T15:33:28.564Z","repository":{"id":57137645,"uuid":"330011873","full_name":"pooltogether/merkle-distributor","owner":"pooltogether","description":null,"archived":false,"fork":false,"pushed_at":"2021-02-16T21:28:19.000Z","size":16891,"stargazers_count":8,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-22T19:11:32.940Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/pooltogether.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":"2021-01-15T20:10:49.000Z","updated_at":"2025-01-29T19:36:07.000Z","dependencies_parsed_at":"2022-09-01T03:01:04.578Z","dependency_job_id":null,"html_url":"https://github.com/pooltogether/merkle-distributor","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fmerkle-distributor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fmerkle-distributor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fmerkle-distributor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fmerkle-distributor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pooltogether","download_url":"https://codeload.github.com/pooltogether/merkle-distributor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252356517,"owners_count":21734967,"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-11-13T05:19:02.679Z","updated_at":"2025-05-04T15:33:26.179Z","avatar_url":"https://github.com/pooltogether.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @pooltogether/merkle-distributor\n\n[![Tests](https://github.com/pooltogether/merkle-distributor/workflows/Tests/badge.svg)](https://github.com/pooltogether/merkle-distributor/actions?query=workflow%3ATests)\n[![Lint](https://github.com/pooltogether/merkle-distributor/workflows/Lint/badge.svg)](https://github.com/pooltogether/merkle-distributor/actions?query=workflow%3ALint)\n\nThis project contains the distribution, code, and deployment scripts for the PoolTogether retroactive token claims. The BigQuery output was generated by the [Retroactive Query](https://github.com/pooltogether/retroactive-query)\n\n# Setup\n\nInstall Dependencies\n\n```sh\n$ yarn\n```\n\nCompile Contracts\n\n```sh\n$ yarn compile\n```\n\nRun Tests\n\n```sh\n$ yarn test\n```\n\n# Verify the output from the Retroactive Query\n\nThe file `bq-results-20210202-094742-fvr9ifm390n3.json` contains the full set of rows (ordered by address ascending) of the [Retroactive Query](https://github.com/pooltogether/retroactive-query). You can follow the steps in that project to generate this file.\n\nIn this repo the file `merkle_tree.json` is generated from the BigQuery output and fed into the contract deployment script. You can generate the merkle proof file yourself using the steps below.\n\n## Generate Merkle Proof\n\nFirst pre-process the BigQuery results (the file is missing commas):\n\n```sh\n$ ts-node ./scripts/pre-process-json.ts -i bq-results-20210202-094742-fvr9ifm390n3.json \u003e bq-results.processed.json\n```\n\nNow generate a merkle proof blob:\n\n```sh\n$ ts-node ./scripts/generate-merkle-root -i bq-results.processed.json \u003e merkle-proof.generated.json\n```\n\nYou can compare your proof to the committed proof:\n\n```sh\n$ diff merkle-proof.generated.json merkle_tree.json\n```\n\nYou will not see any differences!\n\n# Deploy the Contract\n\nThe contract deployment script consumes the `merkle_tree.json` file as the distribution. Make sure this file exists before running the deploy script.\n\nYou can deploy to rinkeby:\n\n```sh\n$ yarn deploy rinkeby\n```\n\nOr you can deploy to mainnet:\n\n```sh\n$ yarn deploy mainnet\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fmerkle-distributor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpooltogether%2Fmerkle-distributor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fmerkle-distributor/lists"}