Skip to content

Commit

Permalink
Networks: Add sonic mode blast (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
PatricioHenderson authored Feb 3, 2025
1 parent b73cd14 commit 359ca02
Show file tree
Hide file tree
Showing 4 changed files with 103 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ jobs:
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
run: yarn deploy:base

deploy-blast:
name: Deploy Blast
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Deploy Blast
env:
VERSION_LABEL: ${{ github.sha }}
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
run: yarn deploy:blast

deploy-bsc:
name: Deploy BSC
runs-on: ubuntu-latest
Expand Down Expand Up @@ -118,6 +132,20 @@ jobs:
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:mainnet

deploy-mode:
name: Deploy Mode
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Deploy Mode
env:
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:mode

deploy-optimism:
name: Deploy Optimism
runs-on: ubuntu-latest
Expand Down Expand Up @@ -146,6 +174,20 @@ jobs:
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:polygon

deploy-sonic:
name: Deploy Sonic
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up environment
uses: ./.github/actions/setup
- name: Deploy Sonic
env:
GRAPH_KEY: ${{ secrets.GRAPH_STUDIO_KEY }}
VERSION_LABEL: ${{ github.sha }}
run: yarn deploy:sonic

deploy-zkevm:
name: Deploy zkEVM
runs-on: ubuntu-latest
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,29 @@
"build:aurora": "NETWORK=aurora ./scripts/build.sh",
"build:avalanche": "NETWORK=avalanche ./scripts/build.sh",
"build:base": "NETWORK=base ./scripts/build.sh",
"build:blast": "NETWORK=blast ./scripts/build.sh",
"build:bsc": "NETWORK=bsc ./scripts/build.sh",
"build:fantom": "NETWORK=fantom ./scripts/build.sh",
"build:gnosis": "NETWORK=gnosis ./scripts/build.sh",
"build:mainnet": "NETWORK=mainnet ./scripts/build.sh",
"build:mode": "NETWORK=mode ./scripts/build.sh",
"build:optimism": "NETWORK=optimism ./scripts/build.sh",
"build:polygon": "NETWORK=polygon ./scripts/build.sh",
"build:sonic": "NETWORK=sonic ./scripts/build.sh",
"build:zkevm": "NETWORK=zkevm ./scripts/build.sh",
"deploy:arbitrum": "NETWORK=arbitrum ./scripts/deploy.sh",
"deploy:aurora": "NETWORK=aurora ./scripts/deploy.sh",
"deploy:avalanche": "NETWORK=avalanche ./scripts/deploy.sh",
"deploy:base": "NETWORK=base ./scripts/deploy.sh",
"deploy:blast": "NETWORK=blast ./scripts/deploy.sh",
"deploy:bsc": "NETWORK=bsc ./scripts/deploy.sh",
"deploy:fantom": "NETWORK=fantom ./scripts/deploy.sh",
"deploy:gnosis": "NETWORK=gnosis ./scripts/deploy.sh",
"deploy:mainnet": "NETWORK=mainnet ./scripts/deploy.sh",
"deploy:mode": "NETWORK=mode ./scripts/deploy.sh",
"deploy:optimism": "NETWORK=optimism ./scripts/deploy.sh",
"deploy:polygon": "NETWORK=polygon ./scripts/deploy.sh",
"deploy:sonic": "NETWORK=sonic ./scripts/build.sh",
"deploy:zkevm": "NETWORK=zkevm ./scripts/deploy.sh"
},
"dependencies": {
Expand Down
31 changes: 29 additions & 2 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ relayer_3_base=0x9E0A538749A486bbF127F8848a6f2CF4e1e92DbD
feeController_base=0x88586bfc840b99680c8cc753a36b51999608b1f6
block_base=5957564

# Blast
registry_blast=0x1675BF3F75046aCd131caD845eb8FF3Bed49a643
deployer_blast=0x849B7B1102B0dcf6eC10f98b81C8D1c38f7cbf24
relayer_1_blast=0xD7252C026c3cA28D73B4DeeF62FE6ADe86eC17A9
relayer_2_blast=0x54FC6E302043aAF56154e8B4A7F01645eDAdA906
relayer_3_blast=0x9E0A538749A486bbF127F8848a6f2CF4e1e92DbD
feeController_blast=0x88586bfc840b99680c8cc753a36b51999608b1f6
block_blast=12945654

# BSC
registry_bsc=0x1675BF3F75046aCd131caD845eb8FF3Bed49a643
deployer_bsc=0x849B7B1102B0dcf6eC10f98b81C8D1c38f7cbf24
Expand Down Expand Up @@ -75,6 +84,15 @@ relayer_3_mainnet=0x9E0A538749A486bbF127F8848a6f2CF4e1e92DbD
feeController_mainnet=0x88586bfc840b99680c8cc753a36b51999608b1f6
block_mainnet=18386855

# Mode
registry_mode=0x1675BF3F75046aCd131caD845eb8FF3Bed49a643
deployer_mode=0x849B7B1102B0dcf6eC10f98b81C8D1c38f7cbf24
relayer_1_mode=0xD7252C026c3cA28D73B4DeeF62FE6ADe86eC17A9
relayer_2_mode=0x54FC6E302043aAF56154e8B4A7F01645eDAdA906
relayer_3_mode=0x9E0A538749A486bbF127F8848a6f2CF4e1e92DbD
feeController_mode=0x88586bfc840b99680c8cc753a36b51999608b1f6
block_mode=17840787

# Optimism
registry_optimism=0x1675BF3F75046aCd131caD845eb8FF3Bed49a643
deployer_optimism=0x849B7B1102B0dcf6eC10f98b81C8D1c38f7cbf24
Expand All @@ -93,6 +111,15 @@ relayer_3_polygon=0x9E0A538749A486bbF127F8848a6f2CF4e1e92DbD
feeController_polygon=0x88586bfc840b99680c8cc753a36b51999608b1f6
block_polygon=49350048

# Sonic
registry_sonic=0x1675BF3F75046aCd131caD845eb8FF3Bed49a643
deployer_sonic=0x849B7B1102B0dcf6eC10f98b81C8D1c38f7cbf24
relayer_1_sonic=0xD7252C026c3cA28D73B4DeeF62FE6ADe86eC17A9
relayer_2_sonic=0x54FC6E302043aAF56154e8B4A7F01645eDAdA906
relayer_3_sonic=0x9E0A538749A486bbF127F8848a6f2CF4e1e92DbD
feeController_sonic=0x88586bfc840b99680c8cc753a36b51999608b1f6
block_sonic=2879191

# zkEVM
registry_zkevm=0x1675BF3F75046aCd131caD845eb8FF3Bed49a643
deployer_zkevm=0x849B7B1102B0dcf6eC10f98b81C8D1c38f7cbf24
Expand All @@ -103,9 +130,9 @@ feeController_zkevm=0x88586bfc840b99680c8cc753a36b51999608b1f6
block_zkevm=6788022

# Validate network
networks=(arbitrum aurora avalanche base bsc fantom gnosis mainnet optimism polygon zkevm)
networks=(arbitrum aurora avalanche base blast bsc fantom gnosis mainnet mode optimism polygon sonic zkevm)
if [[ -z $NETWORK || ! " ${networks[@]} " =~ " ${NETWORK} " ]]; then
echo 'Please make sure the network provided is either: arbitrum, aurora, avalanche, base, bsc, fantom, gnosis, mainnet, optimism, polygon, or zkevm.'
echo 'Please make sure the network provided is either: arbitrum, aurora, avalanche, base, blast, bsc, fantom, gnosis, mainnet, mode, optimism, polygon, sonic, or zkevm.'
exit 1
fi

Expand Down
27 changes: 26 additions & 1 deletion src/Networks.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import { BigInt, dataSource } from '@graphprotocol/graph-ts'

export function isEthNetwork(): boolean {
return isMainnet() || isArbitrum() || isOptimism() || isBase() || isZkEvm() || isAurora()
return (
isMainnet() ||
isArbitrum() ||
isOptimism() ||
isBase() ||
isZkEvm() ||
isAurora() ||
isSonic() ||
isBlast() ||
isMode()
)
}

export function isMainnet(): boolean {
Expand Down Expand Up @@ -48,6 +58,18 @@ export function isAurora(): boolean {
return dataSource.network() == 'aurora'
}

export function isSonic(): boolean {
return dataSource.network() == 'sonic'
}

export function isBlast(): boolean {
return dataSource.network() == 'blast'
}

export function isMode(): boolean {
return dataSource.network() == 'mode'
}

export function getNetworkId(): BigInt {
if (isMainnet()) return BigInt.fromI32(1)
if (isArbitrum()) return BigInt.fromI32(42161)
Expand All @@ -60,5 +82,8 @@ export function getNetworkId(): BigInt {
if (isZkEvm()) return BigInt.fromI32(1101)
if (isBase()) return BigInt.fromI32(8453)
if (isAurora()) return BigInt.fromI32(1313161554)
if (isSonic()) return BigInt.fromI32(146)
if (isBlast()) return BigInt.fromI32(81457)
if (isMode()) return BigInt.fromI32(34443)
return BigInt.fromI32(0)
}

0 comments on commit 359ca02

Please sign in to comment.