Skip to content

Commit

Permalink
chore(contracts): deploy contracts to L2s, store addresses and benchm…
Browse files Browse the repository at this point in the history
…ark message batch size (#1751)
  • Loading branch information
ctrlc03 authored Aug 12, 2024
1 parent b91e6a0 commit 9e771a0
Show file tree
Hide file tree
Showing 7 changed files with 960 additions and 59 deletions.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
title: Supported Networks
description: Supported Networks
sidebar_label: Supported Networks
sidebar_position: 11
---

MACI has been tested on the following EVM networks:

- Optimism
- Optimism Sepolia
- Arbitrum
- Arbitrum Sepolia
- Base
- Base Sepolia

We recommend using either Optimism, Arbitrum or Base. Please open an issue/PR if you intend to use other EVM networks and would like to contribute to this record of deployed and verified contracts as well as benchmarks, that would be greatly appreciated.

## Limitations

For better UX, MACI clients should be sending votes (messages) in batches. Depending on the number of vote options available, larger batch might be sent. Below you can find the largest batch you can send for each network and how much gas it consumes:

| Network | Max Batch Size | Gas used | Price (based on Ether price at the time ~$2595) |
| ---------------- | -------------- | -------- | ----------------------------------------------- |
| Optimism | 89 | 28167603 | 0.000036061732019822 ETH ($0.09) |
| Optimism Sepolia | 89 | 28163331 | 0.005651520470449442 ETH ($10.46) |
| Arbitrum | 98 | 31017545 | 0.00031017545 ETH ($0.80) |
| Arbitrum Sepolia | 98 | 31115404 | 0.0031115404 ETH ($8.06) |
| Base | 89 | 28165467 | 0.000591851649982612 ETH ($1.54) |
| Base Sepolia | 89 | 28190232 | 0.002072926785842714 ETH ($0.000000) |

## Test yourself

To test MACI on a network, whether it's one of the ones listed above, or a new one, you can use the `benchmark` hardhat task:

1. Ensure you have copied `.env.example` to `.env` and set the correct values for the network you want to test on.
2. Configure your `deploy-config.json` - ensure `messageTreeDepth` is set to at least 3 (supporting 5 \*\* 3 votes)
3. Ensure you have copied the `default-deployed-contracts.json` to `deployed-contracts.json` to avoid deploying unnecessary contracts again.
4. Run the `benchmark` task: `pnpm benchmark:$NETWORK`
296 changes: 296 additions & 0 deletions packages/contracts/default-deployed-contracts.json
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,13 @@
"verify": {
"args": "[]"
}
},
"0x33Cc5e8b6f158B9ee3600EcD3f3DE76c6B7765a7": {
"id": "ZupassGatekeeper",
"deploymentTxHash": "0xe6954597b9079895f6facc122e2a0bd9af00bc0401bf6f61d9d7824aed534754",
"verify": {
"args": "[\"280209352117126055869169359893920931853\",\"13908133709081944902758389525983124100292637002438232157513257158004852609027\",\"7654374482676219729919246464135900991450848628968334062174564799457623790084\",\"0xd81aB9859e1d423aC51170256BedD0Aa00e4eD5A\"]"
}
}
},
"named": {
Expand Down Expand Up @@ -518,6 +525,10 @@
"VkRegistry": {
"address": "0x3D4C58074DCD8E6526885F465ab5F311b6B290B5",
"count": 1
},
"ZupassGatekeeper": {
"address": "0x33Cc5e8b6f158B9ee3600EcD3f3DE76c6B7765a7",
"count": 1
}
}
},
Expand Down Expand Up @@ -601,6 +612,161 @@
}
}
},
"named": {
"ConstantInitialVoiceCreditProxy": {
"address": "0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856",
"count": 1
},
"FreeForAllGatekeeper": {
"address": "0x8BA83Dd6E0E448417C519A38c90Ee570A4CA3e9f",
"count": 1
},
"Verifier": {
"address": "0x2427Ab201488Ac81Bec421F179B1Be23c55ebC27",
"count": 1
},
"PoseidonT3": {
"address": "0x2F1398ab5E322d357dF8CdD2e7ba73122c5FDDA4",
"count": 1
},
"PoseidonT4": {
"address": "0x8778dA47eF619f56341fE95514e95fa0FF3B77C6",
"count": 1
},
"PoseidonT5": {
"address": "0xB8Bc2c7cF71441fF7E6F111D3457e3d61c564968",
"count": 1
},
"PoseidonT6": {
"address": "0x37282fEde56aa1d7266Ecb12DC3b342D12044e2E",
"count": 1
},
"PollFactory": {
"address": "0x2F1A5B4F8F3B7348C66A1522622b1DB712261607",
"count": 1
},
"MessageProcessorFactory": {
"address": "0xE4c9d4248F1371C5C61d406A9859f9FE667567a5",
"count": 1
},
"TallyFactory": {
"address": "0x57034389Dbe3DE1D1C14763f55B77A2279D6d43C",
"count": 1
},
"VkRegistry": {
"address": "0x6aA5baD99aC44bB008930c68CE2249549Cf10944",
"count": 1
},
"MACI": {
"address": "0xe98D62574B1b780b8C13B1917700001dc5FEc68a",
"count": 1
},
"Poll": {
"poll-0": {
"address": "0xcc82063FAA821060AF76DDb7f4205AE370624d6b",
"count": 1
}
},
"MessageProcessor": {
"poll-0": {
"address": "0xaA2eAf2389B41Fd5B292C872352CbaC18BaD3bfD",
"count": 1
}
},
"Tally": {
"poll-0": {
"address": "0x989194c53be04Bd90BcbF2142e7050d011dCF048",
"count": 1
}
},
"AccQueueQuinaryMaci": {
"poll-0": {
"address": "0x688b36aa55B94Ff843C819ddd2fEE0e21c2Dc4e7",
"count": 1
}
}
}
},
"arbitrum": {
"instance": {
"0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856": {
"id": "ConstantInitialVoiceCreditProxy",
"deploymentTxHash": "0x72ef6fcc655bcd8bbc1d545b2a51ab44ce5291bb4fa548259c42de1325145952",
"verify": {
"args": "[\"200\"]"
}
},
"0x8BA83Dd6E0E448417C519A38c90Ee570A4CA3e9f": {
"id": "FreeForAllGatekeeper",
"deploymentTxHash": "0x9c0775b0288898a94f27865d46e5bd8872492b5df65cd177b150806aab7560a7",
"verify": {
"args": "[]"
}
},
"0x2427Ab201488Ac81Bec421F179B1Be23c55ebC27": {
"id": "Verifier",
"deploymentTxHash": "0x4a1a77469dff336b80ed4ef8e7482b3a77b9e1c76e92e9bb0c3f3f3229b2ee4c",
"verify": {
"args": "[]"
}
},
"0x2F1398ab5E322d357dF8CdD2e7ba73122c5FDDA4": {
"id": "PoseidonT3",
"deploymentTxHash": "0x1479f77d3c9ccb71d3050097f9caa7c24632814282e1a530d8eefe7e34ab2949",
"verify": {
"args": "[]"
}
},
"0x8778dA47eF619f56341fE95514e95fa0FF3B77C6": {
"id": "PoseidonT4",
"deploymentTxHash": "0x3d203b3236acec539b1da934f43184924aef0cba84f375febe0919921fbea803",
"verify": {
"args": "[]"
}
},
"0xB8Bc2c7cF71441fF7E6F111D3457e3d61c564968": {
"id": "PoseidonT5",
"deploymentTxHash": "0x7a4c8f1809958494685511cf25a70d4e2906bd074843b56ccf5ce5fd96e6f2f9",
"verify": {
"args": "[]"
}
},
"0x37282fEde56aa1d7266Ecb12DC3b342D12044e2E": {
"id": "PoseidonT6",
"deploymentTxHash": "0x75853fcc0e430fdd3c4a7971d4e555161affdf93a7f5a4eaaa93c83c4c1ce94f",
"verify": {
"args": "[]"
}
},
"0x2F1A5B4F8F3B7348C66A1522622b1DB712261607": {
"id": "PollFactory",
"deploymentTxHash": "0x8315c48647621fa0cee54314ea49bcc851223eabd1f7dc9f3efcf307924ebd69",
"verify": {
"args": "[]"
}
},
"0xE4c9d4248F1371C5C61d406A9859f9FE667567a5": {
"id": "MessageProcessorFactory",
"deploymentTxHash": "0x1a30587862f43b3f2cb764cc18e4fbd09a55880bc059471998793ff4e92b6469",
"verify": {
"args": "[]"
}
},
"0x57034389Dbe3DE1D1C14763f55B77A2279D6d43C": {
"id": "TallyFactory",
"deploymentTxHash": "0x960ed63cbea915e39b7dec78d22e83f3d2c710b902262217f2444202356d0880",
"verify": {
"args": "[]"
}
},
"0x6aA5baD99aC44bB008930c68CE2249549Cf10944": {
"id": "VkRegistry",
"deploymentTxHash": "0xfeaaff43b313214986c4d1f3d3b610f5715be2c17bc10849e3cae776a505bd09",
"verify": {
"args": "[]"
}
}
},
"named": {
"ConstantInitialVoiceCreditProxy": {
"address": "0x16FC13edD59D4b9F788Fb11A70eA022E1Bb1B856",
Expand Down Expand Up @@ -647,5 +813,135 @@
"count": 1
}
}
},
"optimism": {
"instance": {
"0x83dD551541C580e338206f1f677835D427C92dE2": {
"id": "ConstantInitialVoiceCreditProxy",
"deploymentTxHash": "0x44b638a8e359b5014ed77492755ade1d59cf6f5f72f39110c325e7fa463dad6a",
"verify": {
"args": "[\"200\"]"
}
},
"0xD5C41106db85EDd0298279AcFCE5A722060cc5f9": {
"id": "FreeForAllGatekeeper",
"deploymentTxHash": "0x69c745b040908eb98e63065b1f5635d7d5176d0e331d37321c564ed1b6658a5c",
"verify": {
"args": "[]"
}
},
"0x88C2c6A7535463962A34757FE63cc4F296381aba": {
"id": "Verifier",
"deploymentTxHash": "0x7f25d693564a17029b9bdfc0850a4c8ea30797e2096961558c5e05df4aa8175d",
"verify": {
"args": "[]"
}
},
"0xF8E637e5c9EC3A8d8fa8843A6dF833348E1F1E66": {
"id": "PoseidonT3",
"deploymentTxHash": "0x25e4abb71a79528f8c76bcb83a1163597c80177091667ccb2fd2eb57af84b254",
"verify": {
"args": "[]"
}
},
"0x0a0D66baFDa8c8838281084d9C3d68Dd9a6Fc274": {
"id": "PoseidonT4",
"deploymentTxHash": "0xff394431d7f8985936fc81009a461aa176b4e97a540b031771387e2b3a058ef5",
"verify": {
"args": "[]"
}
},
"0xD2F6c828606Ad8e985008Cd825012f269B50CD58": {
"id": "PoseidonT5",
"deploymentTxHash": "0x64b18ed067fcd5aa9061255cace422992b0c02207d09a4f78e7182143bb05d88",
"verify": {
"args": "[]"
}
},
"0x982530673Ce9e5Efa02438c694d48327Aa4fB592": {
"id": "PoseidonT6",
"deploymentTxHash": "0xbb20d4bdc02536ae1435cfcd4b07914161f028063d8cbf66cb8f79b2e2097929",
"verify": {
"args": "[]"
}
},
"0x50045B05cb1C76410783D8A3e5625a99d5729339": {
"id": "PollFactory",
"deploymentTxHash": "0x65d63100f9eeea80513d6f8513af97e51dca6caf138488eb849f5ae600d2b5b1",
"verify": {
"args": "[]"
}
},
"0xbB28555E989799478442483CD1f2D370a14e2C42": {
"id": "MessageProcessorFactory",
"deploymentTxHash": "0x74384358e8fba869c0d4be06e562a93d5020a0685ab428dbbab94068af5a6d4d",
"verify": {
"args": "[]"
}
},
"0xdA10b22B81eb8EA6BC04aa9b86d3f9d969CD49F0": {
"id": "TallyFactory",
"deploymentTxHash": "0x918e20d6b1c39d921efec9bf8ebcf46ff20449750633350b8a0b9281bb621cd2",
"verify": {
"args": "[]"
}
},
"0x7E16271EaE58F52a0431F87Ee7E40c978178C63F": {
"id": "VkRegistry",
"deploymentTxHash": "0x197b6b3cc28fda77c36a2b14d44c24f5b8aeff4d009939d200166476656ac521",
"verify": {
"args": "[]"
}
}
},
"named": {
"ConstantInitialVoiceCreditProxy": {
"address": "0x83dD551541C580e338206f1f677835D427C92dE2",
"count": 1
},
"FreeForAllGatekeeper": {
"address": "0xD5C41106db85EDd0298279AcFCE5A722060cc5f9",
"count": 1
},
"Verifier": {
"address": "0x88C2c6A7535463962A34757FE63cc4F296381aba",
"count": 1
},
"PoseidonT3": {
"address": "0xF8E637e5c9EC3A8d8fa8843A6dF833348E1F1E66",
"count": 1
},
"PoseidonT4": {
"address": "0x0a0D66baFDa8c8838281084d9C3d68Dd9a6Fc274",
"count": 1
},
"PoseidonT5": {
"address": "0xD2F6c828606Ad8e985008Cd825012f269B50CD58",
"count": 1
},
"PoseidonT6": {
"address": "0x982530673Ce9e5Efa02438c694d48327Aa4fB592",
"count": 1
},
"PollFactory": {
"address": "0x50045B05cb1C76410783D8A3e5625a99d5729339",
"count": 1
},
"MessageProcessorFactory": {
"address": "0xbB28555E989799478442483CD1f2D370a14e2C42",
"count": 1
},
"TallyFactory": {
"address": "0xdA10b22B81eb8EA6BC04aa9b86d3f9d969CD49F0",
"count": 1
},
"VkRegistry": {
"address": "0x7E16271EaE58F52a0431F87Ee7E40c978178C63F",
"count": 1
}
},
"verified": {
"0x83dD551541C580e338206f1f677835D427C92dE2": true
}
}
}
1 change: 1 addition & 0 deletions packages/contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import type { HardhatUserConfig } from "hardhat/config";
// Don't forget to import new tasks here
import "./tasks/deploy";
import { EChainId, ESupportedChains, getEtherscanApiKeys, getNetworkRpcUrls } from "./tasks/helpers/constants";
import "./tasks/runner/benchmarks";
import "./tasks/runner/deployFull";
import "./tasks/runner/deployPoll";
import "./tasks/runner/merge";
Expand Down
12 changes: 11 additions & 1 deletion packages/contracts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@
"verify": "hardhat verify-full",
"merge": "hardhat merge",
"prove": "hardhat prove",
"benchmark": "hardhat benchmark",
"deploy:localhost": "pnpm run deploy",
"deploy:sepolia": "pnpm run deploy --network sepolia",
"deploy:optimism-sepolia": "pnpm run deploy --network optimism_sepolia",
Expand Down Expand Up @@ -107,7 +108,16 @@
"verify:arbitrum": "pnpm run verify --network arbitrum",
"verify:arbitrum-sepolia": "pnpm run verify --network arbitrum_sepolia",
"verify:base": "pnpm run verify --network base",
"verify:base-sepolia": "pnpm run verify --network base_sepolia"
"verify:base-sepolia": "pnpm run verify --network base_sepolia",
"benchmark:sepolia": "hardhat benchmark --network sepolia",
"benchmark:optimism-sepolia": "hardhat benchmark --network optimism_sepolia",
"benchmark:optimism": "pnpm run benchmark --network optimism",
"benchmark:scroll": "pnpm run benchmark --network scroll",
"benchmark:scroll-sepolia": "pnpm run benchmark --network scroll_sepolia",
"benchmark:arbitrum": "pnpm run benchmark --network arbitrum",
"benchmark:arbitrum-sepolia": "pnpm run benchmark --network arbitrum_sepolia",
"benchmark:base": "pnpm run benchmark --network base",
"benchmark:base-sepolia": "pnpm run benchmark --network base_sepolia"
},
"dependencies": {
"@nomicfoundation/hardhat-ethers": "^3.0.6",
Expand Down
Loading

0 comments on commit 9e771a0

Please sign in to comment.