@pooltogether/pooltogether-proxy-factory
v1.0.0-beta.3
Published
PoolTogether ProxyFactory Deployer
Downloads
51
Readme
PoolTogether Generic Minimal Proxy Factory
PoolTogether uses the EIP-1167 Minimal Proxy Factory throughout its contracts. This repo provides this contract pattern as an npm package 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:
let { genericProxyFactoryAddress } = await getNamedAccounts()
genericProxyFactoryContract = await ethers.getContractAt("GenericProxyFactory", genericProxyFactoryAddress)
// deploy using create
const implementationAddress = "<address>"
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 <networkName>
Testing
Run the unit tests locally with:
yarn test
Coverage
Generate the test coverage report with:
yarn coverage