{"id":20002054,"url":"https://github.com/pooltogether/ethonline-workshop","last_synced_at":"2026-03-19T13:02:11.805Z","repository":{"id":98740149,"uuid":"300018917","full_name":"pooltogether/ethonline-workshop","owner":"pooltogether","description":null,"archived":false,"fork":false,"pushed_at":"2020-09-30T19:40:07.000Z","size":2,"stargazers_count":4,"open_issues_count":0,"forks_count":7,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-25T04:03:29.343Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"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/pooltogether.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":"2020-09-30T18:36:34.000Z","updated_at":"2022-03-29T04:28:02.000Z","dependencies_parsed_at":"2023-03-04T09:15:19.800Z","dependency_job_id":null,"html_url":"https://github.com/pooltogether/ethonline-workshop","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pooltogether/ethonline-workshop","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fethonline-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fethonline-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fethonline-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fethonline-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pooltogether","download_url":"https://codeload.github.com/pooltogether/ethonline-workshop/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fethonline-workshop/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28914512,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-30T12:13:43.263Z","status":"ssl_error","status_checked_at":"2026-01-30T12:13:22.389Z","response_time":66,"last_error":"SSL_read: 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":[],"created_at":"2024-11-13T05:19:37.517Z","updated_at":"2026-01-30T14:38:24.912Z","avatar_url":"https://github.com/pooltogether.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# PoolTogether Workshop\n\nIn this workshop we're going to:\n\n1. Deploy the entire PoolTogether system locally\n2. Create a new Prize Pool and deposit and withdraw\n3. Create a custom prize strategy and swap it out the old one for this one\n\n# Setting up PoolTogether Contracts\n\nSetup the [PoolTogether Contracts](https://github.com/pooltogether/pooltogether-pool-contracts).\n\n```bash\n$ git clone git@github.com:pooltogether/pooltogether-pool-contracts.git\n$ cd pooltogether-pool-contracts/\n$ git checkout version-3\n$ nvm use\n$ yarn\n$ yarn start\n```\n\nIn another terminal, load up a buidler console:\n\n```bash\n$ buidler console --network localhost\n```\n\nYou can get all the deployed contracts like so:\n\n```js\n\u003e deployed = await deployments.all()\n```\n\nFind the deployed addresses like so:\n\n```js\n\u003e deployed.SingleRandomWinnerBuilder.address\n\u003e deployed.CompoundPrizePoolBuilder.address\n\u003e deployed.cDai.address \n\u003e deployed.Dai.address\n\u003e deployed.RNGServiceMock.address\n```\n\n# Setup the Builder UI\n\nSetup the [Builder UI](https://github.com/pooltogether/pooltogether-pool-builder-ui).\n\n```bash\n$ cd ..\n$ git clone git@github.com:pooltogether/pooltogether-pool-builder-ui.git\n$ cd pooltogether-pool-builder-ui\n$ nvm use\n$ yarn\n```\n\nNow copy over the .envrc.example\n\n```\n$ cp .envrc.example .envrc\n```\n\nUpdate the .envrc with your infura key and allow direnv:\n\n```\n$ direnv allow\n```\n\nUpdate the `lib/constants.js` file with the deployed address for network 31337.  \n\nYou can just use the cDai address for all Compound cTokens.\n\nNow start the server:\n\n```\n$ yarn dev\n```\n\nLet's build a pool!\n\nIn the original PoolTogether Contract console let's give ourselves some ETH and Dai:\n\n```js\n\u003e signers = await ethers.getSigners()\n\u003e signers[0].sendTransaction({ to: \"your_address\", value: ethers.utils.parseEther('10') })\n\u003e dai = await ethers.getContractAt('ERC20Mintable', deployed.Dai.address, signers[0])\n\u003e dai.mint(\"your_address\", ethers.utils.parseEther('1000'))\n```\n\nNow we can go and create a new pool\n\n# Setup the Reference Pool UI\n\nSetup the [Reference Pool UI](https://github.com/pooltogether/pooltogether-reference-pool-ui)\n\n```bash\n$ cd ..\n$ git clone git@github.com:pooltogether/pooltogether-reference-pool-ui.git\n$ cd pooltogether-reference-pool-ui\n$ nvm use\n$ yarn\n```\n\nNow copy over the .envrc.example\n\n```\n$ cp .envrc.example .envrc\n```\n\nUpdate the .envrc with your infura key and allow direnv:\n\n```bash\n$ direnv allow\n```\n\nStart the reference UI server\n\n```bash\n$ yarn dev --port 4000\n```\n\nNavigate to `localhost:4000` and paste your newly created pool address\n\n\n# Create a custom Prize Strategy\n\nUse the [Custom Prize Strategy](https://github.com/pooltogether/custom-prize-strategy)\n\nSetup the project:\n\n```bash\n$ cd ..\n$ git clone git@github.com:pooltogether/custom-prize-strategy.git\n$ cd custom-prize-strategy\n$ nvm use\n$ yarn\n```\n\nDeploy the strategy to the earlier node:\n\n```bash\n$ buidler --network pt deploy\n```\n\nNow spin up a console\n\n```bash\n$ buidler --network pt console\n```\n\nGet the contracts:\n\n```js\n\u003e deployed = await deployments.all()\n```\n\nGet the builder contract:\n\n```js\n\u003e signers = await ethers.getSigners()\n\u003e builder = await ethers.getContractAt('MultipleWinnersBuilder', deployed.MultipleWinnersBuilder.address, signers[0])\n```\n\nNow let's vampire the old strategy.\n\nFirst we'll check to see what the address will be:\n\n```js\n\u003e await builder.callStatic.createMultipleWinners('0x93498f3054Aca6dEe768DCA2762C83FC0F06c70d', 2)\n```\n\nSave that address!\n\nNow let's create the strategy:\n\n```js\n\u003e await builder.createMultipleWinners('0x93498f3054Aca6dEe768DCA2762C83FC0F06c70d', 2)\n```\n\nNow go back to the original Pool contracts console and get a reference to the pool:\n\n```js\n\u003e pool = await ethers.getContractAt('PrizePool', '0x06134447473A1ad19dd05554780816C542486d15', signers[0])\n```\n\nNow let's swap out the strategy:\n\n```js\n\u003e await pool.setPrizeStrategy('0xdbaA15927b1463EdD14Cf51D082BD7703Fd1C238')\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fethonline-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpooltogether%2Fethonline-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fethonline-workshop/lists"}