From 0834c7d667302ad49c5e84e0c73b78b89ebe3452 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Mon, 25 Aug 2025 13:33:38 +0530 Subject: [PATCH 1/6] chore: migrate-to-envio-query --- src/light-gtcr-execution.ts | 2 +- src/light-gtcr-withdrawal.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/light-gtcr-execution.ts b/src/light-gtcr-execution.ts index 9d15983..85829bb 100644 --- a/src/light-gtcr-execution.ts +++ b/src/light-gtcr-execution.ts @@ -10,7 +10,7 @@ async function run(signer: ethers.Wallet) { const subgraphQuery = { query: ` { - lrequests(where: { resolved: false, disputed: false }, first: 1000) { + lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false} }, limit: 1000) { submissionTime item { itemID diff --git a/src/light-gtcr-withdrawal.ts b/src/light-gtcr-withdrawal.ts index c27d87a..85ea8f0 100644 --- a/src/light-gtcr-withdrawal.ts +++ b/src/light-gtcr-withdrawal.ts @@ -9,7 +9,7 @@ async function run(batchWithdraw: ethers.Contract, signer: ethers.Wallet) { const subgraphQuery = { query: ` { - lcontributions(where: { withdrawable: true }) { + lcontributions: LContribution(where: { withdrawable: {_eq :true} }) { id contributor } From 773363397c30848aadcb1f5c58069d03f5566bce Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 14 Oct 2025 12:28:03 +0530 Subject: [PATCH 2/6] fix: chain-filtering --- src/light-gtcr-execution.ts | 2 +- src/light-gtcr-withdrawal.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/light-gtcr-execution.ts b/src/light-gtcr-execution.ts index 85829bb..95be50e 100644 --- a/src/light-gtcr-execution.ts +++ b/src/light-gtcr-execution.ts @@ -10,7 +10,7 @@ async function run(signer: ethers.Wallet) { const subgraphQuery = { query: ` { - lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false} }, limit: 1000) { + lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false}, chainId: {_eq: 100} }, limit: 1000) { submissionTime item { itemID diff --git a/src/light-gtcr-withdrawal.ts b/src/light-gtcr-withdrawal.ts index 85ea8f0..534c43d 100644 --- a/src/light-gtcr-withdrawal.ts +++ b/src/light-gtcr-withdrawal.ts @@ -9,7 +9,7 @@ async function run(batchWithdraw: ethers.Contract, signer: ethers.Wallet) { const subgraphQuery = { query: ` { - lcontributions: LContribution(where: { withdrawable: {_eq :true} }) { + lcontributions: LContribution(where: { withdrawable: {_eq :true}, chainId: {_eq: 100} }) { id contributor } From 2164ccb7e3ab43bbc1408967fad41ae33fcba1ad Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Tue, 14 Oct 2025 13:13:08 +0530 Subject: [PATCH 3/6] chore: make-chain-id-configurable --- .env.example | 1 + src/light-gtcr-execution.ts | 2 +- src/light-gtcr-withdrawal.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.env.example b/.env.example index dd407f0..6cb2be5 100644 --- a/.env.example +++ b/.env.example @@ -3,6 +3,7 @@ BATCH_WITHDRAW_ADDRESS=0xA32942798112e561d4d3ffc62c552bb0E9651b66 PROVIDER_URL=https://kovan.infura.io/v3/ LBATCH_WITHDRAW_ADDRESS=0x13c5E321cdF37e3736470bbC6E8DD95015D7B9E3 GTCR_SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/eccentricexit/light-curate-kovan-ii +GTCR_SUBGRAPH_CHAIN_ID=100 # How often to check if items passed the challenge period without challenges. # The minimum value accepted is 2 * BLOCK_TIME_SECONDS / 60. diff --git a/src/light-gtcr-execution.ts b/src/light-gtcr-execution.ts index 95be50e..941d501 100644 --- a/src/light-gtcr-execution.ts +++ b/src/light-gtcr-execution.ts @@ -10,7 +10,7 @@ async function run(signer: ethers.Wallet) { const subgraphQuery = { query: ` { - lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false}, chainId: {_eq: 100} }, limit: 1000) { + lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false}, chainId: {_eq: ${process.env.GTCR_SUBGRAPH_CHAIN_ID}} }, limit: 1000) { submissionTime item { itemID diff --git a/src/light-gtcr-withdrawal.ts b/src/light-gtcr-withdrawal.ts index 534c43d..93ebc5c 100644 --- a/src/light-gtcr-withdrawal.ts +++ b/src/light-gtcr-withdrawal.ts @@ -9,7 +9,7 @@ async function run(batchWithdraw: ethers.Contract, signer: ethers.Wallet) { const subgraphQuery = { query: ` { - lcontributions: LContribution(where: { withdrawable: {_eq :true}, chainId: {_eq: 100} }) { + lcontributions: LContribution(where: { withdrawable: {_eq :true}, chainId: {_eq: ${process.env.GTCR_SUBGRAPH_CHAIN_ID}} }) { id contributor } From a13274c2e0378fba327cf5f346decc7babf7b4a0 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Wed, 15 Oct 2025 13:17:59 +0530 Subject: [PATCH 4/6] chore: env-example-update --- .env.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index 6cb2be5..c7acb76 100644 --- a/.env.example +++ b/.env.example @@ -2,7 +2,9 @@ FACTORY_ADDRESS=0x4296b39059b8591d4f22a0fc4ee49508279b8fc6 BATCH_WITHDRAW_ADDRESS=0xA32942798112e561d4d3ffc62c552bb0E9651b66 PROVIDER_URL=https://kovan.infura.io/v3/ LBATCH_WITHDRAW_ADDRESS=0x13c5E321cdF37e3736470bbC6E8DD95015D7B9E3 -GTCR_SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/eccentricexit/light-curate-kovan-ii +# envio indexer url +GTCR_SUBGRAPH_URL=https://indexer.hyperindex.xyz/abcabc/v1/graphql +# Chain id to filter GTCR/LGTCR items GTCR_SUBGRAPH_CHAIN_ID=100 # How often to check if items passed the challenge period without challenges. From ef732052b2f11f379a677bd70c904317088ebb90 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Thu, 16 Oct 2025 21:41:48 +0530 Subject: [PATCH 5/6] chore: rabbit-feedback --- .env.example | 2 +- src/light-gtcr-execution.ts | 9 ++++++++- src/light-gtcr-withdrawal.ts | 9 ++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index c7acb76..68052bd 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,6 @@ FACTORY_ADDRESS=0x4296b39059b8591d4f22a0fc4ee49508279b8fc6 BATCH_WITHDRAW_ADDRESS=0xA32942798112e561d4d3ffc62c552bb0E9651b66 -PROVIDER_URL=https://kovan.infura.io/v3/ +PROVIDER_URL=https://rpc.gnosis.gateway.fm LBATCH_WITHDRAW_ADDRESS=0x13c5E321cdF37e3736470bbC6E8DD95015D7B9E3 # envio indexer url GTCR_SUBGRAPH_URL=https://indexer.hyperindex.xyz/abcabc/v1/graphql diff --git a/src/light-gtcr-execution.ts b/src/light-gtcr-execution.ts index 941d501..f0b59d0 100644 --- a/src/light-gtcr-execution.ts +++ b/src/light-gtcr-execution.ts @@ -7,10 +7,17 @@ import _LightGeneralizedTCR from "./assets/LightGeneralizedTCR.json"; async function run(signer: ethers.Wallet) { console.info(`Checking for pending requests.`.green); + + const chainId = Number(process.env.GTCR_SUBGRAPH_CHAIN_ID); + if (isNaN(chainId)) { + console.error(`Invalid GTCR_SUBGRAPH_CHAIN_ID. Must be a number.`.red); + return; + } + const subgraphQuery = { query: ` { - lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false}, chainId: {_eq: ${process.env.GTCR_SUBGRAPH_CHAIN_ID}} }, limit: 1000) { + lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false}, chainId: {_eq: ${chainId}} }, limit: 1000) { submissionTime item { itemID diff --git a/src/light-gtcr-withdrawal.ts b/src/light-gtcr-withdrawal.ts index 93ebc5c..438b0c1 100644 --- a/src/light-gtcr-withdrawal.ts +++ b/src/light-gtcr-withdrawal.ts @@ -6,10 +6,17 @@ import _LightBatchWidthdraw from "./assets/LightBatchWithdraw.json"; async function run(batchWithdraw: ethers.Contract, signer: ethers.Wallet) { console.info(`Checking for pending withdrawals.`.yellow); + + const chainId = Number(process.env.GTCR_SUBGRAPH_CHAIN_ID); + if (isNaN(chainId)) { + console.error(`Invalid GTCR_SUBGRAPH_CHAIN_ID. Must be a number.`.red); + return; + } + const subgraphQuery = { query: ` { - lcontributions: LContribution(where: { withdrawable: {_eq :true}, chainId: {_eq: ${process.env.GTCR_SUBGRAPH_CHAIN_ID}} }) { + lcontributions: LContribution(where: { withdrawable: {_eq :true}, chainId: {_eq: ${chainId}} }) { id contributor } From da4840c55412632edf8af07f52e9627b6ddb5760 Mon Sep 17 00:00:00 2001 From: Harman-singh-waraich Date: Thu, 16 Oct 2025 21:47:33 +0530 Subject: [PATCH 6/6] fix: nuke-space --- src/light-gtcr-withdrawal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/light-gtcr-withdrawal.ts b/src/light-gtcr-withdrawal.ts index 438b0c1..d1f1440 100644 --- a/src/light-gtcr-withdrawal.ts +++ b/src/light-gtcr-withdrawal.ts @@ -16,7 +16,7 @@ async function run(batchWithdraw: ethers.Contract, signer: ethers.Wallet) { const subgraphQuery = { query: ` { - lcontributions: LContribution(where: { withdrawable: {_eq :true}, chainId: {_eq: ${chainId}} }) { + lcontributions: LContribution(where: { withdrawable: {_eq: true}, chainId: {_eq: ${chainId}} }) { id contributor }