Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
FACTORY_ADDRESS=0x4296b39059b8591d4f22a0fc4ee49508279b8fc6
BATCH_WITHDRAW_ADDRESS=0xA32942798112e561d4d3ffc62c552bb0E9651b66
PROVIDER_URL=https://kovan.infura.io/v3/<secret-key>
PROVIDER_URL=https://rpc.gnosis.gateway.fm
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.
# The minimum value accepted is 2 * BLOCK_TIME_SECONDS / 60.
Expand Down
9 changes: 8 additions & 1 deletion src/light-gtcr-execution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(where: { resolved: false, disputed: false }, first: 1000) {
lrequests: LRequest(where: { resolved: {_eq: false}, disputed: {_eq: false}, chainId: {_eq: ${chainId}} }, limit: 1000) {
submissionTime
item {
itemID
Expand Down
9 changes: 8 additions & 1 deletion src/light-gtcr-withdrawal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(where: { withdrawable: true }) {
lcontributions: LContribution(where: { withdrawable: {_eq: true}, chainId: {_eq: ${chainId}} }) {
id
contributor
}
Expand Down