Skip to content

Commit

Permalink
deploy to mumbai & polygon (#95)
Browse files Browse the repository at this point in the history
* chore: deploy to mumbai

* chore: polygon deploy/I got tx stuck with low gas

* chore: deploy polygon mainnet
  • Loading branch information
codenamejason authored Sep 6, 2023
1 parent 515b7ed commit e989b1c
Show file tree
Hide file tree
Showing 12 changed files with 1,400 additions and 35 deletions.
567 changes: 567 additions & 0 deletions .openzeppelin/polygon-mumbai.json

Large diffs are not rendered by default.

656 changes: 656 additions & 0 deletions .openzeppelin/polygon.json

Large diffs are not rendered by default.

40 changes: 40 additions & 0 deletions docs/CHAINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,46 @@ These are contracts that are created/deployed once for goerli
| ProjectRegistry | 0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27 |
| DummyVotingStrategy | 0x5ab68dCdcA37A1C2b09c5218e28eB0d9cc3FEb03 |

## Polygon PoS Mainnet

These are contracts that are created/deployed once for polygon

| Contract | Address |
|---------------------------------------|--------------------------------------------|
| ProgramFactory | 0xF7c101A95Ea4cBD5DA0Ab9827D7B2C9857440143 |
| ProgramImplementation | 0x04b194b14532070F5cc8D3A760c9a0957D85ad5B |
| QuadraticFundingVotingStrategyFactory | 0xc1a26b0789C3E93b07713e90596Cad8d0442C826 |
| QFVotingStrategyImplementation | 0x74c3665540FC8B92Dd06a7e56a51eCa038C18180 |
| MerklePayoutStrategyFactory | 0xD0e19DBF9b896199F35Df255A1bf8dB3C787531c |
| MerklePayouStrategyImplementation | 0x7ac74Be34b1A27E48a2525259719F877a57B2Aa4 |
| DirectPayoutStrategyFactory | 0xF2a07728107B04266015E67b1468cA0a536956C8 |
| DirectPayoutStrategyImplementation | 0xc7722909fEBf7880E15e67d563E2736D9Bb9c1Ab |
| AlloSettings | 0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC |
| RoundFactory | 0x5ab68dCdcA37A1C2b09c5218e28eB0d9cc3FEb03 |
| RoundImplementation | 0xcE7c30DbcEC2a98B516E4C64fA4E3256AB813b10 |
| ProjectRegistry | 0x5C5E2D94b107C7691B08E43169fDe76EAAB6D48b |
| DummyVotingStrategy | 0x8142cAa6dED9F63434B1ED862d53E06332874570 |

## Polygon PoS Mumbai

These are contracts that are created/deployed once for mumbai

| Contract | Address |
|---------------------------------------|--------------------------------------------|
| ProgramFactory | 0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e |
| ProgramImplementation | 0x424C5C175fbd46CA0b27866044A5B956c6AbEe0D |
| QuadraticFundingVotingStrategyFactory | 0xF7c101A95Ea4cBD5DA0Ab9827D7B2C9857440143 |
| QFVotingStrategyImplementation | 0x04b194b14532070F5cc8D3A760c9a0957D85ad5B |
| MerklePayoutStrategyFactory | 0xc1a26b0789C3E93b07713e90596Cad8d0442C826 |
| MerklePayouStrategyImplementation | 0x74c3665540FC8B92Dd06a7e56a51eCa038C18180 |
| DirectPayoutStrategyFactory | 0xD9B7Ce1F68A93dF783A8519ed52b74f5DcF5AFE1 |
| DirectPayoutStrategyImplementation | 0xD0e19DBF9b896199F35Df255A1bf8dB3C787531c |
| AlloSettings | 0xF2a07728107B04266015E67b1468cA0a536956C8 |
| RoundFactory | 0xE1c5812e9831bc1d5BDcF50AAEc1a47C4508F3fA |
| RoundImplementation | 0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC |
| ProjectRegistry | 0x545B282A50EaeA01A619914d44105437036CbB36 |
| DummyVotingStrategy | 0xA78Daa89fE9C1eC66c5cB1c5833bC8C6Cb307918 |

## Goerli Network

These are contracts that are created/deployed once for goerli
Expand Down
4 changes: 2 additions & 2 deletions docs/DEPLOY_STEPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ All the deploy scripts will expect network param to know which network the contr
| `mainnet` |
| `fuji-testnet` |
| `avalanche-mainnet`|
| `mumbai` |
| `polygon` |
| `zksync-mainnet` |
| `zksync-testnet` |

Expand Down Expand Up @@ -257,13 +259,11 @@ 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
Expand Down
56 changes: 43 additions & 13 deletions hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ const chainIds = {
goerli: 5,
"optimism-goerli": 420,
"fantom-testnet": 4002,
sepolia: 11155111,
"pgn-sepolia": 58008,
"arbitrum-goerli": 421613,
"fuji-testnet": 43113,
polygon: 137,

// mainnet
mainnet: 1,
Expand All @@ -34,6 +34,7 @@ const chainIds = {
"fantom-mainnet": 250,
"arbitrumOne-mainnet": 42161,
"avalanche-mainnet": 43114,
mumbai: 80001,
};

// This is a sample Hardhat task. To learn how to create your own go to
Expand All @@ -54,6 +55,7 @@ if (!deployPrivateKey) {
}

const infuraIdKey = process.env.INFURA_ID as string;
const alchemyKey = process.env.ALCHEMY_API_KEY as string;

/**
* Generates hardhat network configuration the test networks.
Expand Down Expand Up @@ -140,21 +142,26 @@ const config: HardhatUserConfig = {
"fantom-mainnet",
"https://rpc.ftm.tools"
),
"arbitrumOne": {
arbitrumOne: {
accounts: [deployPrivateKey],
url: 'https://arb1.arbitrum.io/rpc',
url: "https://arb1.arbitrum.io/rpc",
chainId: chainIds["arbitrumOne-mainnet"],
},
"avalanche-mainnet": {
accounts: [deployPrivateKey],
url: 'https://api.avax.network/ext/bc/C/rpc',
url: "https://api.avax.network/ext/bc/C/rpc",
chainId: chainIds["avalanche-mainnet"],
gasPrice: 25000000000,
},
polygon: {
accounts: [deployPrivateKey],
url: `https://polygon-mainnet.g.alchemy.com/v2/${alchemyKey}`,
chainId: chainIds["polygon"],
gas: "auto",
},

// Test Networks
goerli: createTestnetConfig("goerli"),
sepolia: createTestnetConfig("sepolia"),
"optimism-goerli": {
accounts: [deployPrivateKey],
chainId: chainIds["optimism-goerli"],
Expand All @@ -173,23 +180,28 @@ const config: HardhatUserConfig = {
},
arbitrumGoerli: {
accounts: [deployPrivateKey],
url: 'https://goerli-rollup.arbitrum.io/rpc',
url: "https://goerli-rollup.arbitrum.io/rpc",
chainId: chainIds["arbitrum-goerli"],
},
"fuji-testnet": {
accounts: [deployPrivateKey],
url: 'https://avalanche-fuji-c-chain.publicnode.com',
url: "https://avalanche-fuji-c-chain.publicnode.com",
chainId: chainIds["fuji-testnet"],
gasPrice: 25000000000,
},
mumbai: {
accounts: [deployPrivateKey],
url: `https://polygon-mumbai.g.alchemy.com/v2/${alchemyKey}`,
chainId: chainIds["mumbai"],
},

localhost: createTestnetConfig("localhost", "http://localhost:8545"),
hardhat: {
forking: {
url: `https://goerli.infura.io/v3/${infuraIdKey}`,
blockNumber: 9188740 // A recent block where both AllowanceModule an Safe factory exist
}
}
blockNumber: 9188740, // A recent block where both AllowanceModule an Safe factory exist
},
},
},
gasReporter: {
coinmarketcap: process.env.COINMARKETCAP_API_KEY,
Expand All @@ -202,8 +214,6 @@ const config: HardhatUserConfig = {
// @ts-ignore
mainnet: process.env.ETHERSCAN_API_KEY,
// @ts-ignore
sepolia: process.env.ETHERSCAN_API_KEY,
// @ts-ignore
goerli: process.env.ETHERSCAN_API_KEY,
// @ts-ignore
optimisticEthereum: process.env.OPTIMISTIC_ETHERSCAN_API_KEY,
Expand All @@ -225,6 +235,10 @@ const config: HardhatUserConfig = {
"avalanche-mainnet": process.env.AVALANCHE_API_KEY,
// @ts-ignore
"fuji-testnet": process.env.AVALANCHE_API_KEY,
// @ts-ignore
polygon: process.env.POLYGONSCAN_API_KEY,
// @ts-ignore
mumbai: process.env.POLYGONSCAN_API_KEY,
},
customChains: [
{
Expand All @@ -248,7 +262,7 @@ const config: HardhatUserConfig = {
chainId: chainIds["fuji-testnet"],
urls: {
apiURL: "https://api-testnet.snowtrace.io/api",
browserURL: "https://testnet.snowtrace.io/"
browserURL: "https://testnet.snowtrace.io/",
},
},
{
Expand All @@ -259,6 +273,22 @@ const config: HardhatUserConfig = {
browserURL: "https://snowtrace.io/",
},
},
{
network: "mumbai",
chainId: chainIds["mumbai"],
urls: {
apiURL: "https://api-testnet.polygonscan.com/api",
browserURL: "https://mumbai.polygonscan.com/",
},
},
{
network: "polygon",
chainId: chainIds["polygon"],
urls: {
apiURL: "https://api.polygonscan.com/api",
browserURL: "https://polygonscan.com/",
},
},
],
},
abiExporter: abiExporter,
Expand Down
12 changes: 11 additions & 1 deletion scripts/config/allo.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,17 @@ export const AlloSettingsParams: DeployParams = {
"fuji-testnet": {
alloSettingsContract: "0xdf25423c9ec15347197Aa5D3a41c2ebE27587D59",
newProtocolFeePercentage: 0,
newProtocolTreasury: "0xB8cEF765721A6da910f14Be93e7684e9a3714123",
newProtocolTreasury: "0xB8cEF765721A6da910f14Be93e7684e9a3714123"
},
"mumbai": {
alloSettingsContract: "0xF2a07728107B04266015E67b1468cA0a536956C8",
newProtocolFeePercentage: 0,
newProtocolTreasury: "0x1fd06f088c720ba3b7a3634a8f021fdd485dca42",
},
"polygon": {
alloSettingsContract: "0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC",
newProtocolFeePercentage: 0,
newProtocolTreasury: "0xbF91bfa8c0Bcd130cDf0a7d9C01A4Db4842B1532",
},
"zksync-testnet": {
alloSettingsContract: "0x0FD600678475C03f28baE59A2d55f7a911383e2B",
Expand Down
30 changes: 25 additions & 5 deletions scripts/config/payoutStrategy.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,26 @@ export const MerklePayoutParams: DeployParams = {
implementation: "0xCF50D794c639D57bA8D6BB8FaE34fBd1B89D7112",
contract: "",
},
"mumbai": {
factory: "0xc1a26b0789C3E93b07713e90596Cad8d0442C826",
implementation: "0x74c3665540FC8B92Dd06a7e56a51eCa038C18180",
contract: "",
},
polygon: {
factory: "0xD0e19DBF9b896199F35Df255A1bf8dB3C787531c",
implementation: "0x7ac74Be34b1A27E48a2525259719F877a57B2Aa4",
contract: "",
},
"zksync-testnet": {
factory: "0x898126eA2A581b94a7C08F828DF68B54e2063B7c",
implementation: "0x1D51B2796cF001239d9F0BFcE2b3C4EC1a0Be18F",
contract: "",
},
"zksync-mainnet": {
factory: "",
implementation: "",
contract: "",
},
};

// TODO: Update this file any time a new dummy voting contract has been deployed
Expand All @@ -87,11 +102,6 @@ export const DirectPayoutParams: DeployParams = {
implementation: "0xC3A195EEa198e74D67671732E1B8F8A23781D735",
contract: "",
},
sepolia: {
factory: "",
implementation: "",
contract: "",
},
"optimism-mainnet": {
factory: "0x2Bb670C3ffC763b691062d671b386E51Cf1840f0",
implementation: "0x534d2AAc03dCd0Cb3905B591BAf04C14A95426AB",
Expand Down Expand Up @@ -127,6 +137,16 @@ export const DirectPayoutParams: DeployParams = {
implementation: "0x64ab6F2E11dF8B3Be5c8838eDe3951AC928daE9C",
contract: "",
},
"mumbai": {
factory: "0xD9B7Ce1F68A93dF783A8519ed52b74f5DcF5AFE1",
implementation: "0xD0e19DBF9b896199F35Df255A1bf8dB3C787531c",
contract: "",
},
polygon: {
factory: "0xF2a07728107B04266015E67b1468cA0a536956C8",
implementation: "0xc7722909fEBf7880E15e67d563E2736D9Bb9c1Ab",
contract: "",
},
"zksync-testnet": {
factory: "0x5e3E56F81588220bC0b3827C49A9e9Babb3D8228",
implementation: "0x4Fc8AF1AE0197acB87BB6376d16666C4946E9030",
Expand Down
10 changes: 10 additions & 0 deletions scripts/config/program.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,16 @@ export const programParams: DeployParams = {
"fuji-testnet": {
programFactoryContract: "0x862D7F621409cF572f179367DdF1B7144AcE1c76",
programImplementationContract: "0x56296242CA408bA36393f3981879fF9692F193cC",
programContract: ""
},
"mumbai": {
programFactoryContract: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e",
programImplementationContract: "0x424C5C175fbd46CA0b27866044A5B956c6AbEe0D",
programContract: ""
},
polygon: {
programFactoryContract: "0xF7c101A95Ea4cBD5DA0Ab9827D7B2C9857440143",
programImplementationContract: "0x04b194b14532070F5cc8D3A760c9a0957D85ad5B",
programContract: "",
},
"zksync-testnet": {
Expand Down
24 changes: 15 additions & 9 deletions scripts/config/projectRegistry.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,40 @@ type DeployParams = Record<string, ProjectRegistryParams>;

export const projectRegistryParams: DeployParams = {
mainnet: {
proxyContractAddress: "",
proxyContractAddress: ""
},
goerli: {
proxyContractAddress: "0x9C789Ad2457A605a0ea1aaBEEf16585633530069",
proxyContractAddress: "0x9C789Ad2457A605a0ea1aaBEEf16585633530069"
},
"optimism-mainnet": {
proxyContractAddress: "",
},
"fantom-mainnet": {
proxyContractAddress: "0xAdcB64860902A29c3e408586C782A2221d595B55",
proxyContractAddress: "0xAdcB64860902A29c3e408586C782A2221d595B55"
},
"fantom-testnet": {
proxyContractAddress: "0x5e5b7D871efDE8224390a334045e1dcb7daAf4E2",
proxyContractAddress: "0x5e5b7D871efDE8224390a334045e1dcb7daAf4E2"
},
"pgn-mainnet": {
proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e",
proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e"
},
arbitrumGoerli: {
proxyContractAddress: "0x0CD135777dEaB6D0Bb150bDB0592aC9Baa4d0871",
proxyContractAddress: "0x0CD135777dEaB6D0Bb150bDB0592aC9Baa4d0871"
},
arbitrumOne: {
proxyContractAddress: "0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27",
proxyContractAddress: "0x73AB205af1476Dc22104A6B8b3d4c273B58C6E27"
},
"fuji-testnet": {
proxyContractAddress: "0x8918401DD47f1645fF1111D8E513c0404b84d5bB",
proxyContractAddress: "0x8918401DD47f1645fF1111D8E513c0404b84d5bB"
},
"avalanche-mainnet": {
proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e",
proxyContractAddress: "0xDF9BF58Aa1A1B73F0e214d79C652a7dd37a6074e"
},
mumbai: {
proxyContractAddress: "0x545B282A50EaeA01A619914d44105437036CbB36",
},
polygon: {
proxyContractAddress: "0x5C5E2D94b107C7691B08E43169fDe76EAAB6D48b",
},
"zksync-testnet": {
proxyContractAddress: "0x2C17D0FAb47bD87333714dC35f84BB669951cea6",
Expand Down
10 changes: 10 additions & 0 deletions scripts/config/round.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,16 @@ export const roundParams: DeployParams = {
roundImplementationContract: "0x292285C40E966520D5Fd8e4Ab91583C70bBa3dc0",
roundContract: "",
},
"mumbai": {
roundFactoryContract: "0xE1c5812e9831bc1d5BDcF50AAEc1a47C4508F3fA",
roundImplementationContract: "0x359c9fD5ef57D4eDD6C8b42a351e12352DB0DaBC",
roundContract: "",
},
polygon: {
roundFactoryContract: "0x5ab68dCdcA37A1C2b09c5218e28eB0d9cc3FEb03",
roundImplementationContract: "0xcE7c30DbcEC2a98B516E4C64fA4E3256AB813b10",
roundContract: "",
},
"zksync-testnet": {
roundFactoryContract: "0x35E5f2abfaCdbe1bc7C2E09Fbe2e051Ea574Dd3b",
roundImplementationContract: "0xcB0f55a192f0d504490eA5d14eaeE0600F956bb5",
Expand Down
Loading

0 comments on commit e989b1c

Please sign in to comment.