{"id":20030812,"url":"https://github.com/generationsoftware/pt-v5-draw-auction","last_synced_at":"2026-06-05T01:31:11.103Z","repository":{"id":179045079,"uuid":"662645702","full_name":"GenerationSoftware/pt-v5-draw-auction","owner":"GenerationSoftware","description":null,"archived":false,"fork":false,"pushed_at":"2024-02-15T23:46:54.000Z","size":472,"stargazers_count":12,"open_issues_count":0,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-12T17:47:22.561Z","etag":null,"topics":["pooltogether","solidity"],"latest_commit_sha":null,"homepage":"","language":"Solidity","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/GenerationSoftware.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-07-05T15:17:08.000Z","updated_at":"2024-01-30T19:36:08.000Z","dependencies_parsed_at":"2023-12-22T16:50:03.253Z","dependency_job_id":"28704c25-9bb9-4e53-8144-c627889337d2","html_url":"https://github.com/GenerationSoftware/pt-v5-draw-auction","commit_stats":null,"previous_names":["generationsoftware/pt-v5-draw-auction"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-draw-auction","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-draw-auction/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-draw-auction/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GenerationSoftware%2Fpt-v5-draw-auction/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GenerationSoftware","download_url":"https://codeload.github.com/GenerationSoftware/pt-v5-draw-auction/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":["pooltogether","solidity"],"created_at":"2024-11-13T09:28:28.684Z","updated_at":"2026-06-05T01:31:11.051Z","avatar_url":"https://github.com/GenerationSoftware.png","language":"Solidity","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://github.com/pooltogether/pooltogether--brand-assets\"\u003e\n    \u003cimg src=\"https://github.com/pooltogether/pooltogether--brand-assets/blob/977e03604c49c63314450b5d432fe57d34747c66/logo/pooltogether-logo--purple-gradient.png?raw=true\" alt=\"PoolTogether Brand\" style=\"max-width:100%;\" width=\"400\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n# PoolTogether V5 Draw Auction\n\n[![Code Coverage](https://github.com/generationsoftware/pt-v5-draw-auction/actions/workflows/coverage.yml/badge.svg)](https://github.com/generationsoftware/pt-v5-draw-auction/actions/workflows/coverage.yml)\n[![built-with openzeppelin](https://img.shields.io/badge/built%20with-OpenZeppelin-3677FF)](https://docs.openzeppelin.com/)\n![MIT license](https://img.shields.io/badge/license-MIT-blue)\n\n\u003cstrong\u003eHave questions or want the latest news?\u003c/strong\u003e\n\u003cbr/\u003eJoin the PoolTogether Discord or follow us on Twitter:\n\n[![Discord](https://badgen.net/badge/icon/discord?icon=discord\u0026label)](https://pooltogether.com/discord)\n[![Twitter](https://badgen.net/badge/icon/twitter?icon=twitter\u0026label)](https://twitter.com/PoolTogether_)\n\n## Overview\n\nThe Draw Auction is a suite of contracts that auctions off the transactions required to push a new random number to the Prize Pool.\n\nPoolTogether V5 Prize Pools have periodic Draws. A \"Draw\" is when a random number is used to distribute the next batch of prizes to the users. This means that an external contract must source a random number and push the random number to the Prize Pool.\n\nTo incentivize new draws, each Prize Pool holds a reserve of tokens. A privileged \"draw manager\" is allowed to push random numbers to the Prize Pool and withdraw from the reserve.\n\nThe Draw Auction serves as the draw manager for all Prize Pools.\n\n## How it Works\n\nRandom numbers come from an RNG service on Ethereum, and Prize Pools live on L2s. This means that we need to incentivize a sequence of transactions to generate a new random number on Ethereum, then bridge it to the Prize Pool on L2.\n\nEach sequence includes two auctions:\n\n1. Starting the RNG request. This is when the RNG request kicks-off, and may require funds (the Chainlink VRF 2.0 needs LINK tokens).\n2. Relaying the RNG results to L2 via a bridge.\n\nStarting the RNG request occurs on L1, and receiving the bridge RNG result occurs on L2. The auctions don't have pricing data, so they compute the reward _as a fraction of the available Prize Pool reserve_. This means that the auction on L1 does not need to know how much reserve is available in a Prize Pool on L2.\n\nThere are three key contracts:\n\n- RngAuction: auctions off the initial RNG request\n- RngAuctionRelayer: relays the RNG results to the RngRelayAuction\n- RngRelayAuction: incentivizes the relay with an auction and triggers close draw on the Prize Pool\n\nFor more information, see the detailed [PoolTogether V5 Draw Auction documentation](https://dev.pooltogether.com/protocol/next/design/draw-auction)\n\n## Flow\n\n![Draw Auction](./assets/DrawAuction.png)\n\n## Development\n\n### Installation\n\nYou may have to install the following tools to use this repository:\n\n- [Foundry](https://github.com/foundry-rs/foundry) to compile and test contracts\n- [direnv](https://direnv.net/) to handle environment variables\n- [lcov](https://github.com/linux-test-project/lcov) to generate the code coverage report\n\nInstall dependencies:\n\n```\nnpm i\n```\n\n### Env\n\nCopy `.envrc.example` and write down the env variables needed to run this project.\n\n```\ncp .envrc.example .envrc\n```\n\nOnce your env variables are setup, load them with:\n\n```\ndirenv allow\n```\n\n### Compile\n\nRun the following command to compile the contracts:\n\n```\nnpm run compile\n```\n\n### Coverage\n\nForge is used for coverage, run it with:\n\n```\nnpm run coverage\n```\n\nYou can then consult the report by opening `coverage/index.html`:\n\n```\nopen coverage/index.html\n```\n\n### Code quality\n\n[Husky](https://typicode.github.io/husky/#/) is used to run [lint-staged](https://github.com/okonet/lint-staged) and tests when committing.\n\n[Prettier](https://prettier.io) is used to format TypeScript and Solidity code. Use it by running:\n\n```\nnpm run format\n```\n\n[Solhint](https://protofire.github.io/solhint/) is used to lint Solidity files. Run it with:\n\n```\nnpm run hint\n```\n\n### CI\n\nA default Github Actions workflow is setup to execute on push and pull request.\n\nIt will build the contracts and run the test coverage.\n\nYou can modify it here: [.github/workflows/coverage.yml](.github/workflows/coverage.yml)\n\nFor the coverage to work, you will need to setup the `MAINNET_RPC_URL` repository secret in the settings of your Github repository.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerationsoftware%2Fpt-v5-draw-auction","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgenerationsoftware%2Fpt-v5-draw-auction","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgenerationsoftware%2Fpt-v5-draw-auction/lists"}