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 |
base |
scroll |
scroll-sepolia |
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
.env
file
cp ../.env.example ../.env
-
Create an
.env
file 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
ProjectRegistry
contract
pnpm run deploy-project-registry goerli
The 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
.env
file
cp ../.env.example ../.env
-
Create an
.env
file 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
ProgramFactory
contract
pnpm run deploy-program-factory goerli
- Deploy the
ProgramImplementation
contract
pnpm run deploy-program-implementation goerli
- Update
program.config.ts
with deployed contracts based on your network
export const params: DeployParams = {
goerli: {
programImplementationContract: 'DEPLOYED_PROGRAM_IMPLEMENTATION_CONTRACT',
programFactoryContract: 'DEPLOYED_PROGRAM_FACTORY_CONTRACT',
...
},
};
- Update
ProgramFactory
to reference theProgramImplementation
contract.
pnpm run link-program-implementation goerli
The 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
.env
file 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
QuadraticFundingVotingStrategyFactory
contract
pnpm run deploy-qf-factory goerli
- Deploy the
QuadraticFundingVotingStrategyImplementation
contract
pnpm run deploy-qf-implementation goerli
- Update
votingStrategy.config.ts
with deployed contracts based on your network
export const QFVotingParams: DeployParams = {
"goerli": {
factory: 'DEPLOYED_QF_FACTORY_CONTRACT',
implementation: 'DEPLOYED_QF_IMPLEMENTATION_CONTRACT',
...
},
...
};
- Update
QuadraticFundingVotingStrategyFactory
to reference theQuadraticFundingVotingStrategyImplementation
contract
pnpm run link-qf-implementation goerli
The 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
.env
file 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
MerklePayoutStrategyFactory
contract
pnpm run deploy-merkle-factory goerli
- Deploy the
MerklePayoutStrategyImplementation
contract
pnpm run deploy-merkle-implementation goerli
- Update
payoutStrategy.config.ts
with deployed contract based on your network
export const MerklePayoutParams: DeployParams = {
"goerli": {
factory: 'DEPLOYED_MERKLE_FACTORY_CONTRACT',
implementation: 'DEPLOYED_MERKLE_IMPLEMENTATION_CONTRACT',
...
},
...
};
- Update
MerklePayoutStrategyFactory
to reference theMerklePayoutStrategyImplementation
contract
pnpm run link-merkle-implementation goerli
The 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
.env
file 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
DirectPayoutStrategyFactory
contract
pnpm run deploy-direct-factory goerli
- Deploy the
DirectPayoutStrategyImplementation
contract
pnpm run deploy-direct-implementation goerli
- Update
payoutStrategy.config.ts
with deployed contract based on your network
export const DirectPayoutParams: DeployParams = {
"goerli": {
factory: 'DEPLOYED_DIRECT_FACTORY_CONTRACT',
implementation: 'DEPLOYED_DIRECT_IMPLEMENTATION_CONTRACT',
...
},
...
};
- Link the
DirectPayoutStrategyImplementation
contract to theDirectPayoutStrategyFactory
contract
pnpm run link-direct-implementation goerli
The 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
.env
file 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
RoundFactory
contract
pnpm run deploy-round-factory goerli
- Deploy the
RoundImplementation
contract
pnpm run deploy-round-implementation goerli
- Update
round.config.ts
with deployed contracts based on your network
export const params: DeployParams = {
goerli: {
roundImplementationContract: 'DEPLOYED_ROUND_IMPLEMENTATION_CONTRACT',
roundFactoryContract: 'DEPLOYED_ROUND_FACTORY_CONTRACT',
...
},
...
};
- Update
RoundFactory
to reference theRoundImplementation
contract
pnpm run link-round-implementation goerli
pnpm 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 goerli
npx hardhat run ./scripts/deployZkSync.ts --network zksync-testnet
yarn hardhat verify --network <network> <contract address> <constructor args>
Check the status of the verification:
yarn hardhat verify-status --verification-id <your verification id>