Skip to content

Commit

Permalink
Merge pull request #19 from gnosisguild/base
Browse files Browse the repository at this point in the history
add support for base
  • Loading branch information
jfschwarz authored Oct 11, 2024
2 parents 4523133 + b0d2bae commit 9a02f3c
Show file tree
Hide file tree
Showing 11 changed files with 54 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/dev-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
REACT_APP_BSCSCAN_KEY: AMXEAU3N9P7RJHFSZ7KAJDRY5MFJ1N29D6
REACT_APP_OPTIMISTICSCAN_KEY: 6RJ8KT4B1S9V7E3CIYECNY7HFW8IPWQ3C4
REACT_APP_SNOWTRACE_KEY: IAST9REKWMIW1QSE2M7K2IKKAZVNQPHC1U
REACT_APP_BASESCAN_KEY: EP2HURF81GKBPX1RQ37T91Z2WXKH4FT78Q
REACT_APP_INFURA_KEY: 0de1a96486754f8b98f284d093905198
REACT_APP_ONBOARD_JS_DAPP_ID: 30fd8cd4-93a1-4c0e-a463-b5eceb9a3956
REACT_APP_SUBGRAPH_BASE_URL: https://airlock.gnosisguild.org/api/v1/subgraph/
Expand All @@ -23,6 +24,7 @@ env:
REACT_APP_SUBGRAPH_OPTIMISM: HMJik2c7BEXFy1gp7H3zK8TSqubzeGQ8sfZjgGbLJjwy
REACT_APP_SUBGRAPH_AVALANCHE: 6pVVa2Q53HRqQahiZLovV5AUN48nK28Cym6TRbw4ABP8
REACT_APP_SUBGRAPH_BSC: 7ffR3tdeVZ2SrHcnzCswBoqX7Zx4P4wkG9V6qEUomdU
REACT_APP_SUBGRAPH_BASE: DJTPvUAk3iyZzDhXhoFwH18qiUJDyS4LXDU9EfWBLEWB

jobs:
deploy:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/prod-release-deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ env:
REACT_APP_BSCSCAN_KEY: AMXEAU3N9P7RJHFSZ7KAJDRY5MFJ1N29D6
REACT_APP_OPTIMISTICSCAN_KEY: 6RJ8KT4B1S9V7E3CIYECNY7HFW8IPWQ3C4
REACT_APP_SNOWTRACE_KEY: IAST9REKWMIW1QSE2M7K2IKKAZVNQPHC1U
REACT_APP_BASESCAN_KEY: EP2HURF81GKBPX1RQ37T91Z2WXKH4FT78Q
REACT_APP_INFURA_KEY: 0de1a96486754f8b98f284d093905198
REACT_APP_ONBOARD_JS_DAPP_ID: 30fd8cd4-93a1-4c0e-a463-b5eceb9a3956
REACT_APP_SUBGRAPH_BASE_URL: https://airlock.gnosisguild.org/api/v1/subgraph/
Expand All @@ -23,6 +24,7 @@ env:
REACT_APP_SUBGRAPH_OPTIMISM: HMJik2c7BEXFy1gp7H3zK8TSqubzeGQ8sfZjgGbLJjwy
REACT_APP_SUBGRAPH_AVALANCHE: 6pVVa2Q53HRqQahiZLovV5AUN48nK28Cym6TRbw4ABP8
REACT_APP_SUBGRAPH_BSC: 7ffR3tdeVZ2SrHcnzCswBoqX7Zx4P4wkG9V6qEUomdU
REACT_APP_SUBGRAPH_BASE: DJTPvUAk3iyZzDhXhoFwH18qiUJDyS4LXDU9EfWBLEWB

jobs:
deploy:
Expand Down
2 changes: 2 additions & 0 deletions packages/app/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ REACT_APP_BSCSCAN_KEY=
REACT_APP_GNOSISSCAN_KEY=
REACT_APP_OPTIMISTICSCAN_KEY=
REACT_APP_SNOWTRACE_KEY=
REACT_APP_BASESCAN_KEY=

# Subgraphs
REACT_APP_SUBGRAPH_BASE_URL=https://airlock.gnosisguild.org/api/v1/subgraph/
Expand All @@ -20,3 +21,4 @@ REACT_APP_SUBGRAPH_ARBITRUM=5TLTw4whZvjbtQmzomRHJDrCX9VQ32mHSdrPN7oxdn4v
REACT_APP_SUBGRAPH_OPTIMISM=HMJik2c7BEXFy1gp7H3zK8TSqubzeGQ8sfZjgGbLJjwy
REACT_APP_SUBGRAPH_AVALANCHE=6pVVa2Q53HRqQahiZLovV5AUN48nK28Cym6TRbw4ABP8
REACT_APP_SUBGRAPH_BSC=7ffR3tdeVZ2SrHcnzCswBoqX7Zx4P4wkG9V6qEUomdU
REACT_APP_SUBGRAPH_BASE=DJTPvUAk3iyZzDhXhoFwH18qiUJDyS4LXDU9EfWBLEWB
23 changes: 23 additions & 0 deletions packages/app/src/data/chains.json
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,29 @@
],
"infoURL": "https://arbitrum.io"
},
"8453": {
"name": "Base",
"chainId": 8453,
"shortName": "base",
"nativeCurrency": {
"name": "Ether",
"symbol": "ETH",
"decimals": 18
},
"rpc": [
"https://mainnet.base.org",
"https://base.llamarpc.com",
"wss://base.gateway.tenderly.co"
],
"explorers": [
{
"name": "Basescan",
"url": "https://basescan.org",
"standard": "EIP3091"
}
],
"infoURL": "https://www.base.org"
},
"43114": {
"name": "Avalanche Mainnet",
"chainId": 43114,
Expand Down
6 changes: 6 additions & 0 deletions packages/app/src/services/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ if (!process.env.REACT_APP_SUBGRAPH_ARBITRUM) {
if (!process.env.REACT_APP_SUBGRAPH_OPTIMISM) {
throw new Error("REACT_APP_SUBGRAPH_OPTIMISM is not set")
}
if (!process.env.REACT_APP_SUBGRAPH_BASE) {
throw new Error("REACT_APP_SUBGRAPH_BASE is not set")
}
// if (!process.env.REACT_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN) {
// throw new Error("REACT_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN is not set")
// }
Expand All @@ -49,6 +52,7 @@ const SUBGRAPH_MAINNET = process.env.REACT_APP_SUBGRAPH_MAINNET
const SUBGRAPH_POLYGON = process.env.REACT_APP_SUBGRAPH_POLYGON
const SUBGRAPH_ARBITRUM = process.env.REACT_APP_SUBGRAPH_ARBITRUM
const SUBGRAPH_OPTIMISM = process.env.REACT_APP_SUBGRAPH_OPTIMISM
const SUBGRAPH_BASE = process.env.REACT_APP_SUBGRAPH_BASE
// const SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN = process.env.REACT_APP_SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN

const getUrl = (network?: Network) => {
Expand All @@ -65,6 +69,8 @@ const getUrl = (network?: Network) => {
return BASE_SUBGRAPH_URL + SUBGRAPH_OPTIMISM
case Network.ARBITRUM:
return BASE_SUBGRAPH_URL + SUBGRAPH_ARBITRUM
case Network.BASE:
return BASE_SUBGRAPH_URL + SUBGRAPH_BASE
// case Network.OPTIMISM_ON_GNOSIS:
// return BASE_SUBGRAPH_URL + SUBGRAPH_OPTIMISM_ON_GNOSIS_CHAIN
default:
Expand Down
6 changes: 6 additions & 0 deletions packages/app/src/utils/explorer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const ARBISCAN_KEY = process.env.REACT_APP_ARBISCAN_KEY as string
const BSCSCAN_KEY = process.env.REACT_APP_BSCSCAN_KEY as string
const OPTIMISTICSCAN_KEY = process.env.REACT_APP_OPTIMISTICSCAN_KEY as string
const SNOWTRACE_KEY = process.env.REACT_APP_SNOWTRACE_KEY as string
const BASESCAN_KEY = process.env.REACT_APP_BASESCAN_KEY as string

if (!ETHERSCAN_KEY) throw new Error("ETHERSCAN_KEY env is not set")
if (!GNOSISSCAN_KEY) throw new Error("GNOSISSCAN_KEY env is not set")
Expand All @@ -18,6 +19,7 @@ if (!ARBISCAN_KEY) throw new Error("ARBISCAN_KEY env is not set")
if (!BSCSCAN_KEY) throw new Error("BSCSCAN_KEY env is not set")
if (!OPTIMISTICSCAN_KEY) throw new Error("OPTIMISTICSCAN_KEY env is not set")
if (!SNOWTRACE_KEY) throw new Error("SNOWTRACE_KEY env is not set")
if (!BASESCAN_KEY) throw new Error("BASESCAN_KEY env is not set")

const explorerConfig: Record<Network, ExplorerConfig> = {
[Network.MAINNET]: {
Expand Down Expand Up @@ -55,6 +57,10 @@ const explorerConfig: Record<Network, ExplorerConfig> = {
apiUrl: "https://api-optimistic.etherscan.io/api",
apiKey: OPTIMISTICSCAN_KEY,
},
[Network.BASE]: {
apiUrl: "https://api.basescan.org/api",
apiKey: BASESCAN_KEY,
},
[Network.EWT]: {
apiUrl: "https://explorer.energyweb.org/api",
},
Expand Down
2 changes: 2 additions & 0 deletions packages/app/src/utils/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export enum Network {
GOERLI = 5,
SEPOLIA = 11155111,
OPTIMISM = 10,
BASE = 8453,
OPTIMISM_ON_GNOSIS = 300,
BINANCE = 56,
GNOSIS = 100,
Expand All @@ -24,6 +25,7 @@ export const NETWORKS = [
Network.GOERLI,
Network.SEPOLIA,
Network.OPTIMISM,
Network.BASE,
Network.BINANCE,
Network.GNOSIS,
Network.POLYGON,
Expand Down
3 changes: 3 additions & 0 deletions packages/sdk/src/subgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ const SUBGRAPH = {
"https://airlock.gnosisguild.org/api/v1/subgraph/JDFgdGqUsDci3yv5HgEhFDFT65hmAtnnGgp4tN6nksGG",
[42161]:
"https://airlock.gnosisguild.org/api/v1/subgraph/5TLTw4whZvjbtQmzomRHJDrCX9VQ32mHSdrPN7oxdn4v",

[8453]:
"https://airlock.gnosisguild.org/api/v1/subgraph/DJTPvUAk3iyZzDhXhoFwH18qiUJDyS4LXDU9EfWBLEWB",
// [43114]:
// "https://airlock.gnosisguild.org/api/v1/subgraph/6pVVa2Q53HRqQahiZLovV5AUN48nK28Cym6TRbw4ABP8",
}
Expand Down
3 changes: 2 additions & 1 deletion packages/subgraph/.env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ HOSTED_SERVICE_SUBGRAPH__BSC=asgeir-eth/zodiac-modifier-roles-bsc
HOSTED_SERVICE_SUBGRAPH__MAINNET=asgeir-eth/zodiac-modifier-roles-mainnet
HOSTED_SERVICE_SUBGRAPH__OPTIMISM=asgeir-eth/zodiac-modifier-roles-optimism
HOSTED_SERVICE_SUBGRAPH__POLYGON=asgeir-eth/zodiac-modifier-roles-polygon
HOSTED_SERVICE_SUBGRAPH__OPTIMISM_ON_GNOSIS_CHAIN=asgeir-eth/zodiac-modifier-roles-optimism-on-gnosis-chain
HOSTED_SERVICE_SUBGRAPH__OPTIMISM_ON_GNOSIS_CHAIN=asgeir-eth/zodiac-modifier-roles-optimism-on-gnosis-chain
HOSTED_SERVICE_SUBGRAPH__BASE=asgeir-eth/zodiac-modifier-roles-base
4 changes: 4 additions & 0 deletions packages/subgraph/network_configs/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"network": "base",
"startBlock": 13191705
}
2 changes: 2 additions & 0 deletions packages/subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@
"deploy:mainnet": "yarn prepare:mainnet && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__MAINNET'",
"deploy:optimism": "yarn prepare:optimism && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__OPTIMISM'",
"deploy:polygon": "yarn prepare:polygon && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__POLYGON'",
"deploy:base": "yarn prepare:base && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__BASE'",
"prepare:goerli": "mustache network_configs/goerli.json subgraph.template.yaml > subgraph.yaml",
"prepare:sepolia": "mustache network_configs/sepolia.json subgraph.template.yaml > subgraph.yaml",
"prepare:avalanche": "mustache network_configs/avalanche.json subgraph.template.yaml > subgraph.yaml",
"prepare:bsc": "mustache network_configs/bsc.json subgraph.template.yaml > subgraph.yaml",
"prepare:mainnet": "mustache network_configs/mainnet.json subgraph.template.yaml > subgraph.yaml",
"prepare:optimism": "mustache network_configs/optimism.json subgraph.template.yaml > subgraph.yaml",
"prepare:polygon": "mustache network_configs/polygon.json subgraph.template.yaml > subgraph.yaml",
"prepare:base": "mustache network_configs/base.json subgraph.template.yaml > subgraph.yaml",
"deploy:optimism-on-gnosis-chain": "yarn prepare:optimism-on-gnosis-chain && bash -c 'source .env || true && graph deploy --node https://api.thegraph.com/deploy/ $HOSTED_SERVICE_SUBGRAPH__OPTIMISM_ON_GNOSIS_CHAIN'",
"prepare:optimism-on-gnosis-chain": "mustache network_configs/optimism-on-gnosis-chain.json subgraph.template.yaml > subgraph.yaml",
"prepare:arbitrum-one": "mustache network_configs/arbitrum-one.json subgraph.template.yaml > subgraph.yaml",
Expand Down

0 comments on commit 9a02f3c

Please sign in to comment.