https://github.com/pooltogether/pooltogether-proxy-factory
Generic Proxy Factory for deploying proxies across different networks
https://github.com/pooltogether/pooltogether-proxy-factory
Last synced: 5 days ago
JSON representation
Generic Proxy Factory for deploying proxies across different networks
- Host: GitHub
- URL: https://github.com/pooltogether/pooltogether-proxy-factory
- Owner: pooltogether
- Created: 2021-04-07T20:57:51.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-04-21T22:23:37.000Z (about 5 years ago)
- Last Synced: 2025-04-25T04:03:30.266Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 242 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PoolTogether Generic Minimal Proxy Factory
[](https://coveralls.io/github/pooltogether/pooltogether-proxy-factory?branch=master)
[](https://circleci.com/gh/pooltogether/pooltogether-proxy-factory)
PoolTogether uses the [EIP-1167](https://eips.ethereum.org/EIPS/eip-1167) Minimal Proxy Factory throughout its contracts.
This repo provides this contract pattern as an [npm package](https://www.npmjs.com/package/@pooltogether/pooltogether-proxy-factory) for use in other repo's deployment scripts.
# Usage
Add package to repo using:
`yarn add @pooltogether/pooltogether-proxy-factory`
Using hardhat and ethers.js, add the GenericProxyFactory singleton for the network of choice under the `namedAccounts` in your `hardhat.config.js`.
Deploy a new Proxy Contract:
```javascript
let { genericProxyFactoryAddress } = await getNamedAccounts()
genericProxyFactoryContract = await ethers.getContractAt("GenericProxyFactory", genericProxyFactoryAddress)
// deploy using create
const implementationAddress = "
"
const dataToCallOnNewProxy = "0x"
const newProxyContractResult = await genericProxyFactory.create(implementationAddress, dataToCallOnNewProxy)
```
# Installation
Install the repo and dependencies by running:
`yarn`
## Deployment
These contracts can be deployed to a network by running:
`yarn deploy `
# Testing
Run the unit tests locally with:
`yarn test`
## Coverage
Generate the test coverage report with:
`yarn coverage`