{"id":20030807,"url":"https://github.com/generationsoftware/foundry-winner-calc","last_synced_at":"2026-05-14T19:02:15.244Z","repository":{"id":228116389,"uuid":"771288490","full_name":"GenerationSoftware/foundry-winner-calc","owner":"GenerationSoftware","description":"A foundry-assisted toolkit for efficiently calculating winners of a prize pool draw.","archived":false,"fork":false,"pushed_at":"2024-04-10T20:23:32.000Z","size":92,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T17:47:22.570Z","etag":null,"topics":["claimer","claimprize","foundry","pooltogether","prizepool","prizes","twab"],"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/GenerationSoftware.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":"2024-03-13T02:44:59.000Z","updated_at":"2024-03-18T19:31:16.000Z","dependencies_parsed_at":"2024-11-13T09:39:22.262Z","dependency_job_id":null,"html_url":"https://github.com/GenerationSoftware/foundry-winner-calc","commit_stats":null,"previous_names":["generationsoftware/foundry-winner-calc"],"tags_count":5,"template":false,"template_full_name":"GenerationSoftware/foundry-template","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Ffoundry-winner-calc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Ffoundry-winner-calc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Ffoundry-winner-calc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Ffoundry-winner-calc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GenerationSoftware","download_url":"https://codeload.github.com/GenerationSoftware/foundry-winner-calc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241461903,"owners_count":19966773,"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":["claimer","claimprize","foundry","pooltogether","prizepool","prizes","twab"],"created_at":"2024-11-13T09:28:26.204Z","updated_at":"2026-05-14T19:02:10.193Z","avatar_url":"https://github.com/GenerationSoftware.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PoolTogether Foundry Winner Calculator\n\nA foundry-assisted toolkit for efficiently calculating winners of a prize pool draw.\n\n## Installation\n\n1. clone this repo\n2. install [foundry](https://book.getfoundry.sh/getting-started/installation)\n3. run `npm i` and then `npm run build`\n4. navigate to the `sol` directory and run `forge install` and then `forge build`\n\n\u003e **WINDOWS INSTALLATION** If you are installing on windows, you may need to increase your max filepath setting on git ***before running forge install*** by running the following command as administrator: `git config --system core.longpaths true`\n\n## How to Calculate Winners for each Vault\n\n\u003e This script batches RPC queries for a given vault, so you'll need to run it for each vault that you want to check prizes for.\n\n### Step 1\n\nCompile a list of potential winners that you want to check against, a given prize pool and vault combo and save the info to a file in the following format:\n\n\u003e example-input.json\n```json\n{\n  \"chainId\": 10,\n  \"prizePoolAddress\": \"0xe32e5E1c5f0c80bD26Def2d0EA5008C107000d6A\",\n  \"vaultAddress\": \"0xf0B19f02c63d51B69563A2b675e0160e1C34397C\",\n  \"userAddresses\": [\n    \"0xf54d071e929c02eb097cbf284e6e6a8bb924f2a7\",\n    \"0x12dc4da5037152f97adc89a54c855e9bc84eeb7d\",\n    \"0x299c8c6d973506fbf9245d95773d6ca1c5ccbfb3\"\n  ]\n}\n```\n\n### Step 2\n\nDefine your desired RPC URL as a local environment variable like so:\n\n`FWC_RPC_URL=\"https://my-rpc.xyz\"`\n\n### Step 3\n\nRun the `index.js` script and pass in your input file path and desired output file path:\n\n`node index.js example-input.json example-output.json`\n\nWhen the script finishes, the results will be written to your output file location in the following format:\n\n```json\n{\n  \"winners\": [\n    {\n      \"user\": \"0x12Dc4dA5037152F97aDC89a54C855e9bc84eEB7d\",\n      \"prizes\": {\n        \"5\": [\n          451,\n          685,\n          941\n        ]\n      }\n    }\n  ]\n}\n```\n\n## Optional Arguments\n\nOptional arguments can be set in the input JSON file to change the behaviour of the script.\n\n--------------------------------------------------------------------------------\n\n### multicallBatchSize\n\nSet the `multicallBatchSize` argument in the input json file to limit multicall sizes for your RPC calls. Some RPC enforce \"gas\" limits on read calls and will only accept certain batch sizes.\n\n#### Example:\n\n```json\n{\n  \"multicallBatchSize\": 50\n}\n```\n\n--------------------------------------------------------------------------------\n\n### blockNumber\n\nThe `blockNumber` argument can be set to run the script at a specific block number instead of the current block. Must be either a number or string that can be parsed into a `BigInt`.\n\n#### Example:\n\n```json\n{\n  \"blockNumber\": \"10448512\"\n}\n```\n\n--------------------------------------------------------------------------------\n\n### debug\n\nThe `debug` argument is an optional boolean. When set, some extra logs will be included in the output logs to help debug issues.\n\n#### Example:\n\n```json\n{\n  \"debug\": true\n}\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerationsoftware%2Ffoundry-winner-calc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenerationsoftware%2Ffoundry-winner-calc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerationsoftware%2Ffoundry-winner-calc/lists"}