Skip to content

Commit

Permalink
feat: Deploy Verax on Arbitrum Sepolia
Browse files Browse the repository at this point in the history
  • Loading branch information
alainncls committed Mar 13, 2024
1 parent 42a2da5 commit ad0ccd7
Show file tree
Hide file tree
Showing 9 changed files with 7,026 additions and 7,579 deletions.
990 changes: 990 additions & 0 deletions contracts/.openzeppelin/unknown-421614.json

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions contracts/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ const config: HardhatUserConfig = {
accounts:
process.env.PRIVATE_KEY_ARBITRUM_TESTNET !== undefined ? [process.env.PRIVATE_KEY_ARBITRUM_TESTNET] : [],
},
"arbitrum-sepolia": {
url: `https://arbitrum-sepolia.infura.io/v3/${process.env.INFURA_KEY ?? ""}`,
accounts:
process.env.PRIVATE_KEY_ARBITRUM_SEPOLIA !== undefined ? [process.env.PRIVATE_KEY_ARBITRUM_SEPOLIA] : [],
},
arbitrum: {
url: "https://arb1.arbitrum.io/rpc",
accounts:
Expand All @@ -49,6 +54,7 @@ const config: HardhatUserConfig = {
etherscan: {
apiKey: {
"arbitrum-goerli": process.env.ARBISCAN_API_KEY ?? "",
"arbitrum-sepolia": process.env.ARBISCAN_API_KEY ?? "",
arbitrum: process.env.ARBISCAN_API_KEY ?? "",
"linea-goerli": process.env.LINEASCAN_API_KEY ?? "",
linea: process.env.LINEASCAN_API_KEY ?? "",
Expand All @@ -63,6 +69,14 @@ const config: HardhatUserConfig = {
browserURL: "https://goerli.arbiscan.io",
},
},
{
network: "arbitrum-sepolia",
chainId: 421614,
urls: {
apiURL: "https://api-sepolia.arbiscan.io/api",
browserURL: "https://sepolia.arbiscan.io",
},
},
{
network: "arbitrum",
chainId: 42161,
Expand Down
2 changes: 2 additions & 0 deletions contracts/script/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ export const getChainPrefix = (chainId: bigint): `0x${string}` => {
return "0x0000000000000000000000000000000000000000000000000000000000000000";
case 421613n: // Arbitrum testnet
return "0x0001000000000000000000000000000000000000000000000000000000000000";
case 421614n: // Arbitrum Sepolia
return "0x0001000000000000000000000000000000000000000000000000000000000000";
case 42161n: // Arbitrum mainnet
return "0x0001000000000000000000000000000000000000000000000000000000000000";
default:
Expand Down
13,470 changes: 5,894 additions & 7,576 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@verax-attestation-registry/verax-sdk",
"version": "1.1.2",
"version": "1.2.1",
"description": "Verax Attestation Registry SDK to interact with the subgraph and the contracts",
"keywords": [
"linea-attestation-registry",
Expand Down
17 changes: 16 additions & 1 deletion sdk/src/VeraxSdk.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { arbitrum, arbitrumGoerli, linea, lineaTestnet } from "viem/chains";
import { arbitrum, arbitrumGoerli, arbitrumSepolia, linea, lineaTestnet } from "viem/chains";
import AttestationDataMapper from "./dataMapper/AttestationDataMapper";
import SchemaDataMapper from "./dataMapper/SchemaDataMapper";
import ModuleDataMapper from "./dataMapper/ModuleDataMapper";
Expand Down Expand Up @@ -58,6 +58,21 @@ export class VeraxSdk {
mode: SDKMode.FRONTEND,
};

static DEFAULT_ARBITRUM_SEPOLIA: Conf = {
chain: arbitrumSepolia,
mode: SDKMode.BACKEND,
subgraphUrl: "https://api.studio.thegraph.com/query/67946/verax-arbitrum-sepolia/v0.0.2",
portalRegistryAddress: "0x1ceb52584B6C45C7049dc7fDC476bC138E4beaDE",
moduleRegistryAddress: "0xEC572277d4E87a64DcfA774ED219Dd4E69E4BDc6",
schemaRegistryAddress: "0x025531b655D9EE335B8E6cc4C118b313f26ACc8F",
attestationRegistryAddress: "0xee5e23492bf49C1F4CF0676b3bF49d78A6dD61c5",
};

static DEFAULT_ARBITRUM_SEPOLIA_FRONTEND: Conf = {
...VeraxSdk.DEFAULT_ARBITRUM_SEPOLIA,
mode: SDKMode.FRONTEND,
};

static DEFAULT_ARBITRUM: Conf = {
chain: arbitrum,
mode: SDKMode.BACKEND,
Expand Down
18 changes: 18 additions & 0 deletions subgraph/networks.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,24 @@
"startBlock": 56196956
}
},
"arbitrum-sepolia": {
"AttestationRegistry": {
"address": "0xee5e23492bf49C1F4CF0676b3bF49d78A6dD61c5",
"startBlock": 22791116
},
"ModuleRegistry": {
"address": "0xEC572277d4E87a64DcfA774ED219Dd4E69E4BDc6",
"startBlock": 22791116
},
"PortalRegistry": {
"address": "0x1ceb52584B6C45C7049dc7fDC476bC138E4beaDE",
"startBlock": 22791116
},
"SchemaRegistry": {
"address": "0x025531b655D9EE335B8E6cc4C118b313f26ACc8F",
"startBlock": 22791116
}
},
"arbitrum-one": {
"AttestationRegistry": {
"address": "0x335E9719e8eFE2a19A92E07BC4836160fC31cd7C",
Expand Down
6 changes: 5 additions & 1 deletion subgraph/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@
"build:linea-mainnet": "cp subgraph.linea-mainnet.yaml subgraph.yaml && pnpm run codegen:linea-mainnet && graph build --network linea-mainnet",
"build:linea-goerli": "cp subgraph.linea-goerli.yaml subgraph.yaml && pnpm run codegen:linea-goerli && graph build --network linea-goerli",
"build:arbitrum-goerli": "cp subgraph.linea-goerli.yaml subgraph.yaml && pnpm run codegen:arbitrum-goerli && graph build --network arbitrum-goerli",
"build:arbitrum-sepolia": "cp subgraph.arbitrum-sepolia.yaml subgraph.yaml && pnpm run codegen:arbitrum-sepolia && graph build --network arbitrum-sepolia",
"build:arbitrum-one": "cp subgraph.linea-goerli.yaml subgraph.yaml && pnpm run codegen:arbitrum-one && graph build --network arbitrum-one",
"codegen:linea-mainnet": "cp subgraph.linea-mainnet.yaml subgraph.yaml && graph codegen",
"codegen:linea-goerli": "cp subgraph.linea-goerli.yaml subgraph.yaml && graph codegen",
"codegen:arbitrum-goerli": "cp subgraph.linea-goerli.yaml subgraph.yaml && graph codegen",
"codegen:arbitrum-sepolia": "cp subgraph.arbitrum-sepolia.yaml subgraph.yaml && graph codegen",
"codegen:arbitrum-one": "cp subgraph.linea-mainnet.yaml subgraph.yaml && graph codegen",
"create:linea-mainnet": "source .env && graph create --node $DEPLOY_ENDPOINT_LINEA_MAINNET Consensys/linea-attestation-registry",
"create:linea-goerli": "source .env && graph create --node $DEPLOY_ENDPOINT_LINEA_GOERLI Consensys/linea-attestation-registry",
"create:arbitrum-goerli": "source .env && graph create --node $DEPLOY_ENDPOINT_ARBITRUM_GOERLI Consensys/verax-arbitrum-goerli",
"create:arbitrum-sepolia": "source .env && graph create --node $DEPLOY_ENDPOINT_ARBITRUM_SEPOLIA $SUBGRAPH_NAME_ARBITRUM_SEPOLIA",
"create:arbitrum-one": "source .env && graph create --node $DEPLOY_ENDPOINT_ARBITRUM_GOERLI Consensys/verax-arbitrum",
"deploy:linea-mainnet": "source .env && cp subgraph.linea-mainnet.yaml subgraph.yaml && pnpm run build:linea-mainnet && graph deploy --network linea-mainnet --node $DEPLOY_ENDPOINT_LINEA_MAINNET --headers \"{\\\"Authorization\\\": \\\"Basic $IPFS_IDENTIFIERS\\\"}\" --ipfs $IPFS_ENDPOINT --version-label v0.0.1 Consensys/linea-attestation-registry",
"deploy:linea-goerli": "source .env && cp subgraph.linea-goerli.yaml subgraph.yaml && pnpm run build:linea-goerli && graph deploy --network linea-goerli --node $DEPLOY_ENDPOINT_LINEA_GOERLI --headers \"{\\\"Authorization\\\": \\\"Basic $IPFS_IDENTIFIERS\\\"}\" --ipfs $IPFS_ENDPOINT --version-label v0.0.5 Consensys/linea-attestation-registry",
"deploy:arbitrum-goerli": "source .env && cp subgraph.arbitrum-goerli.yaml subgraph.yaml && pnpm run build:arbitrum-goerli && graph deploy --network arbitrum-goerli --product hosted-service $SUBGRAPH_NAME_ARBITRUM_GOERLI",
"deploy:arbitrum-sepolia": "source .env && cp subgraph.arbitrum-sepolia.yaml subgraph.yaml && pnpm run build:arbitrum-sepolia && graph deploy --studio $SUBGRAPH_NAME_ARBITRUM_SEPOLIA",
"deploy:arbitrum-one": "source .env && cp subgraph.arbitrum-one.yaml subgraph.yaml && pnpm run build:arbitrum-one && graph deploy --network arbitrum-one --product hosted-service $SUBGRAPH_NAME_ARBITRUM",
"remove:linea-mainnet": "source .env && graph remove --node $DEPLOY_ENDPOINT_LINEA_MAINNET Consensys/linea-attestation-registry",
"remove:linea-goerli": "source .env && graph remove --node $DEPLOY_ENDPOINT_LINEA_GOERLI Consensys/linea-attestation-registry",
Expand All @@ -38,7 +42,7 @@
"test:docker": "graph test -d"
},
"devDependencies": {
"@graphprotocol/graph-cli": "0.60.0",
"@graphprotocol/graph-cli": "0.68.5",
"@graphprotocol/graph-ts": "0.31.0",
"assemblyscript": "0.19.10",
"matchstick-as": "0.6.0"
Expand Down
86 changes: 86 additions & 0 deletions subgraph/subgraph.arbitrum-sepolia.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
specVersion: 0.0.5
schema:
file: ./schema.graphql
dataSources:
- kind: ethereum
name: AttestationRegistry
network: arbotrum-sepolia
source:
abi: AttestationRegistry
address: "0xee5e23492bf49C1F4CF0676b3bF49d78A6dD61c5"
startBlock: 22791116
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Attestation
abis:
- name: AttestationRegistry
file: ./abis/AttestationRegistry.json
eventHandlers:
- event: AttestationRegistered(indexed bytes32)
handler: handleAttestationRegistered
file: ./src/attestation-registry.ts
- kind: ethereum
name: ModuleRegistry
network: arbotrum-sepolia
source:
abi: ModuleRegistry
address: "0xEC572277d4E87a64DcfA774ED219Dd4E69E4BDc6"
startBlock: 22791116
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Module
abis:
- name: ModuleRegistry
file: ./abis/ModuleRegistry.json
eventHandlers:
- event: ModuleRegistered(string,string,address)
handler: handleModuleRegistered
file: ./src/module-registry.ts
- kind: ethereum
name: PortalRegistry
network: arbotrum-sepolia
source:
abi: PortalRegistry
address: "0x1ceb52584B6C45C7049dc7fDC476bC138E4beaDE"
startBlock: 22791116
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Portal
abis:
- name: PortalRegistry
file: ./abis/PortalRegistry.json
eventHandlers:
- event: PortalRegistered(string,string,address)
handler: handlePortalRegistered
file: ./src/portal-registry.ts
- kind: ethereum
name: SchemaRegistry
network: arbotrum-sepolia
source:
abi: SchemaRegistry
address: "0x025531b655D9EE335B8E6cc4C118b313f26ACc8F"
startBlock: 22791116
mapping:
kind: ethereum/events
apiVersion: 0.0.7
language: wasm/assemblyscript
entities:
- Portal
abis:
- name: SchemaRegistry
file: ./abis/SchemaRegistry.json
eventHandlers:
- event: SchemaCreated(indexed bytes32,string,string,string,string)
handler: handleSchemaCreated
- event: SchemaContextUpdated(indexed bytes32)
handler: handleSchemaContextUpdated
file: ./src/schema-registry.ts

0 comments on commit ad0ccd7

Please sign in to comment.