From 274f7f339f71495a8a3203396678d30bbf106717 Mon Sep 17 00:00:00 2001 From: chef-cannoli Date: Mon, 15 Jan 2024 15:57:23 +0100 Subject: [PATCH] feat: Add v2 prediction subgraph for arbitrum one --- config/arbitrum.js | 4 ++++ config/zksync-era.js | 4 ++++ subgraphs/prediction/v2-generic/package.json | 6 ++++-- subgraphs/prediction/v2-generic/subgraph.yaml | 6 +++--- 4 files changed, 15 insertions(+), 5 deletions(-) diff --git a/config/arbitrum.js b/config/arbitrum.js index 25afab6d..3673e5b1 100644 --- a/config/arbitrum.js +++ b/config/arbitrum.js @@ -51,4 +51,8 @@ module.exports = { masterChefAddress: "0x5e09acf80c0296740ec5d6f643005a4ef8daa694", startBlock: 105053701, }, + predictionV2: { + startBlock: 158927648, + address: "0xF2F90E718a3BFaCb430c1818cB962f05A2631998", + }, }; diff --git a/config/zksync-era.js b/config/zksync-era.js index 8a7d0fb4..c0c9619d 100644 --- a/config/zksync-era.js +++ b/config/zksync-era.js @@ -46,4 +46,8 @@ module.exports = { masterChefAddress: "0x4c615e78c5fca1ad31e4d66eb0d8688d84307463", startBlock: 8792225, }, + predictionV2: { + startBlock: 22038753, + address: "0x43c7771DEB958A2e3198ED98772056ba70DaA84c", + }, }; diff --git a/subgraphs/prediction/v2-generic/package.json b/subgraphs/prediction/v2-generic/package.json index b8aeccbc..dddece1a 100644 --- a/subgraphs/prediction/v2-generic/package.json +++ b/subgraphs/prediction/v2-generic/package.json @@ -6,10 +6,12 @@ "author": "PancakeSwap", "license": "GPL-3.0-or-later", "scripts": { - "template": "mustache ../../../config/arbitrum-goerli.js subgraph.template.yaml > subgraph.yaml", + "template": "mustache ../../config/$NETWORK.js subgraph.template.yaml > subgraph.yaml && mustache ../../config/$NETWORK.js mappings/utils/index.template.ts > mappings/utils/index.ts && mustache ../../config/$NETWORK.js mappings/pricing.template.ts > mappings/pricing.ts", "codegen": "graph codegen subgraph.yaml", "build": "graph build subgraph.yaml", "deploy:bsc": "graph deploy --product hosted-service --node https://api.thegraph.com/deploy/ --ipfs https://api.thegraph.com/ipfs/ chef-cannoli/playground-subgraph subgraph.yaml", - "deploy:arbitrum-goerli": "graph deploy --product hosted-service chef-cannoli/prediction-v2-arbitrum-goerli" + "deploy:arbitrum-goerli": "graph deploy --product hosted-service chef-cannoli/prediction-v2-arbitrum-goerli", + "deploy:arbitrum-one": "graph deploy --product hosted-service chef-cannoli/prediction-v2-arbitrum-one", + "deploy:zksync-era": "graph deploy --studio prediction-v2-zksync-era" } } diff --git a/subgraphs/prediction/v2-generic/subgraph.yaml b/subgraphs/prediction/v2-generic/subgraph.yaml index d99ca5ff..5d57594e 100644 --- a/subgraphs/prediction/v2-generic/subgraph.yaml +++ b/subgraphs/prediction/v2-generic/subgraph.yaml @@ -6,11 +6,11 @@ schema: dataSources: - kind: ethereum/contract name: PredictionV2 - network: arbitrum-goerli + network: arbitrum-one source: - address: "0xd5330586c035a67bd32A6FD8e390c72DB9372861" + address: "0xF2F90E718a3BFaCb430c1818cB962f05A2631998" abi: PredictionV2 - startBlock: 52492780 + startBlock: 158927648 mapping: kind: ethereum/events apiVersion: 0.0.4