The project has been configured to support the following networks. All the deploy scripts will expect network param to know which network the contract deployment / interaction should take place
| network |
|---|
goerli |
optimism-mainnet |
fantom-mainnet |
fantom-testnet |
mainnet |
fuji-testnet |
avalanche-mainnet |
mumbai |
polygon |
zksync-mainnet |
zksync-testnet |
The section here shows how to set up the project registry for the first time on a given network. Ideally these steps would be done once per chain. In this example, we would be deploying on goerli
- Create an
.envfile
cp ../.env.example ../.env-
Create an
.envfile and fill outINFURA_ID: Infura ID for deploying contract (Get one here)DEPLOYER_PRIVATE_KEY: address which deploys the contractETHERSCAN_API_KEY: API key for etherscan verification (Get one here)
-
Deploy the
ProjectRegistrycontract
pnpm run deploy-project-registry goerliThe section here shows how to set up the program for the first time on a given network. Ideally these steps would be done once per chain. In this example, we would be deploying on goerli
- Create an
.envfile
cp ../.env.example ../.env-
Create an
.envfile and fill outINFURA_ID: Infura ID for deploying contractDEPLOYER_PRIVATE_KEY: address which deploys the contractETHERSCAN_API_KEY: API key for etherscan verification
-
Deploy the
ProgramFactorycontract
pnpm run deploy-program-factory goerli- Deploy the
ProgramImplementationcontract
pnpm run deploy-program-implementation goerli- Update
program.config.tswith deployed contracts based on your network
export const params: DeployParams = {
goerli: {
programImplementationContract: 'DEPLOYED_PROGRAM_IMPLEMENTATION_CONTRACT',
programFactoryContract: 'DEPLOYED_PROGRAM_FACTORY_CONTRACT',
...
},
};- Update
ProgramFactoryto reference theProgramImplementationcontract.
pnpm run link-program-implementation goerliThe section here shows how to set up voting strategy for the first time on a given network. Ideally these steps would be done once per chain. In this example, we would be deploying the QuadraticFundingVotingStrategyImplementation contract on goerli
-
Create an
.envfile and fill outINFURA_ID: Infura ID for deploying contractDEPLOYER_PRIVATE_KEY: address which deploys the contractETHERSCAN_API_KEY: API key for etherscan verification
-
Deploy the
QuadraticFundingVotingStrategyFactorycontract
pnpm run deploy-qf-factory goerli- Deploy the
QuadraticFundingVotingStrategyImplementationcontract
pnpm run deploy-qf-implementation goerli- Update
votingStrategy.config.tswith deployed contracts based on your network
export const QFVotingParams: DeployParams = {
"goerli": {
factory: 'DEPLOYED_QF_FACTORY_CONTRACT',
implementation: 'DEPLOYED_QF_IMPLEMENTATION_CONTRACT',
...
},
...
};- Update
QuadraticFundingVotingStrategyFactoryto reference theQuadraticFundingVotingStrategyImplementationcontract
pnpm run link-qf-implementation goerliThe section here shows how to deploy the payout strategy contract. Ideally these would be done before creating a round. In this example, we would be deploying the MerklePayoutStrategy contract on goerli. This would have to be done before creating a round so that round is aware and store a reference to the voting contract during its creation.
-
Create an
.envfile and fill outINFURA_ID: Infura ID for deploying contractDEPLOYER_PRIVATE_KEY: address which deploys the contractETHERSCAN_API_KEY: API key for etherscan verification
-
Deploy the
MerklePayoutStrategyFactorycontract
pnpm run deploy-merkle-factory goerli- Deploy the
MerklePayoutStrategyImplementationcontract
pnpm run deploy-merkle-implementation goerli- Update
payoutStrategy.config.tswith deployed contract based on your network
export const MerklePayoutParams: DeployParams = {
"goerli": {
factory: 'DEPLOYED_MERKLE_FACTORY_CONTRACT',
implementation: 'DEPLOYED_MERKLE_IMPLEMENTATION_CONTRACT',
...
},
...
};- Update
MerklePayoutStrategyFactoryto reference theMerklePayoutStrategyImplementationcontract
pnpm run link-merkle-implementation goerliThe section here shows how to deploy the payout strategy contract. Ideally these would be done before creating a round. In this example, we would be deploying the DirectPayoutStrategy contract on goerli. This would have to be done before creating a round so that round is aware and store a reference to the voting contract during its creation.
-
Create an
.envfile and fill outINFURA_ID: Infura ID for deploying contractDEPLOYER_PRIVATE_KEY: address which deploys the contractETHERSCAN_API_KEY: API key for etherscan verification
-
Deploy the
DirectPayoutStrategyFactorycontract
pnpm run deploy-direct-factory goerli- Deploy the
DirectPayoutStrategyImplementationcontract
pnpm run deploy-direct-implementation goerli- Update
payoutStrategy.config.tswith deployed contract based on your network
export const DirectPayoutParams: DeployParams = {
"goerli": {
factory: 'DEPLOYED_DIRECT_FACTORY_CONTRACT',
implementation: 'DEPLOYED_DIRECT_IMPLEMENTATION_CONTRACT',
...
},
...
};- Link the
DirectPayoutStrategyImplementationcontract to theDirectPayoutStrategyFactorycontract
pnpm run link-direct-implementation goerliThe section here shows how to set up the round manager for the first time on a given network. Ideally these steps would be done once per chain. In this example, we would be deploying on goerli
-
Create an
.envfile and fill outINFURA_ID: Infura ID for deploying contractDEPLOYER_PRIVATE_KEY: address which deploys the contractETHERSCAN_API_KEY: API key for etherscan verification on mainnet / testnetOPTIMISTIC_ETHERSCAN_API_KEY: API key for etherscan verification on optimism mainnet / testnet
-
Deploy the
RoundFactorycontract
pnpm run deploy-round-factory goerli- Deploy the
RoundImplementationcontract
pnpm run deploy-round-implementation goerli- Update
round.config.tswith deployed contracts based on your network
export const params: DeployParams = {
goerli: {
roundImplementationContract: 'DEPLOYED_ROUND_IMPLEMENTATION_CONTRACT',
roundFactoryContract: 'DEPLOYED_ROUND_FACTORY_CONTRACT',
...
},
...
};- Update
RoundFactoryto reference theRoundImplementationcontract
pnpm run link-round-implementation goerlipnpm hardhat clean
pnpm hardhat verify --network goerli <CONTRACT_ADDRESS>
# Program
pnpm run deploy-program-factory goerli
pnpm run deploy-program-implementation goerli
pnpm run link-program-implementation goerli
# QF
pnpm run deploy-qf-factory goerli
pnpm run deploy-qf-implementation goerli
pnpm run link-qf-implementation goerli
# Payout
pnpm run deploy-merkle-factory goerli
pnpm run deploy-merkle-implementation goerli
pnpm run link-merkle-implementation goerli
# direct grants
pnpm run deploy-direct-factory goerli
pnpm run deploy-direct-implementation goerli
pnpm run link-direct-implementation goerli
# AlloSettings
pnpm run deploy-allo-settings goerli
pnpm run set-protocol-fee goerli
# Round
pnpm run deploy-round-factory goerli
pnpm run deploy-round-implementation goerli
pnpm run link-round-implementation goerli
pnpm run link-allo-settings goerli
pnpm run deploy-dummy-voting-strategy goerli
# Project Registry
pnpm run deploy-project-registry goerli
# These scripts would be used to create a test round
pnpm run create-program goerli
pnpm run create-qf-contract goerli
pnpm run create-merkle-contract goerli
pnpm run create-round goerlinpx hardhat run ./scripts/deployZkSync.ts --network zksync-testnetyarn hardhat verify --network <network> <contract address> <constructor args>Check the status of the verification:
yarn hardhat verify-status --verification-id <your verification id>