{"id":20001983,"url":"https://github.com/pooltogether/pooltogether-proxy-factory-package","last_synced_at":"2025-05-04T15:33:45.979Z","repository":{"id":63278318,"uuid":"360697628","full_name":"pooltogether/pooltogether-proxy-factory-package","owner":"pooltogether","description":"Typescript package to utilize the Generic Minimal Proxy Factory","archived":false,"fork":false,"pushed_at":"2021-06-14T18:23:41.000Z","size":35,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-04-23T21:42:38.971Z","etag":null,"topics":[],"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/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}},"created_at":"2021-04-22T22:28:02.000Z","updated_at":"2022-03-29T04:17:00.000Z","dependencies_parsed_at":"2022-11-16T06:30:38.343Z","dependency_job_id":null,"html_url":"https://github.com/pooltogether/pooltogether-proxy-factory-package","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-proxy-factory-package","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-proxy-factory-package/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-proxy-factory-package/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pooltogether%2Fpooltogether-proxy-factory-package/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pooltogether","download_url":"https://codeload.github.com/pooltogether/pooltogether-proxy-factory-package/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224394299,"owners_count":17303895,"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:20.657Z","updated_at":"2024-11-13T05:19:21.921Z","avatar_url":"https://github.com/pooltogether.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pooltogether-proxy-factory-package\n\nTypescript wrapper to use PoolTogether's [Generic Minimal Proxy Factory](https://github.com/pooltogether/pooltogether-proxy-factory/tree/master/deployments) for deploying contracts.\n\nNote: this pattern does not work very well with Ownable contracts - because these must be constructed vs. initialized.\n\n## How it works\n\nImport this package into your repo using:\n`yarn add -D @pooltogether/pooltogether-proxy-factory-package`\n\n\nImport in the deployments script:\n```typescript\nimport { factoryDeploy } from \"@pooltogether/pooltogether-proxy-factory-package\"\n```\nor using javascript: \n```javascript\nconst { factoryDeploy } = require(\"@pooltogether/pooltogether-proxy-factory-package\")\n```\n\nAdd the genericProxyFactory deployment ([addresses](https://github.com/pooltogether/pooltogether-proxy-factory/tree/master/deployments)) to `namedAccounts` in `hardhat.config.ts`:\n\n```javascript\n...\nnamedAccounts: {\n    ...\n    genericProxyFactory: {\n        1: \"0x14e09c3319244a84e7c1E7B52634f5220FA96623\",\n        4: \"0x594069c560D260F90C21Be25fD2C8684efbb5628\",\n        42: \"0x713edC7728C4F0BCc135D48fF96282444d77E604\",\n        137: \"0xd1797D46C3E825fce5215a0259D3426a5c49455C\",\n        80001: \"0xd1797D46C3E825fce5215a0259D3426a5c49455C\"\n    }\n```\n\nPass the paramaters required:\n```typescript\ninterface DeploySettings {\n    implementationAddress: string\n    contractName: string\n    overWrite?: boolean // defaults to false\n    signer?: Signer\n    initializeData?: string \n    provider: Provider \n}\n```\n\nThe initialization data can be encoded as such:\n```typescript\nconst contractInterface = new ethers.utils.Interface(contractAbi)\n\nconst constructorArgs: string = contractInterface.encodeFunctionData(contractInterface.getFunction(\"functionName\"),\n    [\n        arg1,\n        arg2\n    ]\n)\n```\n\n*Note:* if there is no Generic Proxy Factory for the target network, one will be deployed\n\n\n# Installation\nInstall the repo and dependencies by running:\n`yarn`\n\n# Build\nTo build the package, run:\n`yarn dev`\n\n# Publish\nTo publish any changes to npm, build first and then run:\n`yarn publish`\n\n# Testing\nRun the unit tests locally with:\n`yarn test`\n\n## Coverage\nGenerate the test coverage report with:\n`yarn coverage`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fpooltogether-proxy-factory-package","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpooltogether%2Fpooltogether-proxy-factory-package","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpooltogether%2Fpooltogether-proxy-factory-package/lists"}