Skip to content

Commit

Permalink
Merge pull request #297 from gnosisguild/zkevm
Browse files Browse the repository at this point in the history
add support for zkevm
  • Loading branch information
jfschwarz authored Oct 28, 2024
2 parents a71a487 + a9c57e2 commit b8f6190
Show file tree
Hide file tree
Showing 16 changed files with 127 additions and 448 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Address: `0x9646fDAD06d3e24444381f44362a3B0eB343D337`
- [Optimism](https://optimistic.etherscan.io/address/0x9646fDAD06d3e24444381f44362a3B0eB343D337#code)
- [Gnosis](https://gnosisscan.io/address/0x9646fDAD06d3e24444381f44362a3B0eB343D337#code)
- [Polygon](https://www.polygonscan.com/address/0x9646fDAD06d3e24444381f44362a3B0eB343D337#code)
- [Polygon zkEVM](https://zkevm.polygonscan.com/address/0x9646fDAD06d3e24444381f44362a3B0eB343D337#code)
- [Arbitrum One](https://arbiscan.io/address/0x9646fDAD06d3e24444381f44362a3B0eB343D337#code)
- [Avalanche C-Chain](https://snowtrace.io/address/0x9646fDAD06d3e24444381f44362a3B0eB343D337/contract/43114/code)
- [Base](https://basescan.org/address/0x9646fDAD06d3e24444381f44362a3B0eB343D337#code)
Expand All @@ -59,6 +60,7 @@ Address: `0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0`
- [Optimism](https://optimistic.etherscan.io/address/0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0#code)
- [Gnosis](https://gnosisscan.io/address/0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0#code)
- [Polygon](https://www.polygonscan.com/address/0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0#code)
- [Polygon zkEVM](https://zkevm.polygonscan.com/address/0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0#code)
- [Arbitrum One](https://arbiscan.io/address/0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0#code)
- [Avalanche C-Chain](https://snowtrace.io/address/0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0/contract/43114/code)
- [Base](https://basescan.org/address/0x93B7fCbc63ED8a3a24B59e1C3e6649D50B7427c0#code)
Expand All @@ -72,6 +74,7 @@ Address: `0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1`
- [Optimism](https://optimistic.etherscan.io/address/0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1#code)
- [Gnosis](https://gnosisscan.io/address/0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1#code)
- [Polygon](https://www.polygonscan.com/address/0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1#code)
- [Polygon zkEVM](https://zkevm.polygonscan.com/address/0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1#code)
- [Arbitrum One](https://arbiscan.io/address/0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1#code)
- [Avalanche C-Chain](https://snowtrace.io/address/0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1/contract/43114/code)
- [Base](https://basescan.org/address/0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1#code)
Expand All @@ -83,6 +86,7 @@ Address: `0x91B1bd7BCC5E623d5CE76b0152253499a9C819d1`
- [Optimism](https://api.studio.thegraph.com/query/23167/zodiac-roles-optimism/v2.2.3)
- [Gnosis](https://api.studio.thegraph.com/query/23167/zodiac-roles-gnosis/v2.2.3)
- [Polygon](https://api.studio.thegraph.com/query/23167/zodiac-roles-polygon/v2.2.3)
- [Polygon zkEVM](https://api.studio.thegraph.com/query/23167/zodiac-roles-zkevm/v2.2.3)
- [Arbitrum One](https://api.studio.thegraph.com/query/23167/zodiac-roles-arbitrum-one/v2.2.3)
- [Avalanche C-Chain](https://api.studio.thegraph.com/query/23167/zodiac-roles-avalanche/v2.2.3)
- [Base](https://api.studio.thegraph.com/query/23167/zodiac-roles-base/v2.2.3)
Expand Down
15 changes: 7 additions & 8 deletions packages/app/app/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import {
avalanche,
arbitrum,
base,
// bsc,
polygon,
polygonZkEvm,
gnosis,
} from "wagmi/chains"

Expand Down Expand Up @@ -35,6 +35,12 @@ export const CHAINS = {
blockExplorerAbiUrl: "https://api.polygonscan.com/api",
blockExplorerApiKey: "NM937M1IZXVQ6QVDXS73XMF8JSAB677JWQ",
},
[polygonZkEvm.id]: {
...polygonZkEvm,
prefix: "zkevm",
blockExplorerAbiUrl: "https://api.polygonscan.com/api",
blockExplorerApiKey: "NM937M1IZXVQ6QVDXS73XMF8JSAB677JWQ",
},
[avalanche.id]: {
...avalanche,
prefix: "avax",
Expand All @@ -53,13 +59,6 @@ export const CHAINS = {
blockExplorerAbiUrl: "https://api.basescan.org/api",
blockExplorerApiKey: "KCC7EQHE17IAQZA9TICUS6BQTJGZUDRNIY",
},
// [bsc.id]: {
// ...bsc,
// prefix: "bnb",
// blockExplorerAbiUrl: "https://api.bscscan.com/api",
// blockExplorerApiKey: "AMXEAU3N9P7RJHFSZ7KAJDRY5MFJ1N29D6",
// },

[sepolia.id]: {
...sepolia,
prefix: "sep",
Expand Down
2 changes: 1 addition & 1 deletion packages/app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@
"installConfig": {
"hoistingLimits": "workspaces"
}
}
}
2 changes: 1 addition & 1 deletion packages/deployments/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zodiac-roles-deployments",
"version": "2.2.5",
"version": "2.2.6",
"license": "LGPL-3.0+",
"main": "build/cjs/index.js",
"module": "build/esm/index.js",
Expand Down
6 changes: 6 additions & 0 deletions packages/deployments/src/chains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ export const chains = {
subgraph:
"https://api.studio.thegraph.com/query/23167/zodiac-roles-polygon/v2.2.3",
},
[1101]: {
name: "zkevm",
prefix: "zkevm",
subgraph:
"https://api.studio.thegraph.com/query/23167/zodiac-roles-zkevm/v2.2.3",
},
[42161]: {
name: "arbitrumOne",
prefix: "arb1",
Expand Down
14 changes: 11 additions & 3 deletions packages/evm/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const {
POLYGONSCAN_API_KEY,
ARBISCAN_API_KEY,
SNOWTRACE_API_KEY,
ZKEVM_POLYGONSCAN_API_KEY
ZKEVM_POLYGONSCAN_API_KEY,
} = process.env;

const sharedNetworkConfig: HttpNetworkUserConfig = {};
Expand Down Expand Up @@ -102,7 +102,7 @@ const config: HardhatUserConfig = {
chainId: 43114,
url: "https://rpc.ankr.com/avalanche",
},
zkEVM: {
zkevm: {
...sharedNetworkConfig,
chainId: 1101,
url: "https://zkevm-rpc.com",
Expand All @@ -117,7 +117,7 @@ const config: HardhatUserConfig = {
matic: POLYGONSCAN_API_KEY,
arbitrum: ARBISCAN_API_KEY,
avalanche: SNOWTRACE_API_KEY,
zkEVM: ZKEVM_POLYGONSCAN_API_KEY
zkevm: ZKEVM_POLYGONSCAN_API_KEY,
} as Record<string, string>,
customChains: [
{
Expand Down Expand Up @@ -160,6 +160,14 @@ const config: HardhatUserConfig = {
browserURL: "https://www.snowtrace.io",
},
},
{
network: "zkevm",
chainId: 1101,
urls: {
apiURL: "https://api-zkevm.polygonscan.com/api",
browserURL: "https://zkevm.polygonscan.com",
},
},
],
},
gasReporter: {
Expand Down
430 changes: 67 additions & 363 deletions packages/evm/mastercopies.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"devDependencies": {
"@gnosis-guild/typechain-ethers-v6": "^0.5.4",
"@gnosis-guild/zodiac-core": "^2.0.2",
"@gnosis-guild/zodiac-core": "^2.0.4",
"@nomicfoundation/hardhat-chai-matchers": "^2.0.7",
"@nomicfoundation/hardhat-ethers": "^3.0.7",
"@nomicfoundation/hardhat-ignition": "^0.15.5",
Expand Down
13 changes: 9 additions & 4 deletions packages/evm/tasks/verify-mastercopy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,18 @@ task(
)
.addOptionalParam(
"contractVersion",
"Filters by a specific version or lateat",
"Specify a specific version",
"latest", // Default value
types.string
)
.setAction(async ({ contractVersion }, hre) => {
if (!ETHERSCAN_API_KEY) {
throw new Error("Missing ENV ETHERSCAN_API_KEY");
const apiKey = (hre.config.etherscan.apiKey as any)[hre.network.name] as
| string
| undefined;
if (!apiKey) {
throw new Error(
"Missing etherscan api key for network " + hre.network.name
);
}

const chainId = String((await hre.ethers.provider.getNetwork()).chainId);
Expand All @@ -24,7 +29,7 @@ task(
const { noop } = await verifyMastercopy({
artifact,
apiUrlOrChainId: chainId,
apiKey: ETHERSCAN_API_KEY,
apiKey: apiKey,
});

const { contractName, contractVersion, address } = artifact;
Expand Down
4 changes: 2 additions & 2 deletions packages/sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zodiac-roles-sdk",
"version": "2.14.2",
"version": "2.14.3",
"license": "LGPL-3.0+",
"main": "build/cjs/sdk/src/index.js",
"module": "build/esm/sdk/src/index.js",
Expand Down Expand Up @@ -108,4 +108,4 @@
"installConfig": {
"hoistingLimits": "workspaces"
}
}
}
5 changes: 4 additions & 1 deletion packages/sdk/src/ethSdk.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
// The default eth-sdk config covers alls supported chains, except gnosis.
export const ethSdkConfig = {
etherscanURLs: {
gnosis: "https://api.gnosisscan.io/api",
base: "https://api.basescan.org/api",
zkevm: "https://api-zkevm.polygonscan.com/api",
},
etherscanKeys: {
gnosis: "8ENCUFT4D3XVJS7N9ZFS5Z9XQPNUGRKSN5",
base: "EP2HURF81GKBPX1RQ37T91Z2WXKH4FT78Q",
zkevm: "GV71WR5UTRQCIPHQ124HNCBYI1KSSXN5DC",
},
rpc: {
gnosis: "https://rpc.gnosischain.com",
base: "https://mainnet.base.org",
zkevm: "https://zkevm-rpc.com",
},
networkIds: {
gnosis: 100,
base: 8453,
zkevm: 1101,
},
} as const
59 changes: 1 addition & 58 deletions packages/sdk/test/processAnnotations.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { expect } from "chai"

import { processAnnotations } from "../src/annotations/processing"
import { PermissionCoerced } from "../src/permissions"

Expand Down Expand Up @@ -179,64 +180,6 @@ const permissionsForPreset1: PermissionCoerced[] = [
{
targetAddress: "0x23da9ade38e4477b23770ded512fd37b12381fab",
selector: "0x5a66c223",
condition: {
paramType: 5,
operator: 5,
children: [
{
paramType: 3,
operator: 5,
children: [
{
paramType: 0,
operator: 2,
children: [
{
paramType: 1,
operator: 16,
compValue:
"0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f",
},
{
paramType: 1,
operator: 16,
compValue:
"0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
},
],
},
{
paramType: 0,
operator: 2,
children: [
{
paramType: 1,
operator: 16,
compValue:
"0x0000000000000000000000006b175474e89094c44da98b954eedeac495271d0f",
},
{
paramType: 1,
operator: 16,
compValue:
"0x000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
},
],
},
{ paramType: 1, operator: 15 },
{ paramType: 1, operator: 0 },
{ paramType: 1, operator: 0 },
{ paramType: 1, operator: 0 },
{ paramType: 1, operator: 0 },
{ paramType: 1, operator: 0 },
{ paramType: 1, operator: 0 },
{ paramType: 1, operator: 0 },
{ paramType: 1, operator: 0 },
{ paramType: 1, operator: 0 },
],
},
],
},
delegatecall: true,
},
]
1 change: 1 addition & 0 deletions packages/subgraph/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ SUBGRAPH_AVALANCHE=zodiac-roles-avalanche
SUBGRAPH_BSC=zodiac-roles-bsc
SUBGRAPH_OPTIMISM=zodiac-roles-optimism
SUBGRAPH_POLYGON=zodiac-roles-polygon
SUBGRAPH_ZKEVM=zodiac-roles-zkevm
SUBGRAPH_BASE=zodiac-roles-base
4 changes: 4 additions & 0 deletions packages/subgraph/networks/polygon-zkevm.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"network": "polygon-zkevm",
"startBlock": 16677236
}
4 changes: 3 additions & 1 deletion packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"deploy:optimism": "yarn prepare:optimism && bash -c 'source .env || true && graph deploy --studio $SUBGRAPH_OPTIMISM'",
"deploy:base": "yarn prepare:base && bash -c 'source .env || true && graph deploy --studio $SUBGRAPH_BASE'",
"deploy:polygon": "yarn prepare:polygon && bash -c 'source .env || true && graph deploy --studio $SUBGRAPH_POLYGON'",
"deploy:zkevm": "yarn prepare:zkevm && bash -c 'source .env || true && graph deploy --studio $SUBGRAPH_ZKEVM'",
"prepare:mainnet": "mustache networks/mainnet.json subgraph.template.yaml > subgraph.yaml",
"prepare:sepolia": "mustache networks/sepolia.json subgraph.template.yaml > subgraph.yaml",
"prepare:gnosis": "mustache networks/gnosis.json subgraph.template.yaml > subgraph.yaml",
Expand All @@ -25,7 +26,8 @@
"prepare:bsc": "mustache networks/bsc.json subgraph.template.yaml > subgraph.yaml",
"prepare:optimism": "mustache networks/optimism.json subgraph.template.yaml > subgraph.yaml",
"prepare:base": "mustache networks/base.json subgraph.template.yaml > subgraph.yaml",
"prepare:polygon": "mustache networks/polygon.json subgraph.template.yaml > subgraph.yaml"
"prepare:polygon": "mustache networks/polygon.json subgraph.template.yaml > subgraph.yaml",
"prepare:zkevm": "mustache networks/polygon-zkevm.json subgraph.template.yaml > subgraph.yaml"
},
"devDependencies": {
"mustache": "^4.2.0",
Expand Down
10 changes: 5 additions & 5 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -893,7 +893,7 @@ __metadata:
resolution: "@gnosis-guild/zodiac-core-modifier-roles@workspace:packages/evm"
dependencies:
"@gnosis-guild/typechain-ethers-v6": ^0.5.4
"@gnosis-guild/zodiac-core": ^2.0.2
"@gnosis-guild/zodiac-core": ^2.0.4
"@gnosis.pm/safe-contracts": 1.3.0
"@nomicfoundation/hardhat-chai-matchers": ^2.0.7
"@nomicfoundation/hardhat-ethers": ^3.0.7
Expand Down Expand Up @@ -943,16 +943,16 @@ __metadata:
languageName: node
linkType: hard

"@gnosis-guild/zodiac-core@npm:^2.0.2":
version: 2.0.2
resolution: "@gnosis-guild/zodiac-core@npm:2.0.2"
"@gnosis-guild/zodiac-core@npm:^2.0.4":
version: 2.0.4
resolution: "@gnosis-guild/zodiac-core@npm:2.0.4"
dependencies:
"@gnosis.pm/safe-contracts": 1.3.0
"@openzeppelin/contracts": 5.0.2
"@openzeppelin/contracts-upgradeable": 5.0.2
ethers: ^6.13.2
semver: ^7.6.3
checksum: 2f679e98fcc828c3b0e4b4d6ddf55c1d176516c0d921e0015d44634dbde99575475456f6622df8fd0014b54a9e2a6204374981f0f96443d3ff7fe650367b6f43
checksum: aaeb9bf586ec70a950ed543ce07db9d62017f5f1884a64f3d2cf6d2d7fceb2dfaf54b7dc5435eaefb8b2c21efb86d4999ee144064243d13a85e296f2e9ed935d
languageName: node
linkType: hard

Expand Down

0 comments on commit b8f6190

Please sign in to comment.