From 4d6259560caca5b7b245ae6efefb07f1366600cf Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Thu, 20 Feb 2025 02:07:57 -0300 Subject: [PATCH 01/16] chore: placeholder event handlers --- src/mappings/subgraphService.ts | 22 +++++++++++++++++++++- subgraph.template.yaml | 6 ++++++ 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index 1ba54400..04c7a3c1 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -1,5 +1,5 @@ import { ethereum, ValueKind, log } from "@graphprotocol/graph-ts" -import { RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" +import { AllocationClosed, AllocationCreated, AllocationResized, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" import { createOrLoadProvision } from "./helpers/helpers" export function handleServiceProviderRegistered(event: ServiceProviderRegistered): void { @@ -20,3 +20,23 @@ export function handleRewardsDestinationSet(event: RewardsDestinationSet): void provision.rewardsDestination = event.params.rewardsDestination provision.save() } + +export function handleAllocationClosed(event: AllocationClosed): void { + let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) + // To Do + provision.save() +} + + +export function handleAllocationCreated(event: AllocationCreated): void { + let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) + // To Do + provision.save() +} + + +export function handleAllocationResized(event: AllocationResized): void { + let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) + // To Do + provision.save() +} diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 857af4b2..34b6d4a8 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -455,6 +455,12 @@ dataSources: handler: handleServiceProviderRegistered - event: RewardsDestinationSet(indexed address,indexed address) handler: handleRewardsDestinationSet + - event: AllocationClosed(indexed address,indexed address,indexed bytes32,uint256) + handler: handleAllocationClosed + - event: AllocationCreated(indexed address,indexed address,indexed bytes32,uint256) + handler: handleAllocationCreated + - event: AllocationResized(indexed address,indexed address,indexed bytes32,uint256,uint256) + handler: handleAllocationResized - kind: ethereum/contract name: Curation network: {{network}} From b9db459f7a42fbb5775015aa2e2efe2aa9e87563 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Mon, 24 Feb 2025 03:07:17 -0300 Subject: [PATCH 02/16] chore: updated ABIs --- abis/HorizonStaking.json | 4833 +++++++++++++++++++------------------ abis/SubgraphService.json | 4552 +++++++++++++++++----------------- subgraph.template.yaml | 10 +- 3 files changed, 4701 insertions(+), 4694 deletions(-) diff --git a/abis/HorizonStaking.json b/abis/HorizonStaking.json index b1089b90..6472aeaa 100644 --- a/abis/HorizonStaking.json +++ b/abis/HorizonStaking.json @@ -1,2408 +1,2431 @@ [ { - "type": "constructor", - "inputs": [ - { - "name": "controller", - "type": "address", - "internalType": "address" - }, - { - "name": "stakingExtensionAddress", - "type": "address", - "internalType": "address" - }, - { - "name": "subgraphDataServiceAddress", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "fallback", - "stateMutability": "nonpayable" - }, - { - "type": "receive", - "stateMutability": "payable" - }, - { - "type": "function", - "name": "acceptProvisionParameters", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "acceptProxy", - "inputs": [ - { - "name": "_proxy", - "type": "address", - "internalType": "contract IGraphProxy" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "acceptProxyAndCall", - "inputs": [ - { - "name": "_proxy", - "type": "address", - "internalType": "contract IGraphProxy" - }, - { - "name": "_data", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "addToDelegationPool", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "addToProvision", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "clearThawingPeriod", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "delegate", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "delegate", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "minSharesOut", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "deprovision", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "nThawRequests", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "getDelegatedTokensAvailable", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getDelegation", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "delegator", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct IHorizonStakingTypes.Delegation", - "components": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getDelegationFeeCut", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "paymentType", - "type": "uint8", - "internalType": "enum IGraphPayments.PaymentTypes" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getDelegationPool", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct IHorizonStakingTypes.DelegationPool", - "components": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokensThawing", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "sharesThawing", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "thawingNonce", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getIdleStake", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getMaxThawingPeriod", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint64", - "internalType": "uint64" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getProviderTokensAvailable", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getProvision", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct IHorizonStakingTypes.Provision", - "components": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokensThawing", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "sharesThawing", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "maxVerifierCut", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "thawingPeriod", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "createdAt", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "maxVerifierCutPending", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "thawingPeriodPending", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "thawingNonce", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getServiceProvider", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct IHorizonStakingTypes.ServiceProvider", - "components": [ - { - "name": "tokensStaked", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokensProvisioned", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getStake", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getThawRequest", - "inputs": [ - { - "name": "requestType", - "type": "uint8", - "internalType": "enum IHorizonStakingTypes.ThawRequestType" - }, - { - "name": "thawRequestId", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct IHorizonStakingTypes.ThawRequest", - "components": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "thawingUntil", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "next", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "thawingNonce", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getThawRequestList", - "inputs": [ - { - "name": "requestType", - "type": "uint8", - "internalType": "enum IHorizonStakingTypes.ThawRequestType" - }, - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct LinkedList.List", - "components": [ - { - "name": "head", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "tail", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "count", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getThawedTokens", - "inputs": [ - { - "name": "requestType", - "type": "uint8", - "internalType": "enum IHorizonStakingTypes.ThawRequestType" - }, - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getTokensAvailable", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "delegationRatio", - "type": "uint32", - "internalType": "uint32" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "isAllowedLockedVerifier", - "inputs": [ - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "isAuthorized", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "operator", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "isDelegationSlashingEnabled", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "multicall", - "inputs": [ - { - "name": "data", - "type": "bytes[]", - "internalType": "bytes[]" - } - ], - "outputs": [ - { - "name": "results", - "type": "bytes[]", - "internalType": "bytes[]" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "provision", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "maxVerifierCut", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "thawingPeriod", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "provisionLocked", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "maxVerifierCut", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "thawingPeriod", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "redelegate", - "inputs": [ - { - "name": "oldServiceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "oldVerifier", - "type": "address", - "internalType": "address" - }, - { - "name": "newServiceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "newVerifier", - "type": "address", - "internalType": "address" - }, - { - "name": "minSharesForNewProvider", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "nThawRequests", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "reprovision", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "oldVerifier", - "type": "address", - "internalType": "address" - }, - { - "name": "newVerifier", - "type": "address", - "internalType": "address" - }, - { - "name": "nThawRequests", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setAllowedLockedVerifier", - "inputs": [ - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "allowed", - "type": "bool", - "internalType": "bool" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setDelegationFeeCut", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "paymentType", - "type": "uint8", - "internalType": "enum IGraphPayments.PaymentTypes" - }, - { - "name": "feeCut", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setDelegationSlashingEnabled", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setMaxThawingPeriod", - "inputs": [ - { - "name": "maxThawingPeriod", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setOperator", - "inputs": [ - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "operator", - "type": "address", - "internalType": "address" - }, - { - "name": "allowed", - "type": "bool", - "internalType": "bool" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setOperatorLocked", - "inputs": [ - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "operator", - "type": "address", - "internalType": "address" - }, - { - "name": "allowed", - "type": "bool", - "internalType": "bool" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setProvisionParameters", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "newMaxVerifierCut", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "newThawingPeriod", - "type": "uint64", - "internalType": "uint64" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "slash", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokensVerifier", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "verifierDestination", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "stake", - "inputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "stakeTo", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "stakeToProvision", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "thaw", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "undelegate", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "undelegate", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "unstake", - "inputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdraw", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawDelegated", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "nThawRequests", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "withdrawDelegated", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "event", - "name": "AllowedLockedVerifierSet", - "inputs": [ - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "allowed", - "type": "bool", - "indexed": false, - "internalType": "bool" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "DelegatedTokensWithdrawn", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "delegator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "DelegationFeeCutSet", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "paymentType", - "type": "uint8", - "indexed": true, - "internalType": "enum IGraphPayments.PaymentTypes" - }, - { - "name": "feeCut", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "DelegationSlashed", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "DelegationSlashingEnabled", - "inputs": [], - "anonymous": false - }, - { - "type": "event", - "name": "DelegationSlashingSkipped", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "GraphDirectoryInitialized", - "inputs": [ - { - "name": "graphToken", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "graphStaking", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "graphPayments", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphEscrow", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphController", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "graphEpochManager", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphRewardsManager", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphTokenGateway", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphProxyAdmin", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphCuration", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "HorizonStakeDeposited", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "HorizonStakeLocked", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "until", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "HorizonStakeWithdrawn", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "MaxThawingPeriodSet", - "inputs": [ - { - "name": "maxThawingPeriod", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "OperatorSet", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "operator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "allowed", - "type": "bool", - "indexed": false, - "internalType": "bool" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProvisionCreated", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "maxVerifierCut", - "type": "uint32", - "indexed": false, - "internalType": "uint32" - }, - { - "name": "thawingPeriod", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProvisionIncreased", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProvisionParametersSet", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "maxVerifierCut", - "type": "uint32", - "indexed": false, - "internalType": "uint32" - }, - { - "name": "thawingPeriod", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProvisionParametersStaged", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "maxVerifierCut", - "type": "uint32", - "indexed": false, - "internalType": "uint32" - }, - { - "name": "thawingPeriod", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProvisionSlashed", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProvisionThawed", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "StakeDelegatedWithdrawn", - "inputs": [ - { - "name": "indexer", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "delegator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ThawRequestCreated", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "shares", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "thawingUntil", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - }, - { - "name": "thawRequestId", - "type": "bytes32", - "indexed": false, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ThawRequestFulfilled", - "inputs": [ - { - "name": "thawRequestId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "shares", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "thawingUntil", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - }, - { - "name": "valid", - "type": "bool", - "indexed": false, - "internalType": "bool" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ThawRequestsFulfilled", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "owner", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "thawRequestsFulfilled", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "requestType", - "type": "uint8", - "indexed": false, - "internalType": "enum IHorizonStakingTypes.ThawRequestType" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ThawingPeriodCleared", - "inputs": [], - "anonymous": false - }, - { - "type": "event", - "name": "TokensDelegated", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "delegator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "shares", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "TokensDeprovisioned", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "TokensToDelegationPoolAdded", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "TokensUndelegated", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "delegator", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "VerifierTokensSent", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "destination", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "error", - "name": "AddressEmptyCode", - "inputs": [ - { - "name": "target", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "FailedInnerCall", - "inputs": [] - }, - { - "type": "error", - "name": "GraphDirectoryInvalidZeroAddress", - "inputs": [ - { - "name": "contractName", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingCallerIsServiceProvider", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingInsufficientDelegationTokens", - "inputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "minTokens", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInsufficientIdleStake", - "inputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "minTokens", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInsufficientShares", - "inputs": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "minShares", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInsufficientStakeForLegacyAllocations", - "inputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "minTokens", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInsufficientTokens", - "inputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "minRequired", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInvalidDelegationFeeCut", - "inputs": [ - { - "name": "feeCut", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInvalidDelegationPool", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInvalidDelegationPoolState", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInvalidMaxVerifierCut", - "inputs": [ - { - "name": "maxVerifierCut", - "type": "uint32", - "internalType": "uint32" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInvalidProvision", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInvalidServiceProviderZeroAddress", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingInvalidThawRequestType", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingInvalidThawingPeriod", - "inputs": [ - { - "name": "thawingPeriod", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "maxThawingPeriod", - "type": "uint64", - "internalType": "uint64" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingInvalidVerifierZeroAddress", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingInvalidZeroShares", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingInvalidZeroTokens", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingNotAuthorized", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "verifier", - "type": "address", - "internalType": "address" - }, - { - "name": "caller", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingNothingThawing", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingProvisionAlreadyExists", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingSlippageProtection", - "inputs": [ - { - "name": "shares", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "minShares", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingStillThawing", - "inputs": [ - { - "name": "until", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingTooManyThawRequests", - "inputs": [] - }, - { - "type": "error", - "name": "HorizonStakingTooManyTokens", - "inputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "maxTokens", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "HorizonStakingVerifierNotAllowed", - "inputs": [ - { - "name": "verifier", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "LinkedListEmptyList", - "inputs": [] - }, - { - "type": "error", - "name": "LinkedListInvalidIterations", - "inputs": [] - }, - { - "type": "error", - "name": "LinkedListInvalidZeroId", - "inputs": [] - }, - { - "type": "error", - "name": "LinkedListMaxElementsExceeded", - "inputs": [] - }, - { - "type": "error", - "name": "ManagedIsPaused", - "inputs": [] - }, - { - "type": "error", - "name": "ManagedOnlyController", - "inputs": [] - }, - { - "type": "error", - "name": "ManagedOnlyGovernor", - "inputs": [] - }, - { - "type": "error", - "name": "PPMMathInvalidMulPPM", - "inputs": [ - { - "name": "a", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "b", - "type": "uint256", - "internalType": "uint256" - } - ] + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "address", + "name": "stakingExtensionAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "subgraphDataServiceAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingCallerIsServiceProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientDelegationTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientIdleStake", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientShares", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientStakeForLegacyAllocations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRequired", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "HorizonStakingInvalidDelegationFeeCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPoolState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + } + ], + "name": "HorizonStakingInvalidMaxVerifierCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidProvision", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidServiceProviderZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidThawRequestType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "HorizonStakingInvalidThawingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidVerifier", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidVerifierZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroShares", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "HorizonStakingNotAuthorized", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingProvisionAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingSlippageProtection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakingStillThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingTooManyThawRequests", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingTooManyTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingVerifierNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyController", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyGovernor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "AllowedLockedVerifierSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegatedTokensWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "DelegationFeeCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "DelegationSlashingEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashingSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "MaxThawingPeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "OperatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersStaged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionThawed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "StakeDelegatedWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "ThawRequestCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bool", + "name": "valid", + "type": "bool" + } + ], + "name": "ThawRequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawRequestsFulfilled", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ThawRequestsFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "ThawingPeriodCleared", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensDeprovisioned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensToDelegationPoolAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensUndelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "VerifierTokensSent", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "acceptProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToDelegationPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clearThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSharesOut", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "deprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegatedTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "delegator", + "type": "address" + } + ], + "name": "getDelegation", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Delegation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "getDelegationFeeCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegationPool", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.DelegationPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getIdleStake", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProviderTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProvision", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "createdAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "maxVerifierCutPending", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriodPending", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Provision", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getServiceProvider", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensProvisioned", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ServiceProvider", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "getThawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "next", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ThawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawRequestList", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "internalType": "struct LinkedList.List", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "getTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "isAllowedLockedVerifier", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDelegationSlashingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provisionLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minSharesForNewProvider", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "redelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "reprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setAllowedLockedVerifier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "setDelegationFeeCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setDelegationSlashingEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "setMaxThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperatorLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "newMaxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "newThawingPeriod", + "type": "uint64" + } + ], + "name": "setProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensVerifier", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifierDestination", + "type": "address" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "withdrawDelegated", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrawDelegated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" } -] \ No newline at end of file + ] \ No newline at end of file diff --git a/abis/SubgraphService.json b/abis/SubgraphService.json index 3da88ad2..f2ffdcc6 100644 --- a/abis/SubgraphService.json +++ b/abis/SubgraphService.json @@ -1,2287 +1,2271 @@ [ { - "type": "constructor", - "inputs": [ - { - "name": "graphController", - "type": "address", - "internalType": "address" - }, - { - "name": "disputeManager", - "type": "address", - "internalType": "address" - }, - { - "name": "tapCollector", - "type": "address", - "internalType": "address" - }, - { - "name": "curation", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "acceptProvisionPendingParameters", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "allocationProvisionTracker", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "claims", - "inputs": [ - { - "name": "claimId", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "createdAt", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "releasableAt", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "nextClaim", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "claimsLists", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "head", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "tail", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "nonce", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "count", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "closeStaleAllocation", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "collect", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "paymentType", - "type": "uint8", - "internalType": "enum IGraphPayments.PaymentTypes" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "curationFeesCut", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "delegationRatio", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint32", - "internalType": "uint32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "eip712Domain", - "inputs": [], - "outputs": [ - { - "name": "fields", - "type": "bytes1", - "internalType": "bytes1" - }, - { - "name": "name", - "type": "string", - "internalType": "string" - }, - { - "name": "version", - "type": "string", - "internalType": "string" - }, - { - "name": "chainId", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "verifyingContract", - "type": "address", - "internalType": "address" - }, - { - "name": "salt", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "extensions", - "type": "uint256[]", - "internalType": "uint256[]" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "encodeAllocationProof", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "feesProvisionTracker", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getAllocation", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct Allocation.State", - "components": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "subgraphDeploymentId", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "createdAt", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "closedAt", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "lastPOIPresentedAt", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "accRewardsPerAllocatedToken", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "accRewardsPending", - "type": "uint256", - "internalType": "uint256" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getAllocationData", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - }, - { - "name": "", - "type": "bytes32", - "internalType": "bytes32" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getDelegationRatio", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint32", - "internalType": "uint32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getLegacyAllocation", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "tuple", - "internalType": "struct LegacyAllocation.State", - "components": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "subgraphDeploymentId", - "type": "bytes32", - "internalType": "bytes32" - } - ] - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getProvisionTokensRange", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getSubgraphAllocatedTokens", - "inputs": [ - { - "name": "subgraphDeploymentId", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getThawingPeriodRange", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint64", - "internalType": "uint64" - }, - { - "name": "", - "type": "uint64", - "internalType": "uint64" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "getVerifierCutRange", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "", - "type": "uint32", - "internalType": "uint32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "indexers", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "registeredAt", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "url", - "type": "string", - "internalType": "string" - }, - { - "name": "geoHash", - "type": "string", - "internalType": "string" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "initialize", - "inputs": [ - { - "name": "minimumProvisionTokens", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "maximumDelegationRatio", - "type": "uint32", - "internalType": "uint32" - }, - { - "name": "stakeToFeesRatio", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "isActiveAllocation", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "isOverAllocated", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "isStaleAllocation", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "maxPOIStaleness", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "maximumProvisionTokens", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "maximumThawingPeriod", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint64", - "internalType": "uint64" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "maximumVerifierCut", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint32", - "internalType": "uint32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "migrateLegacyAllocation", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "internalType": "address" - }, - { - "name": "subgraphDeploymentID", - "type": "bytes32", - "internalType": "bytes32" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "minimumProvisionTokens", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "minimumThawingPeriod", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint64", - "internalType": "uint64" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "minimumVerifierCut", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint32", - "internalType": "uint32" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "multicall", - "inputs": [ - { - "name": "data", - "type": "bytes[]", - "internalType": "bytes[]" - } - ], - "outputs": [ - { - "name": "results", - "type": "bytes[]", - "internalType": "bytes[]" - } - ], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "owner", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "pause", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "pauseGuardians", - "inputs": [ - { - "name": "pauseGuardian", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "allowed", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "paused", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "bool", - "internalType": "bool" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "register", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "releaseStake", - "inputs": [ - { - "name": "numClaimsToRelease", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "renounceOwnership", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "resizeAllocation", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "rewardsDestination", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - } - ], - "outputs": [ - { - "name": "destination", - "type": "address", - "internalType": "address" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "setCurationCut", - "inputs": [ - { - "name": "curationCut", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setDelegationRatio", - "inputs": [ - { - "name": "delegationRatio", - "type": "uint32", - "internalType": "uint32" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setMaxPOIStaleness", - "inputs": [ - { - "name": "maxPOIStaleness", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setMinimumProvisionTokens", - "inputs": [ - { - "name": "minimumProvisionTokens", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setPauseGuardian", - "inputs": [ - { - "name": "pauseGuardian", - "type": "address", - "internalType": "address" - }, - { - "name": "allowed", - "type": "bool", - "internalType": "bool" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setRewardsDestination", - "inputs": [ - { - "name": "rewardsDestination", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "setStakeToFeesRatio", - "inputs": [ - { - "name": "stakeToFeesRatio_", - "type": "uint256", - "internalType": "uint256" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "slash", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "stakeToFeesRatio", - "inputs": [], - "outputs": [ - { - "name": "", - "type": "uint256", - "internalType": "uint256" - } - ], - "stateMutability": "view" - }, - { - "type": "function", - "name": "startService", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "stopService", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "internalType": "bytes" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "transferOwnership", - "inputs": [ - { - "name": "newOwner", - "type": "address", - "internalType": "address" - } - ], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "function", - "name": "unpause", - "inputs": [], - "outputs": [], - "stateMutability": "nonpayable" - }, - { - "type": "event", - "name": "AllocationClosed", - "inputs": [ - { - "name": "indexer", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "subgraphDeploymentId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "AllocationCreated", - "inputs": [ - { - "name": "indexer", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "subgraphDeploymentId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "AllocationResized", - "inputs": [ - { - "name": "indexer", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "subgraphDeploymentId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "newTokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "oldTokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "CurationCutSet", - "inputs": [ - { - "name": "curationCut", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "DelegationRatioSet", - "inputs": [ - { - "name": "ratio", - "type": "uint32", - "indexed": false, - "internalType": "uint32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "EIP712DomainChanged", - "inputs": [], - "anonymous": false - }, - { - "type": "event", - "name": "GraphDirectoryInitialized", - "inputs": [ - { - "name": "graphToken", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "graphStaking", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "graphPayments", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphEscrow", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphController", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "graphEpochManager", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphRewardsManager", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphTokenGateway", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphProxyAdmin", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "graphCuration", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "IndexingRewardsCollected", - "inputs": [ - { - "name": "indexer", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "subgraphDeploymentId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "tokensRewards", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "tokensIndexerRewards", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "tokensDelegationRewards", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "poi", - "type": "bytes32", - "indexed": false, - "internalType": "bytes32" - }, - { - "name": "currentEpoch", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Initialized", - "inputs": [ - { - "name": "version", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "LegacyAllocationMigrated", - "inputs": [ - { - "name": "indexer", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "subgraphDeploymentId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "MaxPOIStalenessSet", - "inputs": [ - { - "name": "maxPOIStaleness", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "OwnershipTransferred", - "inputs": [ - { - "name": "previousOwner", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "newOwner", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "PauseGuardianSet", - "inputs": [ - { - "name": "account", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "allowed", - "type": "bool", - "indexed": false, - "internalType": "bool" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Paused", - "inputs": [ - { - "name": "account", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProvisionPendingParametersAccepted", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ProvisionTokensRangeSet", - "inputs": [ - { - "name": "min", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "max", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "QueryFeesCollected", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokensCollected", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "tokensCurators", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "RewardsDestinationSet", - "inputs": [ - { - "name": "indexer", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "rewardsDestination", - "type": "address", - "indexed": true, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ServicePaymentCollected", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "feeType", - "type": "uint8", - "indexed": true, - "internalType": "enum IGraphPayments.PaymentTypes" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ServiceProviderRegistered", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "indexed": false, - "internalType": "bytes" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ServiceProviderSlashed", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ServiceStarted", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "indexed": false, - "internalType": "bytes" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ServiceStopped", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "data", - "type": "bytes", - "indexed": false, - "internalType": "bytes" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "StakeClaimLocked", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "claimId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "unlockTimestamp", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "StakeClaimReleased", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "claimId", - "type": "bytes32", - "indexed": true, - "internalType": "bytes32" - }, - { - "name": "tokens", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "releasableAt", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "StakeClaimsReleased", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "indexed": true, - "internalType": "address" - }, - { - "name": "claimsCount", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - }, - { - "name": "tokensReleased", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "StakeToFeesRatioSet", - "inputs": [ - { - "name": "ratio", - "type": "uint256", - "indexed": false, - "internalType": "uint256" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "SubgraphServiceDirectoryInitialized", - "inputs": [ - { - "name": "subgraphService", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "disputeManager", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "tapCollector", - "type": "address", - "indexed": false, - "internalType": "address" - }, - { - "name": "curation", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "ThawingPeriodRangeSet", - "inputs": [ - { - "name": "min", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - }, - { - "name": "max", - "type": "uint64", - "indexed": false, - "internalType": "uint64" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "Unpaused", - "inputs": [ - { - "name": "account", - "type": "address", - "indexed": false, - "internalType": "address" - } - ], - "anonymous": false - }, - { - "type": "event", - "name": "VerifierCutRangeSet", - "inputs": [ - { - "name": "min", - "type": "uint32", - "indexed": false, - "internalType": "uint32" - }, - { - "name": "max", - "type": "uint32", - "indexed": false, - "internalType": "uint32" - } - ], - "anonymous": false - }, - { - "type": "error", - "name": "AddressEmptyCode", - "inputs": [ - { - "name": "target", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AllocationAlreadyExists", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AllocationClosed", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - }, - { - "name": "closedAt", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "AllocationDoesNotExist", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AllocationManagerAllocationClosed", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AllocationManagerAllocationSameSize", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - }, - { - "name": "tokens", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "AllocationManagerInvalidAllocationProof", - "inputs": [ - { - "name": "signer", - "type": "address", - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "AllocationManagerInvalidZeroAllocationId", - "inputs": [] - }, - { - "type": "error", - "name": "DataServiceFeesClaimNotFound", - "inputs": [ - { - "name": "claimId", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "DataServiceFeesZeroTokens", - "inputs": [] - }, - { - "type": "error", - "name": "DataServicePausableNotPauseGuardian", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "DataServicePausablePauseGuardianNoChange", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - }, - { - "name": "allowed", - "type": "bool", - "internalType": "bool" - } - ] - }, - { - "type": "error", - "name": "DirectoryNotDisputeManager", - "inputs": [ - { - "name": "caller", - "type": "address", - "internalType": "address" - }, - { - "name": "disputeManager", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ECDSAInvalidSignature", - "inputs": [] - }, - { - "type": "error", - "name": "ECDSAInvalidSignatureLength", - "inputs": [ - { - "name": "length", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ECDSAInvalidSignatureS", - "inputs": [ - { - "name": "s", - "type": "bytes32", - "internalType": "bytes32" - } - ] - }, - { - "type": "error", - "name": "EnforcedPause", - "inputs": [] - }, - { - "type": "error", - "name": "ExpectedPause", - "inputs": [] - }, - { - "type": "error", - "name": "FailedInnerCall", - "inputs": [] - }, - { - "type": "error", - "name": "GraphDirectoryInvalidZeroAddress", - "inputs": [ - { - "name": "contractName", - "type": "bytes", - "internalType": "bytes" - } - ] - }, - { - "type": "error", - "name": "InvalidInitialization", - "inputs": [] - }, - { - "type": "error", - "name": "LegacyAllocationAlreadyExists", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "LinkedListEmptyList", - "inputs": [] - }, - { - "type": "error", - "name": "LinkedListInvalidIterations", - "inputs": [] - }, - { - "type": "error", - "name": "LinkedListInvalidZeroId", - "inputs": [] - }, - { - "type": "error", - "name": "LinkedListMaxElementsExceeded", - "inputs": [] - }, - { - "type": "error", - "name": "NotInitializing", - "inputs": [] - }, - { - "type": "error", - "name": "OwnableInvalidOwner", - "inputs": [ - { - "name": "owner", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "OwnableUnauthorizedAccount", - "inputs": [ - { - "name": "account", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "PPMMathInvalidMulPPM", - "inputs": [ - { - "name": "a", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "b", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ProvisionManagerInvalidRange", - "inputs": [ - { - "name": "min", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "max", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ProvisionManagerInvalidValue", - "inputs": [ - { - "name": "message", - "type": "bytes", - "internalType": "bytes" - }, - { - "name": "value", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "min", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "max", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "ProvisionManagerNotAuthorized", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - }, - { - "name": "caller", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ProvisionManagerProvisionNotFound", - "inputs": [ - { - "name": "serviceProvider", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "ProvisionTrackerInsufficientTokens", - "inputs": [ - { - "name": "tokensAvailable", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "tokensRequired", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceAllocationIsAltruistic", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceAllocationNotAuthorized", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - }, - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceCannotForceCloseAllocation", - "inputs": [ - { - "name": "allocationId", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceEmptyGeohash", - "inputs": [] - }, - { - "type": "error", - "name": "SubgraphServiceEmptyUrl", - "inputs": [] - }, - { - "type": "error", - "name": "SubgraphServiceInconsistentCollection", - "inputs": [ - { - "name": "balanceBefore", - "type": "uint256", - "internalType": "uint256" - }, - { - "name": "balanceAfter", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceIndexerAlreadyRegistered", - "inputs": [] - }, - { - "type": "error", - "name": "SubgraphServiceIndexerMismatch", - "inputs": [ - { - "name": "providedIndexer", - "type": "address", - "internalType": "address" - }, - { - "name": "expectedIndexer", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceIndexerNotRegistered", - "inputs": [ - { - "name": "indexer", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceInvalidCurationCut", - "inputs": [ - { - "name": "curationCut", - "type": "uint256", - "internalType": "uint256" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceInvalidPaymentType", - "inputs": [ - { - "name": "paymentType", - "type": "uint8", - "internalType": "enum IGraphPayments.PaymentTypes" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceInvalidRAV", - "inputs": [ - { - "name": "ravIndexer", - "type": "address", - "internalType": "address" - }, - { - "name": "allocationIndexer", - "type": "address", - "internalType": "address" - } - ] - }, - { - "type": "error", - "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", - "inputs": [] + "inputs": [ + { + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerAllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationManagerAllocationSameSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerInvalidAllocationProof", + "type": "error" + }, + { + "inputs": [], + "name": "AllocationManagerInvalidZeroAllocationId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "DataServicePausableNotPauseGuardian", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "DataServicePausablePauseGuardianNoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + } + ], + "name": "DirectoryNotDisputeManager", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "LegacyAllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRequired", + "type": "uint256" + } + ], + "name": "ProvisionTrackerInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationIsAltruistic", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceCannotForceCloseAllocation", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyGeohash", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyUrl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + } + ], + "name": "SubgraphServiceInconsistentCollection", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceIndexerAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "providedIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerNotRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + } + ], + "name": "SubgraphServiceInvalidCollectionId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "SubgraphServiceInvalidCurationCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "SubgraphServiceInvalidPaymentType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ravIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceInvalidRAV", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "AllocationCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldTokens", + "type": "uint256" + } + ], + "name": "AllocationResized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "CurationCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensIndexerRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "IndexingRewardsCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "LegacyAllocationMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "MaxPOIStalenessSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "PauseGuardianSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCurators", + "type": "uint256" + } + ], + "name": "QueryFeesCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardsDestination", + "type": "address" + } + ], + "name": "RewardsDestinationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + } + ], + "name": "StakeToFeesRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "subgraphService", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "name": "SubgraphServiceDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "allocationProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nextClaim", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "claimsLists", + "outputs": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "closeStaleAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "curationFeesCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "delegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "encodeAllocationProof", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "feesProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPOIPresentedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + } + ], + "internalType": "struct Allocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getLegacyAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct LegacyAllocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "indexers", + "outputs": [ + { + "internalType": "uint256", + "name": "registeredAt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "string", + "name": "geoHash", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maximumDelegationRatio", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "stakeToFeesRatio", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "isOverAllocated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPOIStaleness", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maximumProvisionTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maximumThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maximumVerifierCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "migrateLegacyAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "minimumProvisionTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "minimumVerifierCut", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "pauseGuardians", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "resizeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "rewardsDestination", + "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "setCurationCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "setDelegationRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "setMaxPOIStaleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + } + ], + "name": "setMinimumProvisionTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "rewardsDestination", + "type": "address" + } + ], + "name": "setRewardsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "setStakeToFeesRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakeToFeesRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" } -] \ No newline at end of file + ] \ No newline at end of file diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 34b6d4a8..1c8d28b3 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -419,9 +419,9 @@ dataSources: handler: handleProvisionSlashed - event: ProvisionThawed(indexed address,indexed address,uint256) handler: handleProvisionThawed - - event: ThawRequestCreated(indexed address,indexed address,indexed address,uint256,uint64,bytes32) + - event: ThawRequestCreated(indexed uint8,indexed address,indexed address,address,uint256,uint64,bytes32) handler: handleThawRequestCreated - - event: ThawRequestFulfilled(indexed bytes32,uint256,uint256,uint64,bool) + - event: ThawRequestFulfilled(indexed uint8,indexed bytes32,uint256,uint256,uint64,bool) handler: handleThawRequestFulfilled - event: OperatorSet(indexed address,indexed address,indexed address,bool) handler: handleOperatorSet @@ -455,12 +455,12 @@ dataSources: handler: handleServiceProviderRegistered - event: RewardsDestinationSet(indexed address,indexed address) handler: handleRewardsDestinationSet - - event: AllocationClosed(indexed address,indexed address,indexed bytes32,uint256) - handler: handleAllocationClosed - - event: AllocationCreated(indexed address,indexed address,indexed bytes32,uint256) + - event: AllocationCreated(indexed address,indexed address,indexed bytes32,uint256,uint256) handler: handleAllocationCreated - event: AllocationResized(indexed address,indexed address,indexed bytes32,uint256,uint256) handler: handleAllocationResized + - event: AllocationClosed(indexed address,indexed address,indexed bytes32,uint256) + handler: handleAllocationClosed - kind: ethereum/contract name: Curation network: {{network}} From 1baf8e622c11a7160680a976a74a156fae01ced0 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Mon, 24 Feb 2025 04:05:33 -0300 Subject: [PATCH 03/16] feat: implemented AllocationCreated, Closed and Resized --- schema.graphql | 31 ++++++- src/mappings/helpers/helpers.ts | 3 + src/mappings/subgraphService.ts | 143 ++++++++++++++++++++++++++++++-- 3 files changed, 166 insertions(+), 11 deletions(-) diff --git a/schema.graphql b/schema.graphql index 543a342d..0ca6b80c 100644 --- a/schema.graphql +++ b/schema.graphql @@ -864,6 +864,15 @@ type Provision @entity { tokensProvisioned: BigInt! + tokensAllocated: BigInt! + + totalAllocationCount: BigInt! + + allocationCount: Int! + + "Active allocations of stake for this Provision" + allocations: [Allocation!]! @derivedFrom(field: "activeForProvision") + "Timestamp when the provision was created" createdAt: BigInt! @@ -934,17 +943,21 @@ type ThawRequest @entity { } """ -A state channel Allocation representing a single Indexer-SubgraphDeployment stake +A state channel Allocation representing a single Indexer/Provision-SubgraphDeployment stake """ type Allocation @entity { "Channel Address" id: ID! "Indexer of this allocation" indexer: Indexer! + "Provision of this allocation (for Horizon allocations only)" + provision: Provision "Creator of the allocation - can be the operator or the indexer" creator: Bytes! "If the Allocation is active it shows the indexer. If closed, it is null" activeForIndexer: Indexer + "If the Allocation is active it shows the provision. If closed, it is null" + activeForProvision: Provision "Subgraph deployment that is being allocated to" subgraphDeployment: SubgraphDeployment! "Tokens allocation in this allocation" @@ -987,10 +1000,12 @@ type Allocation @entity { createdAt: Int! "Timestamp this allocation was closed at" closedAt: Int - "POI submitted with a closed allocation" + "POI submitted when closing allocations in the legacy protocol. Also reflects the latest POI submitted for a Horizon payment collection" poi: Bytes + "POIs submitted when collecting payments in Horizon" + pois: [PoiSubmission!]! @derivedFrom(field: "allocation") - # Indexer cut settings at start and close + # Indexer/Provision cut settings at start and close indexingRewardCutAtStart: Int! indexingRewardEffectiveCutAtStart: BigDecimal! queryFeeCutAtStart: Int! @@ -1008,6 +1023,16 @@ type Allocation @entity { annualizedReturn: BigDecimal! } +type PoiSubmission @entity { + id: ID! + + allocation: Allocation! + + poi: Bytes! + + submittedAtEpoch: Int! +} + enum AllocationStatus { Null # == indexer == address(0) Active # == not Null && tokens > 0 # diff --git a/src/mappings/helpers/helpers.ts b/src/mappings/helpers/helpers.ts index 19cb75d2..2c5829c7 100644 --- a/src/mappings/helpers/helpers.ts +++ b/src/mappings/helpers/helpers.ts @@ -200,6 +200,9 @@ export function createOrLoadProvision(indexerAddress: Bytes, verifierAddress: By provision.indexer = indexerAddress.toHexString() provision.dataService = verifierAddress.toHexString() provision.tokensProvisioned = BigInt.fromI32(0) + provision.tokensAllocated = BigInt.fromI32(0) + provision.totalAllocationCount = BigInt.fromI32(0) + provision.allocationCount = 0 provision.tokensThawing = BigInt.fromI32(0) provision.createdAt = timestamp provision.maxVerifierCut = BigInt.fromI32(0) diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index 04c7a3c1..93608512 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -1,6 +1,8 @@ -import { ethereum, ValueKind, log } from "@graphprotocol/graph-ts" +import { BigDecimal, BigInt, ethereum, log } from "@graphprotocol/graph-ts" import { AllocationClosed, AllocationCreated, AllocationResized, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" -import { createOrLoadProvision } from "./helpers/helpers" +import { createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadProvision, createOrLoadSubgraphDeployment } from "./helpers/helpers" +import { Allocation, GraphAccount, Indexer } from "../types/schema" +import { addresses } from "../../config/addresses" export function handleServiceProviderRegistered(event: ServiceProviderRegistered): void { let decodedCalldata = ethereum.decode('(string,string,address)', event.params.data) @@ -21,22 +23,147 @@ export function handleRewardsDestinationSet(event: RewardsDestinationSet): void provision.save() } -export function handleAllocationClosed(event: AllocationClosed): void { +export function handleAllocationCreated(event: AllocationCreated): void { + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) + let subgraphDeploymentID = event.params.subgraphDeploymentId.toHexString() + let indexerID = event.params.indexer.toHexString() + let allocationID = event.params.allocationId.toHexString() + + // update indexer + let indexer = Indexer.load(indexerID)! + indexer.allocatedTokens = indexer.allocatedTokens.plus(event.params.tokens) + indexer.totalAllocationCount = indexer.totalAllocationCount.plus(BigInt.fromI32(1)) + indexer.allocationCount = indexer.allocationCount + 1 + indexer.save() + + // update provision let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) - // To Do + provision.tokensAllocated = provision.tokensAllocated.plus(event.params.tokens) + provision.totalAllocationCount = provision.totalAllocationCount.plus(BigInt.fromI32(1)) + provision.allocationCount = provision.allocationCount + 1 provision.save() + + // update graph network + graphNetwork.totalTokensAllocated = graphNetwork.totalTokensAllocated.plus(event.params.tokens) + graphNetwork.allocationCount = graphNetwork.allocationCount + 1 + graphNetwork.activeAllocationCount = graphNetwork.activeAllocationCount + 1 + graphNetwork.save() + + // update subgraph deployment + let deployment = createOrLoadSubgraphDeployment(subgraphDeploymentID, event.block.timestamp) + deployment.stakedTokens = deployment.stakedTokens.plus(event.params.tokens) + deployment.save() + + // create allocation + let allocation = new Allocation(allocationID) + allocation.indexer = indexerID + allocation.provision = provision.id + allocation.creator = event.transaction.from + allocation.activeForIndexer = indexerID + allocation.activeForProvision = provision.id + allocation.subgraphDeployment = subgraphDeploymentID + allocation.allocatedTokens = event.params.tokens + allocation.effectiveAllocation = BigInt.fromI32(0) + allocation.createdAtEpoch = event.params.currentEpoch.toI32() + allocation.createdAtBlockHash = event.block.hash + allocation.createdAtBlockNumber = ( + addresses.isL1 ? event.block.number : graphNetwork.currentL1BlockNumber! + ).toI32() + allocation.queryFeesCollected = BigInt.fromI32(0) + allocation.queryFeeRebates = BigInt.fromI32(0) + allocation.distributedRebates = BigInt.fromI32(0) + allocation.curatorRewards = BigInt.fromI32(0) + allocation.indexingRewards = BigInt.fromI32(0) + allocation.indexingIndexerRewards = BigInt.fromI32(0) + allocation.indexingDelegatorRewards = BigInt.fromI32(0) + allocation.delegationFees = BigInt.fromI32(0) + allocation.status = 'Active' + allocation.totalReturn = BigDecimal.fromString('0') + allocation.annualizedReturn = BigDecimal.fromString('0') + allocation.createdAt = event.block.timestamp.toI32() + allocation.indexingRewardCutAtStart = provision.indexingRewardsCut + allocation.indexingRewardEffectiveCutAtStart = provision.indexingRewardsCut.toBigDecimal() + allocation.queryFeeCutAtStart = provision.queryFeeCut + allocation.queryFeeEffectiveCutAtStart = provision.queryFeeCut.toBigDecimal() + allocation.save() } +export function handleAllocationClosed(event: AllocationClosed): void { + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) + let indexerID = event.params.indexer.toHexString() + let allocationID = event.params.allocationId.toHexString() -export function handleAllocationCreated(event: AllocationCreated): void { + // update indexer + let indexer = Indexer.load(indexerID)! + const indexerAccount = GraphAccount.load(indexer.account)! + const closedByIndexer = event.transaction.from == event.params.indexer + const closedByOperator = indexerAccount.operators.includes(event.transaction.from.toHexString()) + + if (!closedByIndexer && !closedByOperator) { + indexer.forcedClosures = indexer.forcedClosures + 1 + } + indexer.allocatedTokens = indexer.allocatedTokens.minus(event.params.tokens) + indexer.allocationCount = indexer.allocationCount - 1 + indexer.save() + + // update provision let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) - // To Do + provision.tokensAllocated = provision.tokensAllocated.minus(event.params.tokens) + provision.allocationCount = provision.allocationCount - 1 provision.save() -} + // update allocation + let allocation = Allocation.load(allocationID)! + allocation.poolClosedIn = graphNetwork.currentEpoch + allocation.activeForIndexer = null + allocation.closedAtEpoch = graphNetwork.currentEpoch + allocation.closedAtBlockHash = event.block.hash + allocation.closedAtBlockNumber = ( + addresses.isL1 ? event.block.number : graphNetwork.currentL1BlockNumber! + ).toI32() + allocation.status = 'Closed' + allocation.closedAt = event.block.timestamp.toI32() + allocation.indexingRewardCutAtStart = provision.indexingRewardsCut + allocation.indexingRewardEffectiveCutAtStart = provision.indexingRewardsCut.toBigDecimal() + allocation.queryFeeCutAtStart = provision.queryFeeCut + allocation.queryFeeEffectiveCutAtStart = provision.queryFeeCut.toBigDecimal() + allocation.save() + + // update epoch - We do it here to have more epochs created, instead of seeing none created + // Likely this problem would go away with a live network with long epochs + let epoch = createOrLoadEpoch( + addresses.isL1 ? event.block.number : graphNetwork.currentL1BlockNumber!, + ) + epoch.save() + + let subgraphDeploymentID = event.params.subgraphDeploymentId.toHexString() + let deployment = createOrLoadSubgraphDeployment(subgraphDeploymentID, event.block.timestamp) + deployment.stakedTokens = deployment.stakedTokens.minus(event.params.tokens) + deployment.save() + + // update graph network + graphNetwork.activeAllocationCount = graphNetwork.activeAllocationCount - 1 + graphNetwork.totalTokensAllocated = graphNetwork.totalTokensAllocated.minus(event.params.tokens) + graphNetwork.save() +} export function handleAllocationResized(event: AllocationResized): void { + let allocationID = event.params.allocationId.toHexString() + let indexerID = event.params.indexer.toHexString() + let diffTokens = event.params.newTokens.minus(event.params.oldTokens) + + // update indexer + let indexer = Indexer.load(indexerID)! + indexer.allocatedTokens = indexer.allocatedTokens.plus(diffTokens) + indexer.save() + + // update provision let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) - // To Do + provision.tokensAllocated = provision.tokensAllocated.plus(diffTokens) provision.save() + + // update allocation + let allocation = Allocation.load(allocationID)! + allocation.allocatedTokens = event.params.newTokens + allocation.save() } From 196c28415786644f70a654e25e042f7e1627a91e Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Mon, 24 Feb 2025 04:17:01 -0300 Subject: [PATCH 04/16] fix: build issues --- src/mappings/subgraphService.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index 93608512..d0342038 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -81,9 +81,9 @@ export function handleAllocationCreated(event: AllocationCreated): void { allocation.totalReturn = BigDecimal.fromString('0') allocation.annualizedReturn = BigDecimal.fromString('0') allocation.createdAt = event.block.timestamp.toI32() - allocation.indexingRewardCutAtStart = provision.indexingRewardsCut + allocation.indexingRewardCutAtStart = provision.indexingRewardsCut.toI32() allocation.indexingRewardEffectiveCutAtStart = provision.indexingRewardsCut.toBigDecimal() - allocation.queryFeeCutAtStart = provision.queryFeeCut + allocation.queryFeeCutAtStart = provision.queryFeeCut.toI32() allocation.queryFeeEffectiveCutAtStart = provision.queryFeeCut.toBigDecimal() allocation.save() } @@ -114,7 +114,7 @@ export function handleAllocationClosed(event: AllocationClosed): void { // update allocation let allocation = Allocation.load(allocationID)! - allocation.poolClosedIn = graphNetwork.currentEpoch + allocation.poolClosedIn = graphNetwork.currentEpoch.toString() allocation.activeForIndexer = null allocation.closedAtEpoch = graphNetwork.currentEpoch allocation.closedAtBlockHash = event.block.hash @@ -123,9 +123,9 @@ export function handleAllocationClosed(event: AllocationClosed): void { ).toI32() allocation.status = 'Closed' allocation.closedAt = event.block.timestamp.toI32() - allocation.indexingRewardCutAtStart = provision.indexingRewardsCut + allocation.indexingRewardCutAtStart = provision.indexingRewardsCut.toI32() allocation.indexingRewardEffectiveCutAtStart = provision.indexingRewardsCut.toBigDecimal() - allocation.queryFeeCutAtStart = provision.queryFeeCut + allocation.queryFeeCutAtStart = provision.queryFeeCut.toI32() allocation.queryFeeEffectiveCutAtStart = provision.queryFeeCut.toBigDecimal() allocation.save() From ae3fefbdf4474821b413ddd9d00d176c1d33ae28 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Mon, 24 Feb 2025 04:27:07 -0300 Subject: [PATCH 05/16] chore: placeholder handler definition --- src/mappings/subgraphService.ts | 14 +++++++++++++- subgraph.template.yaml | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index d0342038..73d47f67 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -1,5 +1,5 @@ import { BigDecimal, BigInt, ethereum, log } from "@graphprotocol/graph-ts" -import { AllocationClosed, AllocationCreated, AllocationResized, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" +import { AllocationClosed, AllocationCreated, AllocationResized, IndexingRewardsCollected, QueryFeesCollected, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" import { createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadProvision, createOrLoadSubgraphDeployment } from "./helpers/helpers" import { Allocation, GraphAccount, Indexer } from "../types/schema" import { addresses } from "../../config/addresses" @@ -167,3 +167,15 @@ export function handleAllocationResized(event: AllocationResized): void { allocation.allocatedTokens = event.params.newTokens allocation.save() } + +export function handleIndexingRewardsCollected(event: IndexingRewardsCollected): void { + let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) + // To Do + provision.save() +} + +export function handleQueryFeesCollected(event: QueryFeesCollected): void { + let provision = createOrLoadProvision(event.params.serviceProvider, event.address, event.block.timestamp) + // To Do + provision.save() +} diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 1c8d28b3..18bfa2e0 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -461,6 +461,10 @@ dataSources: handler: handleAllocationResized - event: AllocationClosed(indexed address,indexed address,indexed bytes32,uint256) handler: handleAllocationClosed + - event: IndexingRewardsCollected(indexed address,indexed address,indexed bytes32,uint256,uint256,uint256,bytes32,uint256) + handler: handleIndexingRewardsCollected + - event: QueryFeesCollected(indexed address,uint256,uint256) + handler: handleQueryFeesCollected - kind: ethereum/contract name: Curation network: {{network}} From 1acabc205f8112336d01e44461cd1fc9dc393e2a Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Tue, 25 Feb 2025 02:04:27 -0300 Subject: [PATCH 06/16] feat: added indexing rewards collection handler --- schema.graphql | 8 ++++ src/mappings/horizonStaking.ts | 9 +++- src/mappings/subgraphService.ts | 76 ++++++++++++++++++++++++++++++--- 3 files changed, 86 insertions(+), 7 deletions(-) diff --git a/schema.graphql b/schema.graphql index 0ca6b80c..99e1dcfd 100644 --- a/schema.graphql +++ b/schema.graphql @@ -900,6 +900,14 @@ type Provision @entity { # Might want to add polymorphic handling of different fee cuts through a generic hashmap in the future + # Indexing rewards. Keeping the same naming from Indexer entity to make it easier to understand + "Total indexing rewards earned by this indexer. Including delegation rewards" + rewardsEarned: BigInt! + "The total amount of indexing rewards the indexer kept" + indexerIndexingRewards: BigInt! + "The total amount of indexing rewards given to delegators" + delegatorIndexingRewards: BigInt! + # Delegation "Tokens delegated to the provision" delegatedTokens: BigInt! diff --git a/src/mappings/horizonStaking.ts b/src/mappings/horizonStaking.ts index 0af83856..3253cea6 100644 --- a/src/mappings/horizonStaking.ts +++ b/src/mappings/horizonStaking.ts @@ -2,7 +2,7 @@ import { BigInt } from '@graphprotocol/graph-ts' import { addresses } from '../../config/addresses' import { DelegationFeeCutSet, HorizonStakeDeposited, HorizonStakeLocked, HorizonStakeWithdrawn, OperatorSet, TokensDeprovisioned, TokensToDelegationPoolAdded } from '../types/HorizonStaking/HorizonStaking' import { Indexer, ThawRequest } from '../types/schema' -import { createOrLoadDataService, createOrLoadEpoch, createOrLoadGraphAccount, createOrLoadGraphNetwork, createOrLoadIndexer, createOrLoadOperator, createOrLoadProvision } from './helpers/helpers' +import { createOrLoadDataService, createOrLoadEpoch, createOrLoadGraphAccount, createOrLoadGraphNetwork, createOrLoadIndexer, createOrLoadOperator, createOrLoadProvision, updateDelegationExchangeRate } from './helpers/helpers' import { ProvisionCreated, ProvisionIncreased, @@ -265,11 +265,18 @@ export function handleThawRequestFulfilled(event: ThawRequestFulfilled): void { } export function handleTokensToDelegationPoolAdded(event: TokensToDelegationPoolAdded): void { + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) let indexer = Indexer.load(event.params.serviceProvider.toHexString())! let provision = createOrLoadProvision(event.params.serviceProvider, event.params.verifier, event.block.timestamp) provision.delegatedTokens = provision.delegatedTokens.plus(event.params.tokens) provision.save() indexer.delegatedTokens = indexer.delegatedTokens.plus(event.params.tokens) // this only serves as a general tracker, but the real deal is per provision + if (indexer.delegatorShares != BigInt.fromI32(0)) { + indexer = updateDelegationExchangeRate(indexer as Indexer) + } indexer.save() + + graphNetwork.totalDelegatedTokens = graphNetwork.totalDelegatedTokens.plus(event.params.tokens) + graphNetwork.save() } \ No newline at end of file diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index 73d47f67..e1756e92 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -1,12 +1,12 @@ import { BigDecimal, BigInt, ethereum, log } from "@graphprotocol/graph-ts" import { AllocationClosed, AllocationCreated, AllocationResized, IndexingRewardsCollected, QueryFeesCollected, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" -import { createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadProvision, createOrLoadSubgraphDeployment } from "./helpers/helpers" -import { Allocation, GraphAccount, Indexer } from "../types/schema" +import { createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadProvision, createOrLoadSubgraphDeployment, joinID, updateDelegationExchangeRate } from "./helpers/helpers" +import { Allocation, GraphAccount, Indexer, PoiSubmission } from "../types/schema" import { addresses } from "../../config/addresses" export function handleServiceProviderRegistered(event: ServiceProviderRegistered): void { let decodedCalldata = ethereum.decode('(string,string,address)', event.params.data) - if( decodedCalldata != null && decodedCalldata.kind == ethereum.ValueKind.TUPLE) { + if (decodedCalldata != null && decodedCalldata.kind == ethereum.ValueKind.TUPLE) { let tupleData = decodedCalldata.toTuple() let provision = createOrLoadProvision(event.params.serviceProvider, event.address, event.block.timestamp) provision.url = tupleData[0].toString() @@ -169,13 +169,77 @@ export function handleAllocationResized(event: AllocationResized): void { } export function handleIndexingRewardsCollected(event: IndexingRewardsCollected): void { + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) + let indexerID = event.params.indexer.toHexString() + let allocationID = event.params.allocationId.toHexString() + + // update indexer + let indexer = Indexer.load(indexerID)! + indexer.rewardsEarned = indexer.rewardsEarned.plus(event.params.tokensRewards) + indexer.indexerIndexingRewards = indexer.indexerIndexingRewards.plus(event.params.tokensIndexerRewards) + indexer.delegatorIndexingRewards = indexer.delegatorIndexingRewards.plus(event.params.tokensDelegationRewards) + indexer.save() + + // update provision let provision = createOrLoadProvision(event.params.indexer, event.address, event.block.timestamp) - // To Do + provision.rewardsEarned = provision.rewardsEarned.plus(event.params.tokensRewards) + provision.indexerIndexingRewards = provision.indexerIndexingRewards.plus(event.params.tokensIndexerRewards) + provision.delegatorIndexingRewards = provision.delegatorIndexingRewards.plus(event.params.tokensDelegationRewards) + // No need to update delegated tokens, as that happens in handleTokensToDelegationPoolAdded provision.save() + + // update allocation + let allocation = Allocation.load(allocationID)! + allocation.indexingRewards = allocation.indexingRewards.plus(event.params.tokensRewards) + allocation.indexingIndexerRewards = allocation.indexingIndexerRewards.plus(event.params.tokensIndexerRewards) + allocation.indexingDelegatorRewards = allocation.indexingDelegatorRewards.plus( + event.params.tokensDelegationRewards, + ) + allocation.save() + + // Create PoI submission + let poiSubmission = new PoiSubmission(joinID([event.transaction.hash.toHexString(), event.logIndex.toString()])) + poiSubmission.allocation = allocation.id + poiSubmission.poi = event.params.poi + poiSubmission.submittedAtEpoch = event.params.currentEpoch.toI32() + poiSubmission.save() + + // Update epoch + let epoch = createOrLoadEpoch((addresses.isL1 ? event.block.number : graphNetwork.currentL1BlockNumber!)) + epoch.totalRewards = epoch.totalRewards.plus(event.params.tokensRewards) + epoch.totalIndexerRewards = epoch.totalIndexerRewards.plus(event.params.tokensIndexerRewards) + epoch.totalDelegatorRewards = epoch.totalDelegatorRewards.plus(event.params.tokensDelegationRewards) + epoch.save() + + // update subgraph deployment + let subgraphDeploymentID = allocation.subgraphDeployment + let subgraphDeployment = createOrLoadSubgraphDeployment( + subgraphDeploymentID, + event.block.timestamp, + ) + subgraphDeployment.indexingRewardAmount = subgraphDeployment.indexingRewardAmount.plus( + event.params.tokensRewards, + ) + subgraphDeployment.indexingIndexerRewardAmount = subgraphDeployment.indexingIndexerRewardAmount.plus( + event.params.tokensIndexerRewards, + ) + subgraphDeployment.indexingDelegatorRewardAmount = subgraphDeployment.indexingDelegatorRewardAmount.plus( + event.params.tokensDelegationRewards, + ) + subgraphDeployment.save() + + // update graph network + graphNetwork.totalIndexingRewards = graphNetwork.totalIndexingRewards.plus(event.params.tokensRewards) + graphNetwork.totalIndexingIndexerRewards = graphNetwork.totalIndexingIndexerRewards.plus( + event.params.tokensIndexerRewards, + ) + graphNetwork.totalIndexingDelegatorRewards = graphNetwork.totalIndexingDelegatorRewards.plus( + event.params.tokensDelegationRewards, + ) + // No need to update delegated tokens, as that happens in handleTokensToDelegationPoolAdded + graphNetwork.save() } export function handleQueryFeesCollected(event: QueryFeesCollected): void { - let provision = createOrLoadProvision(event.params.serviceProvider, event.address, event.block.timestamp) // To Do - provision.save() } From 2a989c9d558e5159a7efde7fe19c8c971b1bb781 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Wed, 26 Feb 2025 04:10:35 -0300 Subject: [PATCH 07/16] feat: add QueryFeesCollected support --- abis/HorizonStaking.json | 4860 +++++++++++++++---------------- abis/SubgraphService.json | 4511 ++++++++++++++-------------- schema.graphql | 4 + src/mappings/subgraphService.ts | 71 +- subgraph.template.yaml | 2 +- 5 files changed, 4745 insertions(+), 4703 deletions(-) diff --git a/abis/HorizonStaking.json b/abis/HorizonStaking.json index 6472aeaa..67eb616b 100644 --- a/abis/HorizonStaking.json +++ b/abis/HorizonStaking.json @@ -1,2431 +1,2431 @@ [ - { - "inputs": [ - { - "internalType": "address", - "name": "controller", - "type": "address" - }, - { - "internalType": "address", - "name": "stakingExtensionAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "subgraphDataServiceAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [], - "name": "FailedInnerCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "contractName", - "type": "bytes" - } - ], - "name": "GraphDirectoryInvalidZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingCallerIsServiceProvider", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minTokens", - "type": "uint256" - } - ], - "name": "HorizonStakingInsufficientDelegationTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minTokens", - "type": "uint256" - } - ], - "name": "HorizonStakingInsufficientIdleStake", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShares", - "type": "uint256" - } - ], - "name": "HorizonStakingInsufficientShares", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minTokens", - "type": "uint256" - } - ], - "name": "HorizonStakingInsufficientStakeForLegacyAllocations", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minRequired", - "type": "uint256" - } - ], - "name": "HorizonStakingInsufficientTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "feeCut", - "type": "uint256" - } - ], - "name": "HorizonStakingInvalidDelegationFeeCut", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "HorizonStakingInvalidDelegationPool", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "HorizonStakingInvalidDelegationPoolState", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "maxVerifierCut", - "type": "uint32" - } - ], - "name": "HorizonStakingInvalidMaxVerifierCut", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "HorizonStakingInvalidProvision", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingInvalidServiceProviderZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingInvalidThawRequestType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "thawingPeriod", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "maxThawingPeriod", - "type": "uint64" - } - ], - "name": "HorizonStakingInvalidThawingPeriod", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "HorizonStakingInvalidVerifier", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingInvalidVerifierZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingInvalidZeroShares", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingInvalidZeroTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "HorizonStakingNotAuthorized", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingNothingThawing", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingProvisionAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minShares", - "type": "uint256" - } - ], - "name": "HorizonStakingSlippageProtection", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "until", - "type": "uint256" - } - ], - "name": "HorizonStakingStillThawing", - "type": "error" - }, - { - "inputs": [], - "name": "HorizonStakingTooManyThawRequests", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "maxTokens", - "type": "uint256" - } - ], - "name": "HorizonStakingTooManyTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "HorizonStakingVerifierNotAllowed", - "type": "error" - }, - { - "inputs": [], - "name": "LinkedListEmptyList", - "type": "error" - }, - { - "inputs": [], - "name": "LinkedListInvalidIterations", - "type": "error" - }, - { - "inputs": [], - "name": "LinkedListInvalidZeroId", - "type": "error" - }, - { - "inputs": [], - "name": "LinkedListMaxElementsExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "ManagedIsPaused", - "type": "error" - }, - { - "inputs": [], - "name": "ManagedOnlyController", - "type": "error" - }, - { - "inputs": [], - "name": "ManagedOnlyGovernor", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "a", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "b", - "type": "uint256" - } - ], - "name": "PPMMathInvalidMulPPM", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "AllowedLockedVerifierSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "DelegatedTokensWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": true, - "internalType": "enum IGraphPayments.PaymentTypes", - "name": "paymentType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "feeCut", - "type": "uint256" - } - ], - "name": "DelegationFeeCutSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "DelegationSlashed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "DelegationSlashingEnabled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "DelegationSlashingSkipped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "graphToken", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "graphStaking", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphPayments", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphEscrow", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "graphController", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphEpochManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphRewardsManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphTokenGateway", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphProxyAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphCuration", - "type": "address" - } - ], - "name": "GraphDirectoryInitialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "HorizonStakeDeposited", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "until", - "type": "uint256" - } - ], - "name": "HorizonStakeLocked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "HorizonStakeWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "maxThawingPeriod", - "type": "uint64" - } - ], - "name": "MaxThawingPeriodSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "OperatorSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "maxVerifierCut", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "thawingPeriod", - "type": "uint64" - } - ], - "name": "ProvisionCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "ProvisionIncreased", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "maxVerifierCut", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "thawingPeriod", - "type": "uint64" - } - ], - "name": "ProvisionParametersSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "maxVerifierCut", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "thawingPeriod", - "type": "uint64" - } - ], - "name": "ProvisionParametersStaged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "ProvisionSlashed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "ProvisionThawed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "StakeDelegatedWithdrawn", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum IHorizonStakingTypes.ThawRequestType", - "name": "requestType", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "thawingUntil", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "thawRequestId", - "type": "bytes32" - } - ], - "name": "ThawRequestCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum IHorizonStakingTypes.ThawRequestType", - "name": "requestType", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "thawRequestId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "thawingUntil", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "bool", - "name": "valid", - "type": "bool" - } - ], - "name": "ThawRequestFulfilled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "enum IHorizonStakingTypes.ThawRequestType", - "name": "requestType", - "type": "uint8" - }, - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "thawRequestsFulfilled", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "ThawRequestsFulfilled", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "ThawingPeriodCleared", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "TokensDelegated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "TokensDeprovisioned", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "TokensToDelegationPoolAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "delegator", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "TokensUndelegated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "VerifierTokensSent", - "type": "event" - }, - { - "stateMutability": "nonpayable", - "type": "fallback" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - } - ], - "name": "acceptProvisionParameters", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IGraphProxy", - "name": "_proxy", - "type": "address" - } - ], - "name": "acceptProxy", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IGraphProxy", - "name": "_proxy", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "name": "acceptProxyAndCall", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "addToDelegationPool", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "addToProvision", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "clearThawingPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "delegate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minSharesOut", - "type": "uint256" - } - ], - "name": "delegate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nThawRequests", - "type": "uint256" - } - ], - "name": "deprovision", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "getDelegatedTokensAvailable", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "address", - "name": "delegator", - "type": "address" - } - ], - "name": "getDelegation", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "internalType": "struct IHorizonStakingTypes.Delegation", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "enum IGraphPayments.PaymentTypes", - "name": "paymentType", - "type": "uint8" - } - ], - "name": "getDelegationFeeCut", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "getDelegationPool", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensThawing", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sharesThawing", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "thawingNonce", - "type": "uint256" - } - ], - "internalType": "struct IHorizonStakingTypes.DelegationPool", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - } - ], - "name": "getIdleStake", - "outputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getMaxThawingPeriod", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "getProviderTokensAvailable", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "getProvision", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensThawing", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "sharesThawing", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "maxVerifierCut", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "thawingPeriod", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "createdAt", - "type": "uint64" - }, - { - "internalType": "uint32", - "name": "maxVerifierCutPending", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "thawingPeriodPending", - "type": "uint64" - }, - { - "internalType": "uint256", - "name": "thawingNonce", - "type": "uint256" - } - ], - "internalType": "struct IHorizonStakingTypes.Provision", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - } - ], - "name": "getServiceProvider", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "tokensStaked", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensProvisioned", - "type": "uint256" - } - ], - "internalType": "struct IHorizonStakingTypes.ServiceProvider", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - } - ], - "name": "getStake", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum IHorizonStakingTypes.ThawRequestType", - "name": "requestType", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "thawRequestId", - "type": "bytes32" - } - ], - "name": "getThawRequest", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - }, - { - "internalType": "uint64", - "name": "thawingUntil", - "type": "uint64" - }, - { - "internalType": "bytes32", - "name": "next", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "thawingNonce", - "type": "uint256" - } - ], - "internalType": "struct IHorizonStakingTypes.ThawRequest", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum IHorizonStakingTypes.ThawRequestType", - "name": "requestType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getThawRequestList", - "outputs": [ - { - "components": [ - { - "internalType": "bytes32", - "name": "head", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "tail", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "internalType": "struct LinkedList.List", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "enum IHorizonStakingTypes.ThawRequestType", - "name": "requestType", - "type": "uint8" - }, - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getThawedTokens", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint32", - "name": "delegationRatio", - "type": "uint32" - } - ], - "name": "getTokensAvailable", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "isAllowedLockedVerifier", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "isDelegationSlashingEnabled", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "maxVerifierCut", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "thawingPeriod", - "type": "uint64" - } - ], - "name": "provision", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "maxVerifierCut", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "thawingPeriod", - "type": "uint64" - } - ], - "name": "provisionLocked", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "oldServiceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "oldVerifier", - "type": "address" - }, - { - "internalType": "address", - "name": "newServiceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "newVerifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "minSharesForNewProvider", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "nThawRequests", - "type": "uint256" - } - ], - "name": "redelegate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "oldVerifier", - "type": "address" - }, - { - "internalType": "address", - "name": "newVerifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nThawRequests", - "type": "uint256" - } - ], - "name": "reprovision", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "setAllowedLockedVerifier", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "enum IGraphPayments.PaymentTypes", - "name": "paymentType", - "type": "uint8" - }, - { - "internalType": "uint256", - "name": "feeCut", - "type": "uint256" - } - ], - "name": "setDelegationFeeCut", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "setDelegationSlashingEnabled", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint64", - "name": "maxThawingPeriod", - "type": "uint64" - } - ], - "name": "setMaxThawingPeriod", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "setOperator", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "setOperatorLocked", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint32", - "name": "newMaxVerifierCut", - "type": "uint32" - }, - { - "internalType": "uint64", - "name": "newThawingPeriod", - "type": "uint64" - } - ], - "name": "setProvisionParameters", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensVerifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "verifierDestination", - "type": "address" - } - ], - "name": "slash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "stake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "stakeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "stakeToProvision", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "thaw", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "undelegate", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "shares", - "type": "uint256" - } - ], - "name": "undelegate", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "unstake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "withdraw", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "verifier", - "type": "address" - }, - { - "internalType": "uint256", - "name": "nThawRequests", - "type": "uint256" - } - ], - "name": "withdrawDelegated", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "withdrawDelegated", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ] \ No newline at end of file + { + "inputs": [ + { + "internalType": "address", + "name": "controller", + "type": "address" + }, + { + "internalType": "address", + "name": "stakingExtensionAddress", + "type": "address" + }, + { + "internalType": "address", + "name": "subgraphDataServiceAddress", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingCallerIsServiceProvider", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientDelegationTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientIdleStake", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientShares", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientStakeForLegacyAllocations", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minRequired", + "type": "uint256" + } + ], + "name": "HorizonStakingInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "HorizonStakingInvalidDelegationFeeCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPool", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidDelegationPoolState", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + } + ], + "name": "HorizonStakingInvalidMaxVerifierCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidProvision", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidServiceProviderZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidThawRequestType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "HorizonStakingInvalidThawingPeriod", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingInvalidVerifier", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidVerifierZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroShares", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingInvalidZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "HorizonStakingNotAuthorized", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingNothingThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingProvisionAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minShares", + "type": "uint256" + } + ], + "name": "HorizonStakingSlippageProtection", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakingStillThawing", + "type": "error" + }, + { + "inputs": [], + "name": "HorizonStakingTooManyThawRequests", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "maxTokens", + "type": "uint256" + } + ], + "name": "HorizonStakingTooManyTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "HorizonStakingVerifierNotAllowed", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedIsPaused", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyController", + "type": "error" + }, + { + "inputs": [], + "name": "ManagedOnlyGovernor", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "AllowedLockedVerifierSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegatedTokensWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "DelegationFeeCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "DelegationSlashingEnabled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "DelegationSlashingSkipped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeDeposited", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "until", + "type": "uint256" + } + ], + "name": "HorizonStakeLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "HorizonStakeWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "MaxThawingPeriodSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "OperatorSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionIncreased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "ProvisionParametersStaged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ProvisionThawed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "StakeDelegatedWithdrawn", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "ThawRequestCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "bool", + "name": "valid", + "type": "bool" + } + ], + "name": "ThawRequestFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "thawRequestsFulfilled", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ThawRequestsFulfilled", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "ThawingPeriodCleared", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "TokensDelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensDeprovisioned", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensToDelegationPoolAdded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "delegator", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "TokensUndelegated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "destination", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "VerifierTokensSent", + "type": "event" + }, + { + "stateMutability": "nonpayable", + "type": "fallback" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "acceptProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + } + ], + "name": "acceptProxy", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract IGraphProxy", + "name": "_proxy", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "name": "acceptProxyAndCall", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToDelegationPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "addToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "clearThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "minSharesOut", + "type": "uint256" + } + ], + "name": "delegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "deprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegatedTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "delegator", + "type": "address" + } + ], + "name": "getDelegation", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Delegation", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "getDelegationFeeCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getDelegationPool", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.DelegationPool", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getIdleStake", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getMaxThawingPeriod", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProviderTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "getProvision", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensThawing", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "sharesThawing", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "createdAt", + "type": "uint64" + }, + { + "internalType": "uint32", + "name": "maxVerifierCutPending", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriodPending", + "type": "uint64" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.Provision", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getServiceProvider", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "tokensStaked", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensProvisioned", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ServiceProvider", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "getStake", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "bytes32", + "name": "thawRequestId", + "type": "bytes32" + } + ], + "name": "getThawRequest", + "outputs": [ + { + "components": [ + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + }, + { + "internalType": "uint64", + "name": "thawingUntil", + "type": "uint64" + }, + { + "internalType": "bytes32", + "name": "next", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "thawingNonce", + "type": "uint256" + } + ], + "internalType": "struct IHorizonStakingTypes.ThawRequest", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawRequestList", + "outputs": [ + { + "components": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "internalType": "struct LinkedList.List", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "enum IHorizonStakingTypes.ThawRequestType", + "name": "requestType", + "type": "uint8" + }, + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "getThawedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "getTokensAvailable", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + } + ], + "name": "isAllowedLockedVerifier", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + } + ], + "name": "isAuthorized", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "isDelegationSlashingEnabled", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "thawingPeriod", + "type": "uint64" + } + ], + "name": "provisionLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "oldServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newServiceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minSharesForNewProvider", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "redelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "oldVerifier", + "type": "address" + }, + { + "internalType": "address", + "name": "newVerifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "reprovision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setAllowedLockedVerifier", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "uint256", + "name": "feeCut", + "type": "uint256" + } + ], + "name": "setDelegationFeeCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "setDelegationSlashingEnabled", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint64", + "name": "maxThawingPeriod", + "type": "uint64" + } + ], + "name": "setMaxThawingPeriod", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperator", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "address", + "name": "operator", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setOperatorLocked", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint32", + "name": "newMaxVerifierCut", + "type": "uint32" + }, + { + "internalType": "uint64", + "name": "newThawingPeriod", + "type": "uint64" + } + ], + "name": "setProvisionParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensVerifier", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifierDestination", + "type": "address" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "stakeToProvision", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "thaw", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "shares", + "type": "uint256" + } + ], + "name": "undelegate", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "unstake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "verifier", + "type": "address" + }, + { + "internalType": "uint256", + "name": "nThawRequests", + "type": "uint256" + } + ], + "name": "withdrawDelegated", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "withdrawDelegated", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } +] \ No newline at end of file diff --git a/abis/SubgraphService.json b/abis/SubgraphService.json index f2ffdcc6..3fa424a0 100644 --- a/abis/SubgraphService.json +++ b/abis/SubgraphService.json @@ -1,2271 +1,2242 @@ [ - { - "inputs": [ - { - "internalType": "address", - "name": "graphController", - "type": "address" - }, - { - "internalType": "address", - "name": "disputeManager", - "type": "address" - }, - { - "internalType": "address", - "name": "graphTallyCollector", - "type": "address" - }, - { - "internalType": "address", - "name": "curation", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "target", - "type": "address" - } - ], - "name": "AddressEmptyCode", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "AllocationAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "internalType": "uint256", - "name": "closedAt", - "type": "uint256" - } - ], - "name": "AllocationClosed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "AllocationDoesNotExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "AllocationManagerAllocationClosed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "AllocationManagerAllocationSameSize", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "signer", - "type": "address" - }, - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "AllocationManagerInvalidAllocationProof", - "type": "error" - }, - { - "inputs": [], - "name": "AllocationManagerInvalidZeroAllocationId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "claimId", - "type": "bytes32" - } - ], - "name": "DataServiceFeesClaimNotFound", - "type": "error" - }, - { - "inputs": [], - "name": "DataServiceFeesZeroTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "DataServicePausableNotPauseGuardian", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "DataServicePausablePauseGuardianNoChange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "caller", - "type": "address" - }, - { - "internalType": "address", - "name": "disputeManager", - "type": "address" - } - ], - "name": "DirectoryNotDisputeManager", - "type": "error" - }, - { - "inputs": [], - "name": "ECDSAInvalidSignature", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "length", - "type": "uint256" - } - ], - "name": "ECDSAInvalidSignatureLength", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "ECDSAInvalidSignatureS", - "type": "error" - }, - { - "inputs": [], - "name": "EnforcedPause", - "type": "error" - }, - { - "inputs": [], - "name": "ExpectedPause", - "type": "error" - }, - { - "inputs": [], - "name": "FailedInnerCall", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "contractName", - "type": "bytes" - } - ], - "name": "GraphDirectoryInvalidZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "InvalidInitialization", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "LegacyAllocationAlreadyExists", - "type": "error" - }, - { - "inputs": [], - "name": "LinkedListEmptyList", - "type": "error" - }, - { - "inputs": [], - "name": "LinkedListInvalidIterations", - "type": "error" - }, - { - "inputs": [], - "name": "LinkedListInvalidZeroId", - "type": "error" - }, - { - "inputs": [], - "name": "LinkedListMaxElementsExceeded", - "type": "error" - }, - { - "inputs": [], - "name": "NotInitializing", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "OwnableInvalidOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "OwnableUnauthorizedAccount", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "a", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "b", - "type": "uint256" - } - ], - "name": "PPMMathInvalidMulPPM", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ProvisionManagerInvalidRange", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "message", - "type": "bytes" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ProvisionManagerInvalidValue", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "internalType": "address", - "name": "caller", - "type": "address" - } - ], - "name": "ProvisionManagerNotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - } - ], - "name": "ProvisionManagerProvisionNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "tokensAvailable", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "tokensRequired", - "type": "uint256" - } - ], - "name": "ProvisionTrackerInsufficientTokens", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "SubgraphServiceAllocationIsAltruistic", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "SubgraphServiceAllocationNotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "SubgraphServiceCannotForceCloseAllocation", - "type": "error" - }, - { - "inputs": [], - "name": "SubgraphServiceEmptyGeohash", - "type": "error" - }, - { - "inputs": [], - "name": "SubgraphServiceEmptyUrl", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "balanceBefore", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "balanceAfter", - "type": "uint256" - } - ], - "name": "SubgraphServiceInconsistentCollection", - "type": "error" - }, - { - "inputs": [], - "name": "SubgraphServiceIndexerAlreadyRegistered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "providedIndexer", - "type": "address" - }, - { - "internalType": "address", - "name": "expectedIndexer", - "type": "address" - } - ], - "name": "SubgraphServiceIndexerMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - } - ], - "name": "SubgraphServiceIndexerNotRegistered", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "collectionId", - "type": "bytes32" - } - ], - "name": "SubgraphServiceInvalidCollectionId", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "curationCut", - "type": "uint256" - } - ], - "name": "SubgraphServiceInvalidCurationCut", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "enum IGraphPayments.PaymentTypes", - "name": "paymentType", - "type": "uint8" - } - ], - "name": "SubgraphServiceInvalidPaymentType", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ravIndexer", - "type": "address" - }, - { - "internalType": "address", - "name": "allocationIndexer", - "type": "address" - } - ], - "name": "SubgraphServiceInvalidRAV", - "type": "error" - }, - { - "inputs": [], - "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "subgraphDeploymentId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "AllocationClosed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "subgraphDeploymentId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "currentEpoch", - "type": "uint256" - } - ], - "name": "AllocationCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "subgraphDeploymentId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "newTokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "oldTokens", - "type": "uint256" - } - ], - "name": "AllocationResized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "curationCut", - "type": "uint256" - } - ], - "name": "CurationCutSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "ratio", - "type": "uint32" - } - ], - "name": "DelegationRatioSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [], - "name": "EIP712DomainChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "graphToken", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "graphStaking", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphPayments", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphEscrow", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "graphController", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphEpochManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphRewardsManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphTokenGateway", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphProxyAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphCuration", - "type": "address" - } - ], - "name": "GraphDirectoryInitialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "subgraphDeploymentId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokensRewards", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokensIndexerRewards", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokensDelegationRewards", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "poi", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "currentEpoch", - "type": "uint256" - } - ], - "name": "IndexingRewardsCollected", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "version", - "type": "uint64" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "subgraphDeploymentId", - "type": "bytes32" - } - ], - "name": "LegacyAllocationMigrated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "maxPOIStaleness", - "type": "uint256" - } - ], - "name": "MaxPOIStalenessSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "PauseGuardianSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - } - ], - "name": "ProvisionPendingParametersAccepted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "name": "ProvisionTokensRangeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokensCollected", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokensCurators", - "type": "uint256" - } - ], - "name": "QueryFeesCollected", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "rewardsDestination", - "type": "address" - } - ], - "name": "RewardsDestinationSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "enum IGraphPayments.PaymentTypes", - "name": "feeType", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "ServicePaymentCollected", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "ServiceProviderRegistered", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "ServiceProviderSlashed", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "ServiceStarted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "ServiceStopped", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "claimId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "unlockTimestamp", - "type": "uint256" - } - ], - "name": "StakeClaimLocked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "claimId", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "releasableAt", - "type": "uint256" - } - ], - "name": "StakeClaimReleased", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "serviceProvider", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "claimsCount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "tokensReleased", - "type": "uint256" - } - ], - "name": "StakeClaimsReleased", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ratio", - "type": "uint256" - } - ], - "name": "StakeToFeesRatioSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "subgraphService", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "disputeManager", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "graphTallyCollector", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "curation", - "type": "address" - } - ], - "name": "SubgraphServiceDirectoryInitialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint64", - "name": "min", - "type": "uint64" - }, - { - "indexed": false, - "internalType": "uint64", - "name": "max", - "type": "uint64" - } - ], - "name": "ThawingPeriodRangeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint32", - "name": "min", - "type": "uint32" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "max", - "type": "uint32" - } - ], - "name": "VerifierCutRangeSet", - "type": "event" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "acceptProvisionPendingParameters", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - } - ], - "name": "allocationProvisionTracker", - "outputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "claimId", - "type": "bytes32" - } - ], - "name": "claims", - "outputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "releasableAt", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "nextClaim", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - } - ], - "name": "claimsLists", - "outputs": [ - { - "internalType": "bytes32", - "name": "head", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "tail", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "count", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "closeStaleAllocation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "enum IGraphPayments.PaymentTypes", - "name": "paymentType", - "type": "uint8" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "collect", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "curationFeesCut", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "delegationRatio", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "eip712Domain", - "outputs": [ - { - "internalType": "bytes1", - "name": "fields", - "type": "bytes1" - }, - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "version", - "type": "string" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "verifyingContract", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "salt", - "type": "bytes32" - }, - { - "internalType": "uint256[]", - "name": "extensions", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "encodeAllocationProof", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "serviceProvider", - "type": "address" - } - ], - "name": "feesProvisionTracker", - "outputs": [ - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "getAllocation", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "subgraphDeploymentId", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "closedAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastPOIPresentedAt", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "accRewardsPerAllocatedToken", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "accRewardsPending", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "createdAtEpoch", - "type": "uint256" - } - ], - "internalType": "struct Allocation.State", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "getAllocationData", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getDelegationRatio", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "allocationId", - "type": "address" - } - ], - "name": "getLegacyAllocation", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "subgraphDeploymentId", - "type": "bytes32" - } - ], - "internalType": "struct LegacyAllocation.State", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getProvisionTokensRange", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "subgraphDeploymentId", - "type": "bytes32" - } - ], - "name": "getSubgraphAllocatedTokens", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getThawingPeriodRange", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - }, - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifierCutRange", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - } - ], - "name": "indexers", - "outputs": [ - { - "internalType": "uint256", - "name": "registeredAt", - "type": "uint256" - }, - { - "internalType": "string", - "name": "url", - "type": "string" - }, - { - "internalType": "string", - "name": "geoHash", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minimumProvisionTokens", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "maximumDelegationRatio", - "type": "uint32" - }, - { - "internalType": "uint256", - "name": "stakeToFeesRatio", - "type": "uint256" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - } - ], - "name": "isOverAllocated", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maxPOIStaleness", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maximumProvisionTokens", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maximumThawingPeriod", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "maximumVerifierCut", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "subgraphDeploymentID", - "type": "bytes32" - } - ], - "name": "migrateLegacyAllocation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "minimumProvisionTokens", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minimumThawingPeriod", - "outputs": [ - { - "internalType": "uint64", - "name": "", - "type": "uint64" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "minimumVerifierCut", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes[]", - "name": "data", - "type": "bytes[]" - } - ], - "name": "multicall", - "outputs": [ - { - "internalType": "bytes[]", - "name": "results", - "type": "bytes[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pauseGuardian", - "type": "address" - } - ], - "name": "pauseGuardians", - "outputs": [ - { - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "register", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "numClaimsToRelease", - "type": "uint256" - } - ], - "name": "releaseStake", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "address", - "name": "allocationId", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokens", - "type": "uint256" - } - ], - "name": "resizeAllocation", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - } - ], - "name": "rewardsDestination", - "outputs": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "curationCut", - "type": "uint256" - } - ], - "name": "setCurationCut", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint32", - "name": "delegationRatio", - "type": "uint32" - } - ], - "name": "setDelegationRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "maxPOIStaleness", - "type": "uint256" - } - ], - "name": "setMaxPOIStaleness", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "minimumProvisionTokens", - "type": "uint256" - } - ], - "name": "setMinimumProvisionTokens", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "pauseGuardian", - "type": "address" - }, - { - "internalType": "bool", - "name": "allowed", - "type": "bool" - } - ], - "name": "setPauseGuardian", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "rewardsDestination", - "type": "address" - } - ], - "name": "setRewardsDestination", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "stakeToFeesRatio_", - "type": "uint256" - } - ], - "name": "setStakeToFeesRatio", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "slash", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "stakeToFeesRatio", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "startService", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "indexer", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "stopService", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ] \ No newline at end of file + { + "inputs": [ + { + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "target", + "type": "address" + } + ], + "name": "AddressEmptyCode", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationDoesNotExist", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerAllocationClosed", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationManagerAllocationSameSize", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "signer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "AllocationManagerInvalidAllocationProof", + "type": "error" + }, + { + "inputs": [], + "name": "AllocationManagerInvalidZeroAllocationId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "DataServiceFeesClaimNotFound", + "type": "error" + }, + { + "inputs": [], + "name": "DataServiceFeesZeroTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "DataServicePausableNotPauseGuardian", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "DataServicePausablePauseGuardianNoChange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "caller", + "type": "address" + }, + { + "internalType": "address", + "name": "disputeManager", + "type": "address" + } + ], + "name": "DirectoryNotDisputeManager", + "type": "error" + }, + { + "inputs": [], + "name": "ECDSAInvalidSignature", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "length", + "type": "uint256" + } + ], + "name": "ECDSAInvalidSignatureLength", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "s", + "type": "bytes32" + } + ], + "name": "ECDSAInvalidSignatureS", + "type": "error" + }, + { + "inputs": [], + "name": "EnforcedPause", + "type": "error" + }, + { + "inputs": [], + "name": "ExpectedPause", + "type": "error" + }, + { + "inputs": [], + "name": "FailedInnerCall", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "contractName", + "type": "bytes" + } + ], + "name": "GraphDirectoryInvalidZeroAddress", + "type": "error" + }, + { + "inputs": [], + "name": "InvalidInitialization", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "LegacyAllocationAlreadyExists", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListEmptyList", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidIterations", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListInvalidZeroId", + "type": "error" + }, + { + "inputs": [], + "name": "LinkedListMaxElementsExceeded", + "type": "error" + }, + { + "inputs": [], + "name": "NotInitializing", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + } + ], + "name": "OwnableInvalidOwner", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "OwnableUnauthorizedAccount", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "a", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "b", + "type": "uint256" + } + ], + "name": "PPMMathInvalidMulPPM", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidRange", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes", + "name": "message", + "type": "bytes" + }, + { + "internalType": "uint256", + "name": "value", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionManagerInvalidValue", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "internalType": "address", + "name": "caller", + "type": "address" + } + ], + "name": "ProvisionManagerNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionManagerProvisionNotFound", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "tokensAvailable", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "tokensRequired", + "type": "uint256" + } + ], + "name": "ProvisionTrackerInsufficientTokens", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationIsAltruistic", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceAllocationNotAuthorized", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "SubgraphServiceCannotForceCloseAllocation", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyGeohash", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceEmptyUrl", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "balanceBefore", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "balanceAfter", + "type": "uint256" + } + ], + "name": "SubgraphServiceInconsistentCollection", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceIndexerAlreadyRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "providedIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "expectedIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerMismatch", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "SubgraphServiceIndexerNotRegistered", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "collectionId", + "type": "bytes32" + } + ], + "name": "SubgraphServiceInvalidCollectionId", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "SubgraphServiceInvalidCurationCut", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + } + ], + "name": "SubgraphServiceInvalidPaymentType", + "type": "error" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "ravIndexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationIndexer", + "type": "address" + } + ], + "name": "SubgraphServiceInvalidRAV", + "type": "error" + }, + { + "inputs": [], + "name": "SubgraphServiceInvalidZeroStakeToFeesRatio", + "type": "error" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "AllocationClosed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "AllocationCreated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "newTokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "oldTokens", + "type": "uint256" + } + ], + "name": "AllocationResized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "CurationCutSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "ratio", + "type": "uint32" + } + ], + "name": "DelegationRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [], + "name": "EIP712DomainChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "graphToken", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphStaking", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphPayments", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEscrow", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "graphController", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphEpochManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphRewardsManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTokenGateway", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphProxyAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphCuration", + "type": "address" + } + ], + "name": "GraphDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensIndexerRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensDelegationRewards", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "poi", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "currentEpoch", + "type": "uint256" + } + ], + "name": "IndexingRewardsCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "version", + "type": "uint64" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "LegacyAllocationMigrated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "MaxPOIStalenessSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "account", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "PauseGuardianSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Paused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "ProvisionPendingParametersAccepted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "min", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "max", + "type": "uint256" + } + ], + "name": "ProvisionTokensRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "payer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCollected", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensCurators", + "type": "uint256" + } + ], + "name": "QueryFeesCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "rewardsDestination", + "type": "address" + } + ], + "name": "RewardsDestinationSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "feeType", + "type": "uint8" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServicePaymentCollected", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceProviderRegistered", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "ServiceProviderSlashed", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStarted", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "ServiceStopped", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "unlockTimestamp", + "type": "uint256" + } + ], + "name": "StakeClaimLocked", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": true, + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + } + ], + "name": "StakeClaimReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "serviceProvider", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "claimsCount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tokensReleased", + "type": "uint256" + } + ], + "name": "StakeClaimsReleased", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "ratio", + "type": "uint256" + } + ], + "name": "StakeToFeesRatioSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "subgraphService", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "disputeManager", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "graphTallyCollector", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "curation", + "type": "address" + } + ], + "name": "SubgraphServiceDirectoryInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint64", + "name": "min", + "type": "uint64" + }, + { + "indexed": false, + "internalType": "uint64", + "name": "max", + "type": "uint64" + } + ], + "name": "ThawingPeriodRangeSet", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + } + ], + "name": "Unpaused", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint32", + "name": "min", + "type": "uint32" + }, + { + "indexed": false, + "internalType": "uint32", + "name": "max", + "type": "uint32" + } + ], + "name": "VerifierCutRangeSet", + "type": "event" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "", + "type": "bytes" + } + ], + "name": "acceptProvisionPendingParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "allocationProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "claimId", + "type": "bytes32" + } + ], + "name": "claims", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "releasableAt", + "type": "uint256" + }, + { + "internalType": "bytes32", + "name": "nextClaim", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "claimsLists", + "outputs": [ + { + "internalType": "bytes32", + "name": "head", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "tail", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "nonce", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "count", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "closeStaleAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "enum IGraphPayments.PaymentTypes", + "name": "paymentType", + "type": "uint8" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "collect", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "curationFeesCut", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "eip712Domain", + "outputs": [ + { + "internalType": "bytes1", + "name": "fields", + "type": "bytes1" + }, + { + "internalType": "string", + "name": "name", + "type": "string" + }, + { + "internalType": "string", + "name": "version", + "type": "string" + }, + { + "internalType": "uint256", + "name": "chainId", + "type": "uint256" + }, + { + "internalType": "address", + "name": "verifyingContract", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "salt", + "type": "bytes32" + }, + { + "internalType": "uint256[]", + "name": "extensions", + "type": "uint256[]" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "encodeAllocationProof", + "outputs": [ + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "serviceProvider", + "type": "address" + } + ], + "name": "feesProvisionTracker", + "outputs": [ + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "closedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "lastPOIPresentedAt", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPerAllocatedToken", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "accRewardsPending", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "createdAtEpoch", + "type": "uint256" + } + ], + "internalType": "struct Allocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getAllocationData", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getCuration", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDelegationRatio", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getDisputeManager", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getGraphTallyCollector", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "allocationId", + "type": "address" + } + ], + "name": "getLegacyAllocation", + "outputs": [ + { + "components": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "internalType": "struct LegacyAllocation.State", + "name": "", + "type": "tuple" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getProvisionTokensRange", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes32", + "name": "subgraphDeploymentId", + "type": "bytes32" + } + ], + "name": "getSubgraphAllocatedTokens", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getThawingPeriodRange", + "outputs": [ + { + "internalType": "uint64", + "name": "", + "type": "uint64" + }, + { + "internalType": "uint64", + "name": "", + "type": "uint64" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "getVerifierCutRange", + "outputs": [ + { + "internalType": "uint32", + "name": "", + "type": "uint32" + }, + { + "internalType": "uint32", + "name": "", + "type": "uint32" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "indexers", + "outputs": [ + { + "internalType": "uint256", + "name": "registeredAt", + "type": "uint256" + }, + { + "internalType": "string", + "name": "url", + "type": "string" + }, + { + "internalType": "string", + "name": "geoHash", + "type": "string" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "owner", + "type": "address" + }, + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + }, + { + "internalType": "uint32", + "name": "maximumDelegationRatio", + "type": "uint32" + }, + { + "internalType": "uint256", + "name": "stakeToFeesRatio", + "type": "uint256" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "isOverAllocated", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "maxPOIStaleness", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "bytes32", + "name": "subgraphDeploymentID", + "type": "bytes32" + } + ], + "name": "migrateLegacyAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "bytes[]", + "name": "data", + "type": "bytes[]" + } + ], + "name": "multicall", + "outputs": [ + { + "internalType": "bytes[]", + "name": "results", + "type": "bytes[]" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + } + ], + "name": "pauseGuardians", + "outputs": [ + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "paused", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "register", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "numClaimsToRelease", + "type": "uint256" + } + ], + "name": "releaseStake", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "address", + "name": "allocationId", + "type": "address" + }, + { + "internalType": "uint256", + "name": "tokens", + "type": "uint256" + } + ], + "name": "resizeAllocation", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + } + ], + "name": "rewardsDestination", + "outputs": [ + { + "internalType": "address", + "name": "destination", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "curationCut", + "type": "uint256" + } + ], + "name": "setCurationCut", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint32", + "name": "delegationRatio", + "type": "uint32" + } + ], + "name": "setDelegationRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "maxPOIStaleness", + "type": "uint256" + } + ], + "name": "setMaxPOIStaleness", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "minimumProvisionTokens", + "type": "uint256" + } + ], + "name": "setMinimumProvisionTokens", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "pauseGuardian", + "type": "address" + }, + { + "internalType": "bool", + "name": "allowed", + "type": "bool" + } + ], + "name": "setPauseGuardian", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "rewardsDestination", + "type": "address" + } + ], + "name": "setRewardsDestination", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "stakeToFeesRatio_", + "type": "uint256" + } + ], + "name": "setStakeToFeesRatio", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "slash", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "stakeToFeesRatio", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "startService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "indexer", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "stopService", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + } +] \ No newline at end of file diff --git a/schema.graphql b/schema.graphql index 99e1dcfd..721ba75f 100644 --- a/schema.graphql +++ b/schema.graphql @@ -908,6 +908,10 @@ type Provision @entity { "The total amount of indexing rewards given to delegators" delegatorIndexingRewards: BigInt! + # Query fees + "Total query fees collected. Includes the portion given to delegators" + queryFeesCollected: BigInt! + # Delegation "Tokens delegated to the provision" delegatedTokens: BigInt! diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index e1756e92..7ef17c62 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -1,7 +1,7 @@ import { BigDecimal, BigInt, ethereum, log } from "@graphprotocol/graph-ts" import { AllocationClosed, AllocationCreated, AllocationResized, IndexingRewardsCollected, QueryFeesCollected, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" -import { createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadProvision, createOrLoadSubgraphDeployment, joinID, updateDelegationExchangeRate } from "./helpers/helpers" -import { Allocation, GraphAccount, Indexer, PoiSubmission } from "../types/schema" +import { batchUpdateSubgraphSignalledTokens, calculatePricePerShare, createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadIndexerQueryFeePaymentAggregation, createOrLoadPaymentSource, createOrLoadProvision, createOrLoadSubgraphDeployment, joinID, updateDelegationExchangeRate } from "./helpers/helpers" +import { Allocation, GraphAccount, Indexer, PoiSubmission, SubgraphDeployment } from "../types/schema" import { addresses } from "../../config/addresses" export function handleServiceProviderRegistered(event: ServiceProviderRegistered): void { @@ -242,4 +242,71 @@ export function handleIndexingRewardsCollected(event: IndexingRewardsCollected): export function handleQueryFeesCollected(event: QueryFeesCollected): void { // To Do + + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) + let subgraphDeploymentID = event.params.subgraphDeploymentId.toHexString() + let indexerID = event.params.serviceProvider.toHexString() + let allocationID = event.params.allocationId.toHexString() + let paymentAddress = event.params.payer + + // update indexer + let indexer = Indexer.load(indexerID)! + indexer.queryFeesCollected = indexer.queryFeesCollected.plus(event.params.tokensCollected) + indexer.save() + + // update provision + let provision = createOrLoadProvision(event.params.serviceProvider, event.address, event.block.timestamp) + provision.queryFeesCollected = provision.queryFeesCollected.plus(event.params.tokensCollected) + provision.save() + + // Replicate for payment source specific aggregation + let paymentAggregation = createOrLoadIndexerQueryFeePaymentAggregation(paymentAddress, event.params.serviceProvider) + paymentAggregation.queryFeesCollected = paymentAggregation.queryFeesCollected.plus(event.params.tokensCollected) + paymentAggregation.save() + + // update allocation + let allocation = Allocation.load(allocationID)! + allocation.queryFeesCollected = allocation.queryFeesCollected.plus(event.params.tokensCollected) + allocation.curatorRewards = allocation.curatorRewards.plus(event.params.tokensCurators) + allocation.save() + + // Update epoch + let epoch = createOrLoadEpoch( + addresses.isL1 ? event.block.number : graphNetwork.currentL1BlockNumber!, + ) + epoch.totalQueryFees = epoch.totalQueryFees.plus(event.params.tokensCollected).plus(event.params.tokensCurators) + epoch.queryFeesCollected = epoch.queryFeesCollected.plus(event.params.tokensCollected) + epoch.curatorQueryFees = epoch.curatorQueryFees.plus(event.params.tokensCurators) + epoch.save() + + // update subgraph deployment + let deployment = SubgraphDeployment.load(subgraphDeploymentID)! + deployment.queryFeesAmount = deployment.queryFeesAmount.plus(event.params.tokensCollected) + deployment.signalledTokens = deployment.signalledTokens.plus(event.params.tokensCurators) + deployment.curatorFeeRewards = deployment.curatorFeeRewards.plus(event.params.tokensCurators) + deployment.pricePerShare = calculatePricePerShare(deployment as SubgraphDeployment) + deployment.save() + + batchUpdateSubgraphSignalledTokens(deployment as SubgraphDeployment) + + // update graph network + graphNetwork.totalQueryFees = graphNetwork.totalQueryFees.plus(event.params.tokensCollected).plus(event.params.tokensCurators) + graphNetwork.totalIndexerQueryFeesCollected = graphNetwork.totalIndexerQueryFeesCollected.plus( + event.params.tokensCollected, + ) + graphNetwork.totalCuratorQueryFees = graphNetwork.totalCuratorQueryFees.plus( + event.params.tokensCurators, + ) + graphNetwork.save() + + // Replicate for payment source specific data + let paymentSource = createOrLoadPaymentSource(paymentAddress) + paymentSource.totalQueryFees = paymentSource.totalQueryFees.plus(event.params.tokensCollected).plus(event.params.tokensCurators) + paymentSource.totalIndexerQueryFeesCollected = paymentSource.totalIndexerQueryFeesCollected.plus( + event.params.tokensCollected, + ) + paymentSource.totalCuratorQueryFees = paymentSource.totalCuratorQueryFees.plus( + event.params.tokensCurators, + ) + paymentSource.save() } diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 18bfa2e0..96c7b177 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -463,7 +463,7 @@ dataSources: handler: handleAllocationClosed - event: IndexingRewardsCollected(indexed address,indexed address,indexed bytes32,uint256,uint256,uint256,bytes32,uint256) handler: handleIndexingRewardsCollected - - event: QueryFeesCollected(indexed address,uint256,uint256) + - event: QueryFeesCollected(indexed address,indexed address,indexed address,bytes32,uint256,uint256) handler: handleQueryFeesCollected - kind: ethereum/contract name: Curation From 9fbb6567f751be226a4aca3a155ad18718956f8e Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Thu, 27 Feb 2025 01:24:56 -0300 Subject: [PATCH 08/16] feat: added QueryFeesCollected handler with latest contract changes --- schema.graphql | 9 +++++-- src/mappings/helpers/helpers.ts | 1 + src/mappings/staking.ts | 2 ++ src/mappings/subgraphService.ts | 45 ++++++++++++++++++++++++++++----- 4 files changed, 48 insertions(+), 9 deletions(-) diff --git a/schema.graphql b/schema.graphql index 721ba75f..c12b4561 100644 --- a/schema.graphql +++ b/schema.graphql @@ -575,11 +575,12 @@ type SubgraphDeployment @entity { indexingDelegatorRewardAmount: BigInt! "Total query fees earned by this Subgraph Deployment, without curator query fees" queryFeesAmount: BigInt! - "Total query fee rebates earned from the protocol, through the rebates formula. Does not include delegation fees" + "Total query fee rebates earned from the protocol, through the rebates formula. Does not include delegation query fees" queryFeeRebates: BigInt! "Total curator rewards from fees" curatorFeeRewards: BigInt! - # TODO - We can add a field here for delegation fees earned when calling claim() + "Total query fee rebates earned from the protocol, through the rebates formula. Does not include indexer query fees" + delegatorsQueryFeeRebates: BigInt! # Subgraph deployment curation bonding curve "CURRENT signalled tokens in the bonding curve" @@ -911,6 +912,10 @@ type Provision @entity { # Query fees "Total query fees collected. Includes the portion given to delegators" queryFeesCollected: BigInt! + "Query fee amount collected from the protocol. Does not include portion given to delegators" + providerQueryFees: BigInt! + "Query fee amount collected from the protocol for Delegators. Does not include portion taken by the provider" + delegatorQueryFees: BigInt! # Delegation "Tokens delegated to the provision" diff --git a/src/mappings/helpers/helpers.ts b/src/mappings/helpers/helpers.ts index 2c5829c7..a70eef19 100644 --- a/src/mappings/helpers/helpers.ts +++ b/src/mappings/helpers/helpers.ts @@ -102,6 +102,7 @@ export function createOrLoadSubgraphDeployment( deployment.indexingDelegatorRewardAmount = BigInt.fromI32(0) deployment.queryFeesAmount = BigInt.fromI32(0) deployment.queryFeeRebates = BigInt.fromI32(0) + deployment.delegatorsQueryFeeRebates = BigInt.fromI32(0) deployment.curatorFeeRewards = BigInt.fromI32(0) deployment.signalledTokensReceivedOnL2 = BigInt.fromI32(0) deployment.signalledTokensSentToL2 = BigInt.fromI32(0) diff --git a/src/mappings/staking.ts b/src/mappings/staking.ts index a35d7b52..ab4a2c71 100644 --- a/src/mappings/staking.ts +++ b/src/mappings/staking.ts @@ -673,6 +673,7 @@ export function handleRebateClaimed(event: RebateClaimed): void { // update subgraph deployment let subgraphDeployment = SubgraphDeployment.load(subgraphDeploymentID)! subgraphDeployment.queryFeeRebates = subgraphDeployment.queryFeeRebates.plus(event.params.tokens) + subgraphDeployment.delegatorsQueryFeeRebates = subgraphDeployment.delegatorsQueryFeeRebates.plus(event.params.delegationFees) subgraphDeployment.save() // update graph network @@ -751,6 +752,7 @@ export function handleRebateCollected(event: RebateCollected): void { deployment.curatorFeeRewards = deployment.curatorFeeRewards.plus(event.params.curationFees) deployment.pricePerShare = calculatePricePerShare(deployment as SubgraphDeployment) deployment.queryFeeRebates = deployment.queryFeeRebates.plus(event.params.queryRebates) + deployment.delegatorsQueryFeeRebates = deployment.delegatorsQueryFeeRebates.plus(event.params.delegationRewards) deployment.save() batchUpdateSubgraphSignalledTokens(deployment as SubgraphDeployment) diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index 7ef17c62..dd27b7e0 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -241,33 +241,49 @@ export function handleIndexingRewardsCollected(event: IndexingRewardsCollected): } export function handleQueryFeesCollected(event: QueryFeesCollected): void { - // To Do - let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) let subgraphDeploymentID = event.params.subgraphDeploymentId.toHexString() let indexerID = event.params.serviceProvider.toHexString() let allocationID = event.params.allocationId.toHexString() let paymentAddress = event.params.payer - // update indexer - let indexer = Indexer.load(indexerID)! - indexer.queryFeesCollected = indexer.queryFeesCollected.plus(event.params.tokensCollected) - indexer.save() - // update provision let provision = createOrLoadProvision(event.params.serviceProvider, event.address, event.block.timestamp) + + let delegationPoolQueryFees = + provision.delegatedTokens == BigInt.fromI32(0) + ? event.params.tokensCollected + : event.params.tokensCollected + .times(provision.queryFeeCut) + .div(BigInt.fromI32(1000000)) + let indexerQueryFees = event.params.tokensCollected.minus(delegationPoolQueryFees) + provision.queryFeesCollected = provision.queryFeesCollected.plus(event.params.tokensCollected) + provision.providerQueryFees = provision.providerQueryFees.plus(indexerQueryFees) + provision.delegatorQueryFees = provision.delegatorQueryFees.plus(delegationPoolQueryFees) provision.save() + // update indexer + let indexer = Indexer.load(indexerID)! + indexer.queryFeesCollected = indexer.queryFeesCollected.plus(event.params.tokensCollected) + indexer.queryFeeRebates = indexer.queryFeeRebates.plus(indexerQueryFees) + indexer.delegatorQueryFees = indexer.delegatorQueryFees.plus(delegationPoolQueryFees) + indexer.save() + // Replicate for payment source specific aggregation let paymentAggregation = createOrLoadIndexerQueryFeePaymentAggregation(paymentAddress, event.params.serviceProvider) paymentAggregation.queryFeesCollected = paymentAggregation.queryFeesCollected.plus(event.params.tokensCollected) + paymentAggregation.queryFeeRebates = paymentAggregation.queryFeeRebates.plus(indexerQueryFees) + paymentAggregation.delegatorQueryFees = paymentAggregation.delegatorQueryFees.plus(delegationPoolQueryFees) paymentAggregation.save() // update allocation let allocation = Allocation.load(allocationID)! allocation.queryFeesCollected = allocation.queryFeesCollected.plus(event.params.tokensCollected) allocation.curatorRewards = allocation.curatorRewards.plus(event.params.tokensCurators) + allocation.queryFeeRebates = allocation.queryFeeRebates.plus(indexerQueryFees) + allocation.distributedRebates = allocation.distributedRebates.plus(event.params.tokensCollected) + allocation.delegationFees = allocation.delegationFees.plus(delegationPoolQueryFees) allocation.save() // Update epoch @@ -277,6 +293,7 @@ export function handleQueryFeesCollected(event: QueryFeesCollected): void { epoch.totalQueryFees = epoch.totalQueryFees.plus(event.params.tokensCollected).plus(event.params.tokensCurators) epoch.queryFeesCollected = epoch.queryFeesCollected.plus(event.params.tokensCollected) epoch.curatorQueryFees = epoch.curatorQueryFees.plus(event.params.tokensCurators) + epoch.queryFeeRebates = epoch.queryFeeRebates.plus(event.params.tokensCollected) epoch.save() // update subgraph deployment @@ -285,6 +302,8 @@ export function handleQueryFeesCollected(event: QueryFeesCollected): void { deployment.signalledTokens = deployment.signalledTokens.plus(event.params.tokensCurators) deployment.curatorFeeRewards = deployment.curatorFeeRewards.plus(event.params.tokensCurators) deployment.pricePerShare = calculatePricePerShare(deployment as SubgraphDeployment) + deployment.queryFeeRebates = deployment.queryFeeRebates.plus(indexerQueryFees) + deployment.delegatorsQueryFeeRebates = deployment.delegatorsQueryFeeRebates.plus(delegationPoolQueryFees) deployment.save() batchUpdateSubgraphSignalledTokens(deployment as SubgraphDeployment) @@ -297,6 +316,12 @@ export function handleQueryFeesCollected(event: QueryFeesCollected): void { graphNetwork.totalCuratorQueryFees = graphNetwork.totalCuratorQueryFees.plus( event.params.tokensCurators, ) + graphNetwork.totalIndexerQueryFeeRebates = graphNetwork.totalIndexerQueryFeeRebates.plus( + indexerQueryFees, + ) + graphNetwork.totalDelegatorQueryFeeRebates = graphNetwork.totalDelegatorQueryFeeRebates.plus( + delegationPoolQueryFees, + ) graphNetwork.save() // Replicate for payment source specific data @@ -308,5 +333,11 @@ export function handleQueryFeesCollected(event: QueryFeesCollected): void { paymentSource.totalCuratorQueryFees = paymentSource.totalCuratorQueryFees.plus( event.params.tokensCurators, ) + paymentSource.totalIndexerQueryFeeRebates = paymentSource.totalIndexerQueryFeeRebates.plus( + indexerQueryFees, + ) + paymentSource.totalDelegatorQueryFeeRebates = paymentSource.totalDelegatorQueryFeeRebates.plus( + delegationPoolQueryFees, + ) paymentSource.save() } From dd68cc19b50db1bff21c96d96a2195140d0b491a Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Thu, 27 Feb 2025 01:33:23 -0300 Subject: [PATCH 09/16] feat: add GraphPayments abi --- abis/GraphPayments.json | 317 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 317 insertions(+) create mode 100644 abis/GraphPayments.json diff --git a/abis/GraphPayments.json b/abis/GraphPayments.json new file mode 100644 index 00000000..156f9b05 --- /dev/null +++ b/abis/GraphPayments.json @@ -0,0 +1,317 @@ +[ + { + "type": "constructor", + "inputs": [ + { + "name": "controller", + "type": "address", + "internalType": "address" + }, + { + "name": "protocolPaymentCut", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "PROTOCOL_PAYMENT_CUT", + "inputs": [], + "outputs": [ + { + "name": "", + "type": "uint256", + "internalType": "uint256" + } + ], + "stateMutability": "view" + }, + { + "type": "function", + "name": "collect", + "inputs": [ + { + "name": "paymentType", + "type": "uint8", + "internalType": "enum IGraphPayments.PaymentTypes" + }, + { + "name": "receiver", + "type": "address", + "internalType": "address" + }, + { + "name": "tokens", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "dataService", + "type": "address", + "internalType": "address" + }, + { + "name": "dataServiceCut", + "type": "uint256", + "internalType": "uint256" + } + ], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "initialize", + "inputs": [], + "outputs": [], + "stateMutability": "nonpayable" + }, + { + "type": "function", + "name": "multicall", + "inputs": [ + { + "name": "data", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "outputs": [ + { + "name": "results", + "type": "bytes[]", + "internalType": "bytes[]" + } + ], + "stateMutability": "nonpayable" + }, + { + "type": "event", + "name": "GraphDirectoryInitialized", + "inputs": [ + { + "name": "graphToken", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "graphStaking", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "graphPayments", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "graphEscrow", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "graphController", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "graphEpochManager", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "graphRewardsManager", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "graphTokenGateway", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "graphProxyAdmin", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "graphCuration", + "type": "address", + "indexed": false, + "internalType": "address" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "GraphPaymentCollected", + "inputs": [ + { + "name": "paymentType", + "type": "uint8", + "indexed": true, + "internalType": "enum IGraphPayments.PaymentTypes" + }, + { + "name": "payer", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "receiver", + "type": "address", + "indexed": false, + "internalType": "address" + }, + { + "name": "dataService", + "type": "address", + "indexed": true, + "internalType": "address" + }, + { + "name": "tokens", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "tokensProtocol", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "tokensDataService", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "tokensDelegationPool", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + }, + { + "name": "tokensReceiver", + "type": "uint256", + "indexed": false, + "internalType": "uint256" + } + ], + "anonymous": false + }, + { + "type": "event", + "name": "Initialized", + "inputs": [ + { + "name": "version", + "type": "uint64", + "indexed": false, + "internalType": "uint64" + } + ], + "anonymous": false + }, + { + "type": "error", + "name": "AddressEmptyCode", + "inputs": [ + { + "name": "target", + "type": "address", + "internalType": "address" + } + ] + }, + { + "type": "error", + "name": "FailedInnerCall", + "inputs": [] + }, + { + "type": "error", + "name": "GraphDirectoryInvalidZeroAddress", + "inputs": [ + { + "name": "contractName", + "type": "bytes", + "internalType": "bytes" + } + ] + }, + { + "type": "error", + "name": "GraphPaymentsInvalidCut", + "inputs": [ + { + "name": "cut", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "GraphPaymentsInvalidProtocolPaymentCut", + "inputs": [ + { + "name": "protocolPaymentCut", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "InvalidInitialization", + "inputs": [] + }, + { + "type": "error", + "name": "NotInitializing", + "inputs": [] + }, + { + "type": "error", + "name": "PPMMathInvalidMulPPM", + "inputs": [ + { + "name": "a", + "type": "uint256", + "internalType": "uint256" + }, + { + "name": "b", + "type": "uint256", + "internalType": "uint256" + } + ] + }, + { + "type": "error", + "name": "PPMMathInvalidPPM", + "inputs": [ + { + "name": "value", + "type": "uint256", + "internalType": "uint256" + } + ] + } +] \ No newline at end of file From f66e5bd73c8b6f418b1004d68957e81acc6da2e2 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Thu, 27 Feb 2025 01:58:53 -0300 Subject: [PATCH 10/16] feat: add tax tracking for Horizon through GraphPayments --- config/addresses.template.ts | 2 ++ config/arbitrumSepoliaAddressScript.ts | 8 ++++++++ config/mainnetArbitrumAddressScript.ts | 4 ++++ config/testAddressesL1.ts | 1 + config/testAddressesL2.ts | 1 + src/mappings/graphPayments.ts | 25 +++++++++++++++++++++++++ subgraph.template.yaml | 24 ++++++++++++++++++++++++ 7 files changed, 65 insertions(+) create mode 100644 src/mappings/graphPayments.ts diff --git a/config/addresses.template.ts b/config/addresses.template.ts index 3121b7e5..89df6658 100644 --- a/config/addresses.template.ts +++ b/config/addresses.template.ts @@ -21,6 +21,7 @@ export class Addresses { l2GraphTokenGateway: string ethereumDIDRegistry: string subgraphService: string + graphPayments: string isL1: boolean } @@ -47,5 +48,6 @@ export let addresses: Addresses = { l2GraphTokenGateway: '{{l2GraphTokenGateway}}', ethereumDIDRegistry: '{{ethereumDIDRegistry}}', subgraphService: '{{subgraphService}}', + graphPayments: '{{graphPayments}}', isL1: {{isL1}}, } diff --git a/config/arbitrumSepoliaAddressScript.ts b/config/arbitrumSepoliaAddressScript.ts index 44334c9d..35f7daf0 100644 --- a/config/arbitrumSepoliaAddressScript.ts +++ b/config/arbitrumSepoliaAddressScript.ts @@ -30,6 +30,7 @@ export let addresses: Addresses = { l2GraphTokenGateway: '{{arbsep.L2GraphTokenGateway.address}}', ethereumDIDRegistry: '{{arbsep.EthereumDIDRegistry.address}}', subgraphService: '{{arbsep.SubgraphService.address}}', + graphPayments: '{{arbsep.GraphPayments.address}}', isL1: false, } @@ -46,6 +47,13 @@ const main = (): void => { if(output.ethereumDIDRegistry == '') { output.ethereumDIDRegistry = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config } + // remove once we have proper packages + if(output.subgraphService == '') { + output.subgraphService = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config + } + if(output.graphPayments == '') { + output.graphPayments = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config + } fs.writeFileSync(__dirname + '/generatedAddresses.json', JSON.stringify(output, null, 2)) } catch (e) { console.log(`Error saving artifacts: ${e.message}`) diff --git a/config/mainnetArbitrumAddressScript.ts b/config/mainnetArbitrumAddressScript.ts index 9384be1e..97f74e18 100644 --- a/config/mainnetArbitrumAddressScript.ts +++ b/config/mainnetArbitrumAddressScript.ts @@ -30,6 +30,7 @@ export let addresses: Addresses = { l2GraphTokenGateway: '{{arbitrum.L2GraphTokenGateway.address}}', ethereumDIDRegistry: '{{arbitrum.IEthereumDIDRegistry.address}}', subgraphService: '{{arbitrum.SubgraphService.address}}', + graphPayments: '{{arbitrum.GraphPayments.address}}', isL1: false, } @@ -51,6 +52,9 @@ const main = (): void => { if(output.subgraphService == '') { output.subgraphService = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config } + if(output.graphPayments == '') { + output.graphPayments = '0x0000000000000000000000000000000000000000' // to avoid crashes due to bad config + } fs.writeFileSync(__dirname + '/generatedAddresses.json', JSON.stringify(output, null, 2)) } catch (e) { console.log(`Error saving artifacts: ${e.message}`) diff --git a/config/testAddressesL1.ts b/config/testAddressesL1.ts index 56bbbb32..b6faebe5 100644 --- a/config/testAddressesL1.ts +++ b/config/testAddressesL1.ts @@ -30,6 +30,7 @@ export let addresses: Addresses = { l2GraphTokenGateway: '', ethereumDIDRegistry: '0x0000000000000000000000000000000000000000', subgraphService: '0x0000000000000000000000000000000000000000', + graphPayments: '0x0000000000000000000000000000000000000000', isL1: true, } diff --git a/config/testAddressesL2.ts b/config/testAddressesL2.ts index 0fab2b9a..4bfc932c 100644 --- a/config/testAddressesL2.ts +++ b/config/testAddressesL2.ts @@ -30,6 +30,7 @@ export let addresses: Addresses = { l2GraphTokenGateway: '0x0000000000000000000000000000000000000000', ethereumDIDRegistry: '0x0000000000000000000000000000000000000000', subgraphService: '0x0000000000000000000000000000000000000000', + graphPayments: '0x0000000000000000000000000000000000000000', isL1: false, } diff --git a/src/mappings/graphPayments.ts b/src/mappings/graphPayments.ts new file mode 100644 index 00000000..408560ee --- /dev/null +++ b/src/mappings/graphPayments.ts @@ -0,0 +1,25 @@ +import { addresses } from "../../config/addresses" +import { GraphPaymentCollected } from "../types/GraphPayments/GraphPayments" +import { createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadPaymentSource } from "./helpers/helpers" + +export function handleGraphPaymentCollected(event: GraphPaymentCollected): void { + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) + + // Update epoch + let epoch = createOrLoadEpoch( + addresses.isL1 ? event.block.number : graphNetwork.currentL1BlockNumber!, + ) + epoch.taxedQueryFees = epoch.taxedQueryFees.plus(event.params.tokensProtocol) + epoch.save() + + // update graph network + graphNetwork.totalTaxedQueryFees = graphNetwork.totalTaxedQueryFees.plus(event.params.tokensProtocol) + graphNetwork.save() + + // Replicate for payment source specific data + let paymentSource = createOrLoadPaymentSource(event.params.payer) + paymentSource.totalTaxedQueryFees = paymentSource.totalTaxedQueryFees.plus(event.params.tokensProtocol) + paymentSource.save() + + // Might want to add data service tax tracking here +} diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 96c7b177..7b3bb3f3 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -465,6 +465,30 @@ dataSources: handler: handleIndexingRewardsCollected - event: QueryFeesCollected(indexed address,indexed address,indexed address,bytes32,uint256,uint256) handler: handleQueryFeesCollected + - kind: ethereum/contract + name: GraphPayments + network: {{network}} + source: + address: "{{graphPayments}}" + abi: GraphPayments + startBlock: {{blockNumber}} + mapping: + kind: ethereum/events + apiVersion: 0.0.7 + language: wasm/assemblyscript + file: ./src/mappings/graphPayments.ts + entities: + - GraphNetwork + abis: + - name: GraphPayments + file: ./abis/GraphPayments.json + - name: GraphToken + file: ./node_modules/@graphprotocol/contracts/dist/abis/GraphToken.json + - name: EpochManager + file: ./node_modules/@graphprotocol/contracts/dist/abis/EpochManager.json + eventHandlers: + - event: GraphPaymentCollected(indexed uint8,indexed address,address,indexed address,uint256,uint256,uint256,uint256,uint256) + handler: handleGraphPaymentCollected - kind: ethereum/contract name: Curation network: {{network}} From 437c6abec038edde2dde34c5cc882cda66f970d8 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Thu, 27 Feb 2025 02:36:24 -0300 Subject: [PATCH 11/16] feat: placeholders and manifest changes for delegation --- src/mappings/horizonStaking.ts | 24 +++++++++++++++++++++++- subgraph.template.yaml | 10 ++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/mappings/horizonStaking.ts b/src/mappings/horizonStaking.ts index 3253cea6..cb6a5f72 100644 --- a/src/mappings/horizonStaking.ts +++ b/src/mappings/horizonStaking.ts @@ -1,6 +1,6 @@ import { BigInt } from '@graphprotocol/graph-ts' import { addresses } from '../../config/addresses' -import { DelegationFeeCutSet, HorizonStakeDeposited, HorizonStakeLocked, HorizonStakeWithdrawn, OperatorSet, TokensDeprovisioned, TokensToDelegationPoolAdded } from '../types/HorizonStaking/HorizonStaking' +import { DelegatedTokensWithdrawn, DelegationFeeCutSet, DelegationSlashed, HorizonStakeDeposited, HorizonStakeLocked, HorizonStakeWithdrawn, OperatorSet, StakeDelegatedWithdrawn, TokensDelegated, TokensDeprovisioned, TokensToDelegationPoolAdded, TokensUndelegated } from '../types/HorizonStaking/HorizonStaking' import { Indexer, ThawRequest } from '../types/schema' import { createOrLoadDataService, createOrLoadEpoch, createOrLoadGraphAccount, createOrLoadGraphNetwork, createOrLoadIndexer, createOrLoadOperator, createOrLoadProvision, updateDelegationExchangeRate } from './helpers/helpers' import { @@ -279,4 +279,26 @@ export function handleTokensToDelegationPoolAdded(event: TokensToDelegationPoolA graphNetwork.totalDelegatedTokens = graphNetwork.totalDelegatedTokens.plus(event.params.tokens) graphNetwork.save() +} + +// Delegation + +export function handleTokensDelegated(event: TokensDelegated): void { + // To Do +} + +export function handleDelegationSlashed(event: DelegationSlashed): void { + // To Do +} + +export function handleTokensUndelegated(event: TokensUndelegated): void { + // To Do +} + +export function handleDelegatedTokensWithdrawn(event: DelegatedTokensWithdrawn): void { + // To Do +} + +export function handleStakeDelegatedWithdrawn(event: StakeDelegatedWithdrawn): void { + // To Do } \ No newline at end of file diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 7b3bb3f3..2cbdc33a 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -429,6 +429,16 @@ dataSources: handler: handleDelegationFeeCutSet - event: TokensToDelegationPoolAdded(indexed address,indexed address,uint256) handler: handleTokensToDelegationPoolAdded + - event: TokensDelegated(indexed address,indexed address,indexed address,uint256,uint256) + handler: handleTokensDelegated + - event: DelegationSlashed(indexed address,indexed address,uint256) + handler: handleDelegationSlashed + - event: TokensUndelegated(indexed address,indexed address,indexed address,uint256) + handler: handleTokensUndelegated + - event: DelegatedTokensWithdrawn(indexed address,indexed address,indexed address,uint256) + handler: handleDelegatedTokensWithdrawn + - event: StakeDelegatedWithdrawn(indexed address,indexed address,uint256) + handler: handleStakeDelegatedWithdrawn - kind: ethereum/contract name: SubgraphService network: {{network}} From 77f4a2ec45b810f517e888cc9fea35eec9e43eca Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Mon, 3 Mar 2025 20:35:00 -0300 Subject: [PATCH 12/16] feat: added horizon delegation events support --- abis/HorizonStaking.json | 35 ++++++- schema.graphql | 20 +++- src/mappings/helpers/helpers.ts | 118 ++++++++++++++++++++- src/mappings/horizonStaking.ts | 176 ++++++++++++++++++++++++++++++-- subgraph.template.yaml | 4 +- 5 files changed, 331 insertions(+), 22 deletions(-) diff --git a/abis/HorizonStaking.json b/abis/HorizonStaking.json index 67eb616b..1b2a72f6 100644 --- a/abis/HorizonStaking.json +++ b/abis/HorizonStaking.json @@ -254,6 +254,11 @@ "name": "HorizonStakingInvalidZeroTokens", "type": "error" }, + { + "inputs": [], + "name": "HorizonStakingLegacySlashFailed", + "type": "error" + }, { "inputs": [ { @@ -280,6 +285,11 @@ "name": "HorizonStakingNothingThawing", "type": "error" }, + { + "inputs": [], + "name": "HorizonStakingNothingToWithdraw", + "type": "error" + }, { "inputs": [], "name": "HorizonStakingProvisionAlreadyExists", @@ -1159,6 +1169,12 @@ "internalType": "uint256", "name": "tokens", "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "shares", + "type": "uint256" } ], "name": "TokensUndelegated", @@ -1517,7 +1533,7 @@ "outputs": [ { "internalType": "uint256", - "name": "tokens", + "name": "", "type": "uint256" } ], @@ -1682,6 +1698,19 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [], + "name": "getStakingExtension", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, { "inputs": [ { @@ -2423,9 +2452,5 @@ ], "stateMutability": "nonpayable", "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" } ] \ No newline at end of file diff --git a/schema.graphql b/schema.graphql index c12b4561..d388b553 100644 --- a/schema.graphql +++ b/schema.graphql @@ -893,12 +893,22 @@ type Provision @entity { thawingPeriodPending: BigInt! # Cuts for subgraph service. Percentage of rewards that the delegation pool receives + "Raw query fee cut. In Horizon this is amount of query fees that the delegation pool receives in PPM" queryFeeCut: BigInt! + "Raw indexing fee cut. In Horizon this is amount of indexing fees that the delegation pool receives in PPM" indexingFeeCut: BigInt! + "Raw indexing rewards cut. In Horizon this is amount of indexing rewards that the delegation pool receives in PPM" indexingRewardsCut: BigInt! + "The percent of indexing rewards generated by the delegated stake that the Indexer keeps for itself" + indexingRewardEffectiveCut: BigDecimal! + "The percent of query rebate rewards generated by the delegated stake that the Indexer keeps for itself" + queryFeeEffectiveCut: BigDecimal! + "The percent of reward dilution delegators experience because of overdelegation. Overdelegated stake can't be used to generate rewards but still gets accounted while distributing the generated rewards. This causes dilution of the rewards for the rest of the pool." + overDelegationDilution: BigDecimal! + # Might want to add polymorphic handling of different fee cuts through a generic hashmap in the future # Indexing rewards. Keeping the same naming from Indexer entity to make it easier to understand @@ -924,6 +934,10 @@ type Provision @entity { delegatorShares: BigInt! "Exchange rate of of tokens received for each share" delegationExchangeRate: BigDecimal! + "Ratio between the amount of the indexers own stake over the total usable stake." + ownStakeRatio: BigDecimal! + "Ratio between the amount of delegated stake over the total usable stake." + delegatedStakeRatio: BigDecimal! "Service registry URL for the indexer" url: String @@ -1111,8 +1125,12 @@ Delegator stake for a single Indexer type DelegatedStake @entity { "Concatenation of Delegator address and Indexer address" id: ID! - "Index the stake is delegated to" + "Indexer the stake is delegated to" indexer: Indexer! + "DataService the stake is delegated to. Only for Horizon delegations" + dataService: DataService + "Provision the stake is delegated to. Only for Horizon delegations" + provision: Provision "Delegator" delegator: Delegator! "CUMULATIVE tokens delegated" diff --git a/src/mappings/helpers/helpers.ts b/src/mappings/helpers/helpers.ts index a70eef19..93d815d2 100644 --- a/src/mappings/helpers/helpers.ts +++ b/src/mappings/helpers/helpers.ts @@ -348,6 +348,46 @@ export function createOrLoadDelegatedStake( } return delegatedStake as DelegatedStake } + +export function createOrLoadDelegatedStakeForProvision( + delegator: string, + indexer: string, + dataService: string, + timestamp: i32, +): DelegatedStake { + let provisionId = joinID([indexer, dataService]) + let id = joinID([delegator, provisionId]) + let delegatedStake = DelegatedStake.load(id) + if (delegatedStake == null) { + delegatedStake = new DelegatedStake(id) + delegatedStake.indexer = indexer + delegatedStake.dataService = dataService + delegatedStake.provision = provisionId + delegatedStake.delegator = delegator + delegatedStake.stakedTokens = BigInt.fromI32(0) + delegatedStake.transferredToL2 = false + delegatedStake.stakedTokensTransferredToL2 = BigInt.fromI32(0) + delegatedStake.unstakedTokens = BigInt.fromI32(0) + delegatedStake.lockedTokens = BigInt.fromI32(0) + delegatedStake.lockedUntil = 0 + delegatedStake.shareAmount = BigInt.fromI32(0) + delegatedStake.personalExchangeRate = BigDecimal.fromString('1') + delegatedStake.realizedRewards = BigDecimal.fromString('0') + delegatedStake.createdAt = timestamp + + delegatedStake.save() + + let delegatorEntity = Delegator.load(delegator)! + delegatorEntity.stakesCount = delegatorEntity.stakesCount + 1 + delegatorEntity.save() + + let graphNetwork = GraphNetwork.load('1')! + graphNetwork.delegationCount = graphNetwork.delegationCount + 1 + graphNetwork.save() + } + return delegatedStake as DelegatedStake +} + export function createOrLoadCurator(curatorAddress: Bytes, timestamp: BigInt): Curator { let id = curatorAddress.toHexString() let curator = Curator.load(id) @@ -916,6 +956,68 @@ export function updateAdvancedIndexerMetrics(indexer: Indexer): Indexer { return indexer as Indexer } +export function calculateOwnStakeRatioForProvision(provision: Provision): BigDecimal { + let totalTokens = provision.tokensProvisioned.plus(provision.delegatedTokens) + return totalTokens == BigInt.fromI32(0) + ? BigDecimal.fromString('0') + : provision.tokensProvisioned.toBigDecimal().div(totalTokens.toBigDecimal()) +} + +export function calculateDelegatedStakeRatioForProvision(provision: Provision): BigDecimal { + let totalTokens = provision.tokensProvisioned.plus(provision.delegatedTokens) + return totalTokens == BigInt.fromI32(0) + ? BigDecimal.fromString('0') + : provision.delegatedTokens.toBigDecimal().div(totalTokens.toBigDecimal()) +} + +export function calculateIndexingRewardEffectiveCutForProvision(provision: Provision): BigDecimal { + let delegatorCut = + provision.indexingRewardsCut.toBigDecimal() / + BigDecimal.fromString('1000000') + return provision.delegatedStakeRatio == BigDecimal.fromString('0') + ? BigDecimal.fromString('0') + : BigDecimal.fromString('1') - delegatorCut / provision.delegatedStakeRatio +} + +export function calculateQueryFeeEffectiveCutForProvision(provision: Provision): BigDecimal { + let delegatorCut = + provision.queryFeeCut.toBigDecimal() / BigDecimal.fromString('1000000') + return provision.delegatedStakeRatio == BigDecimal.fromString('0') + ? BigDecimal.fromString('0') + : BigDecimal.fromString('1') - delegatorCut / provision.delegatedStakeRatio +} + +export function calculateIndexerRewardOwnGenerationRatioForProvision(provision: Provision): BigDecimal { + let rewardCut = + provision.indexingRewardsCut.toBigDecimal() / BigDecimal.fromString('1000000') + return provision.ownStakeRatio == BigDecimal.fromString('0') + ? BigDecimal.fromString('0') + : rewardCut / provision.ownStakeRatio +} + +export function calculateOverdelegationDilutionForProvision(provision: Provision): BigDecimal { + let provisionedTokensBD = provision.tokensProvisioned.toBigDecimal() + let delegatedTokensBD = provision.delegatedTokens.toBigDecimal() + let graphNetwork = GraphNetwork.load('1')! + let delegationRatioBD = BigInt.fromI32(graphNetwork.delegationRatio).toBigDecimal() + let maxDelegatedStake = provisionedTokensBD * delegationRatioBD + return provisionedTokensBD == BigDecimal.fromString('0') + ? BigDecimal.fromString('0') + : BigDecimal.fromString('1') - maxDelegatedStake / max(maxDelegatedStake, delegatedTokensBD) +} + +export function updateAdvancedProvisionMetrics(provision: Provision): Provision { + provision.ownStakeRatio = calculateOwnStakeRatioForProvision(provision as Provision) + provision.delegatedStakeRatio = calculateDelegatedStakeRatioForProvision(provision as Provision) + provision.indexingRewardEffectiveCut = calculateIndexingRewardEffectiveCutForProvision(provision as Provision) + provision.queryFeeEffectiveCut = calculateQueryFeeEffectiveCutForProvision(provision as Provision) + provision.indexerRewardsOwnGenerationRatio = calculateIndexerRewardOwnGenerationRatioForProvision( + provision as Provision, + ) + provision.overDelegationDilution = calculateOverdelegationDilutionForProvision(provision as Provision) + return provision as Provision +} + export function updateDelegationExchangeRate(indexer: Indexer): Indexer { indexer.delegationExchangeRate = indexer.delegatedTokens .toBigDecimal() @@ -924,6 +1026,14 @@ export function updateDelegationExchangeRate(indexer: Indexer): Indexer { return indexer as Indexer } +export function updateDelegationExchangeRateForProvision(provision: Provision): Provision { + provision.delegationExchangeRate = provision.delegatedTokens + .toBigDecimal() + .div(provision.delegatorShares.toBigDecimal()) + .truncate(18) + return provision as Provision +} + // TODO - this is broken if we change the delegatio ratio // Need to remove, or find a fix export function calculateCapacities(indexer: Indexer): Indexer { @@ -957,10 +1067,10 @@ export function calculatePricePerShare(deployment: SubgraphDeployment): BigDecim deployment.signalAmount == BigInt.fromI32(0) ? BigDecimal.fromString('0') : deployment.signalledTokens - .toBigDecimal() - .div(deployment.signalAmount.toBigDecimal()) - .times(BigInt.fromI32(reserveRatioMultiplier).toBigDecimal()) - .truncate(18) + .toBigDecimal() + .div(deployment.signalAmount.toBigDecimal()) + .times(BigInt.fromI32(reserveRatioMultiplier).toBigDecimal()) + .truncate(18) return pricePerShare } diff --git a/src/mappings/horizonStaking.ts b/src/mappings/horizonStaking.ts index cb6a5f72..40519a75 100644 --- a/src/mappings/horizonStaking.ts +++ b/src/mappings/horizonStaking.ts @@ -1,8 +1,8 @@ import { BigInt } from '@graphprotocol/graph-ts' import { addresses } from '../../config/addresses' import { DelegatedTokensWithdrawn, DelegationFeeCutSet, DelegationSlashed, HorizonStakeDeposited, HorizonStakeLocked, HorizonStakeWithdrawn, OperatorSet, StakeDelegatedWithdrawn, TokensDelegated, TokensDeprovisioned, TokensToDelegationPoolAdded, TokensUndelegated } from '../types/HorizonStaking/HorizonStaking' -import { Indexer, ThawRequest } from '../types/schema' -import { createOrLoadDataService, createOrLoadEpoch, createOrLoadGraphAccount, createOrLoadGraphNetwork, createOrLoadIndexer, createOrLoadOperator, createOrLoadProvision, updateDelegationExchangeRate } from './helpers/helpers' +import { DelegatedStake, Delegator, Indexer, Provision, ThawRequest } from '../types/schema' +import { calculateCapacities, createOrLoadDataService, createOrLoadDelegatedStake, createOrLoadDelegatedStakeForProvision, createOrLoadDelegator, createOrLoadEpoch, createOrLoadGraphAccount, createOrLoadGraphNetwork, createOrLoadIndexer, createOrLoadOperator, createOrLoadProvision, joinID, updateAdvancedIndexerMetrics, updateAdvancedProvisionMetrics, updateDelegationExchangeRate, updateDelegationExchangeRateForProvision } from './helpers/helpers' import { ProvisionCreated, ProvisionIncreased, @@ -284,21 +284,179 @@ export function handleTokensToDelegationPoolAdded(event: TokensToDelegationPoolA // Delegation export function handleTokensDelegated(event: TokensDelegated): void { - // To Do + let zeroShares = event.params.shares.equals(BigInt.fromI32(0)) + + let dataService = createOrLoadDataService(event.params.verifier) + // Might want to track some stuff here in the future + dataService.save() + + let provision = createOrLoadProvision(event.params.serviceProvider, event.params.verifier, event.block.timestamp) + provision.delegatedTokens = provision.delegatedTokens.plus(event.params.tokens) + provision.delegatorShares = provision.delegatorShares.plus(event.params.shares) + if (provision.delegatorShares != BigInt.fromI32(0)) { + provision = updateDelegationExchangeRateForProvision(provision as Provision) + } + provision = updateAdvancedProvisionMetrics(provision as Provision) + provision.save() + + // update indexer + let indexer = createOrLoadIndexer(event.params.serviceProvider, event.block.timestamp) + indexer.delegatedTokens = indexer.delegatedTokens.plus(event.params.tokens) + indexer.delegatorShares = indexer.delegatorShares.plus(event.params.shares) + indexer.save() + + // update delegator + let delegatorID = event.params.delegator.toHexString() + let delegator = createOrLoadDelegator(event.params.delegator, event.block.timestamp) + delegator.totalStakedTokens = delegator.totalStakedTokens.plus(event.params.tokens) + delegator.save() + + // update delegated stake + let delegatedStake = createOrLoadDelegatedStakeForProvision( + delegatorID, + indexer.id, + dataService.id, + event.block.timestamp.toI32(), + ) + + if (!zeroShares) { + let previousExchangeRate = delegatedStake.personalExchangeRate + let previousShares = delegatedStake.shareAmount + let averageCostBasisTokens = previousExchangeRate + .times(previousShares.toBigDecimal()) + .plus(event.params.tokens.toBigDecimal()) + let averageCostBasisShares = previousShares.plus(event.params.shares) + if (averageCostBasisShares.gt(BigInt.fromI32(0))) { + delegatedStake.personalExchangeRate = averageCostBasisTokens + .div(averageCostBasisShares.toBigDecimal()) + .truncate(18) + } + } + + let isStakeBecomingActive = delegatedStake.shareAmount.isZero() && !event.params.shares.isZero() + + delegatedStake.stakedTokens = delegatedStake.stakedTokens.plus(event.params.tokens) + delegatedStake.shareAmount = delegatedStake.shareAmount.plus(event.params.shares) + delegatedStake.lastDelegatedAt = event.block.timestamp.toI32() + delegatedStake.save() + + // reload delegator to avoid edge case where we can overwrite stakesCount if stake is new + delegator = Delegator.load(delegatorID) as Delegator + + // upgrade graph network + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) + graphNetwork.totalDelegatedTokens = graphNetwork.totalDelegatedTokens.plus(event.params.tokens) + + if (isStakeBecomingActive) { + graphNetwork.activeDelegationCount = graphNetwork.activeDelegationCount + 1 + delegator.activeStakesCount = delegator.activeStakesCount + 1 + // Is delegator becoming active because of the stake becoming active? + if (delegator.activeStakesCount == 1) { + graphNetwork.activeDelegatorCount = graphNetwork.activeDelegatorCount + 1 + } + } + + graphNetwork.save() + delegator.save() } export function handleDelegationSlashed(event: DelegationSlashed): void { - // To Do + // This is a delegation pool wide change, no particular delegation or delegator can be updated here. + + // update provision + let provision = createOrLoadProvision(event.params.serviceProvider, event.params.verifier, event.block.timestamp) + provision.delegatedTokens = provision.delegatedTokens.minus(event.params.tokens) + if (provision.delegatorShares != BigInt.fromI32(0)) { + provision = updateDelegationExchangeRateForProvision(provision as Provision) + } + provision = updateAdvancedProvisionMetrics(provision as Provision) + provision.save() + + // update indexer + let indexerID = event.params.serviceProvider.toHexString() + let indexer = Indexer.load(indexerID)! + indexer.delegatedTokens = indexer.delegatedTokens.minus(event.params.tokens) + indexer.save() + + // upgrade graph network + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) + graphNetwork.totalDelegatedTokens = graphNetwork.totalDelegatedTokens.minus(event.params.tokens) + graphNetwork.save() } export function handleTokensUndelegated(event: TokensUndelegated): void { - // To Do + // update provision + let provision = createOrLoadProvision(event.params.serviceProvider, event.params.verifier, event.block.timestamp) + + let beforeUpdateDelegationExchangeRate = provision.delegationExchangeRate + + provision.delegatedTokens = provision.delegatedTokens.minus(event.params.tokens) + provision.delegatorShares = provision.delegatorShares.minus(event.params.shares) + if (provision.delegatorShares != BigInt.fromI32(0)) { + provision = updateDelegationExchangeRateForProvision(provision as Provision) + } + provision = updateAdvancedProvisionMetrics(provision as Provision) + provision.save() + + // update indexer + let indexerID = event.params.serviceProvider.toHexString() + let indexer = Indexer.load(indexerID)! + indexer.delegatedTokens = indexer.delegatedTokens.minus(event.params.tokens) + indexer.delegatorShares = indexer.delegatorShares.minus(event.params.shares) + indexer.save() + + // update delegated stake + let delegatorID = event.params.delegator.toHexString() + let id = joinID([delegatorID, provision.id]) + let delegatedStake = DelegatedStake.load(id)! + + let isStakeBecomingInactive = + !delegatedStake.shareAmount.isZero() && delegatedStake.shareAmount == event.params.shares + + delegatedStake.unstakedTokens = delegatedStake.unstakedTokens.plus(event.params.tokens) + delegatedStake.shareAmount = delegatedStake.shareAmount.minus(event.params.shares) + delegatedStake.lockedTokens = delegatedStake.lockedTokens.plus(event.params.tokens) + //delegatedStake.lockedUntil = event.params.until.toI32() // until always updates and overwrites the past lockedUntil time + delegatedStake.lastUndelegatedAt = event.block.timestamp.toI32() + + let currentBalance = event.params.shares.toBigDecimal().times(beforeUpdateDelegationExchangeRate) + let oldBalance = event.params.shares.toBigDecimal().times(delegatedStake.personalExchangeRate) + let realizedRewards = currentBalance.minus(oldBalance) + + delegatedStake.realizedRewards = delegatedStake.realizedRewards.plus(realizedRewards) + delegatedStake.save() + + // update delegator + let delegator = Delegator.load(delegatorID)! + delegator.totalUnstakedTokens = delegator.totalUnstakedTokens.plus(event.params.tokens) + delegator.totalRealizedRewards = delegator.totalRealizedRewards.plus(realizedRewards) + + // upgrade graph network + let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) + graphNetwork.totalDelegatedTokens = graphNetwork.totalDelegatedTokens.minus(event.params.tokens) + + if (isStakeBecomingInactive) { + graphNetwork.activeDelegationCount = graphNetwork.activeDelegationCount - 1 + delegator.activeStakesCount = delegator.activeStakesCount - 1 + // Is delegator becoming inactive because of the stake becoming inactive? + if (delegator.activeStakesCount == 0) { + graphNetwork.activeDelegatorCount = graphNetwork.activeDelegatorCount - 1 + } + } + + graphNetwork.save() + delegator.save() } export function handleDelegatedTokensWithdrawn(event: DelegatedTokensWithdrawn): void { - // To Do -} + let provision = createOrLoadProvision(event.params.serviceProvider, event.params.verifier, event.block.timestamp) + // might want to track locked/thawing tokens in provision too + provision.save() -export function handleStakeDelegatedWithdrawn(event: StakeDelegatedWithdrawn): void { - // To Do + // update delegated stake + let delegatorID = event.params.delegator.toHexString() + let id = joinID([delegatorID, provision.id]) + let delegatedStake = DelegatedStake.load(id)! + delegatedStake.lockedTokens = delegatedStake.lockedTokens.minus(event.params.tokens) + delegatedStake.save() } \ No newline at end of file diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 2cbdc33a..34b1f105 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -433,12 +433,10 @@ dataSources: handler: handleTokensDelegated - event: DelegationSlashed(indexed address,indexed address,uint256) handler: handleDelegationSlashed - - event: TokensUndelegated(indexed address,indexed address,indexed address,uint256) + - event: TokensUndelegated(indexed address,indexed address,indexed address,uint256,uint256) handler: handleTokensUndelegated - event: DelegatedTokensWithdrawn(indexed address,indexed address,indexed address,uint256) handler: handleDelegatedTokensWithdrawn - - event: StakeDelegatedWithdrawn(indexed address,indexed address,uint256) - handler: handleStakeDelegatedWithdrawn - kind: ethereum/contract name: SubgraphService network: {{network}} From 424f08a556c340a8c2a46afd64d7d63e78eefbd0 Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Thu, 6 Mar 2025 01:12:50 -0300 Subject: [PATCH 13/16] fix: missing inits --- schema.graphql | 2 ++ src/mappings/helpers/helpers.ts | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/schema.graphql b/schema.graphql index d388b553..86526577 100644 --- a/schema.graphql +++ b/schema.graphql @@ -938,6 +938,8 @@ type Provision @entity { ownStakeRatio: BigDecimal! "Ratio between the amount of delegated stake over the total usable stake." delegatedStakeRatio: BigDecimal! + "Percentage of indexers' own rewards received in relation to its own stake. 1 (100%) means that the indexer is receiving the exact amount that is generated by his own stake" + indexerRewardsOwnGenerationRatio: BigDecimal! "Service registry URL for the indexer" url: String diff --git a/src/mappings/helpers/helpers.ts b/src/mappings/helpers/helpers.ts index 93d815d2..f2f233c0 100644 --- a/src/mappings/helpers/helpers.ts +++ b/src/mappings/helpers/helpers.ts @@ -216,6 +216,11 @@ export function createOrLoadProvision(indexerAddress: Bytes, verifierAddress: By provision.delegatedTokens = BigInt.fromI32(0) provision.delegatorShares = BigInt.fromI32(0) provision.delegationExchangeRate = BigInt.fromI32(0).toBigDecimal() + provision.indexingRewardEffectiveCut = BigInt.fromI32(0).toBigDecimal() + provision.queryFeeEffectiveCut = BigInt.fromI32(0).toBigDecimal() + provision.ownStakeRatio = BigInt.fromI32(0).toBigDecimal() + provision.delegatedStakeRatio = BigInt.fromI32(0).toBigDecimal() + provision.indexerRewardsOwnGenerationRatio = BigInt.fromI32(0).toBigDecimal() provision.save() } From d7cefa388f7d37309ab00e9f460cb26a5ead653e Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Sun, 30 Mar 2025 17:37:10 -0300 Subject: [PATCH 14/16] fix: address gh pr feedback --- schema.graphql | 15 +++++++++++---- src/mappings/helpers/helpers.ts | 13 +++++++++---- src/mappings/horizonStaking.ts | 8 +++++--- src/mappings/subgraphService.ts | 10 ++++++++-- subgraph.template.yaml | 2 ++ 5 files changed, 35 insertions(+), 13 deletions(-) diff --git a/schema.graphql b/schema.graphql index 86526577..fdf94006 100644 --- a/schema.graphql +++ b/schema.graphql @@ -246,6 +246,9 @@ type DataService @entity { "Total GRT currently in allocations for this DataService" totalTokensAllocated: BigInt! + "Ratio of max staked delegation tokens to indexers stake that earns rewards" + delegationRatio: Int + provisions: [Provision!]! @derivedFrom(field: "dataService") } @@ -867,6 +870,10 @@ type Provision @entity { tokensAllocated: BigInt! + tokensSlashedServiceProvider: BigInt! + + tokensSlashedDelegationPool: BigInt! + totalAllocationCount: BigInt! allocationCount: Int! @@ -904,7 +911,7 @@ type Provision @entity { "The percent of indexing rewards generated by the delegated stake that the Indexer keeps for itself" indexingRewardEffectiveCut: BigDecimal! - "The percent of query rebate rewards generated by the delegated stake that the Indexer keeps for itself" + "The percent of query fees generated by the delegated stake that the Indexer keeps for itself" queryFeeEffectiveCut: BigDecimal! "The percent of reward dilution delegators experience because of overdelegation. Overdelegated stake can't be used to generate rewards but still gets accounted while distributing the generated rewards. This causes dilution of the rewards for the rest of the pool." overDelegationDilution: BigDecimal! @@ -934,11 +941,11 @@ type Provision @entity { delegatorShares: BigInt! "Exchange rate of of tokens received for each share" delegationExchangeRate: BigDecimal! - "Ratio between the amount of the indexers own stake over the total usable stake." + "Ratio between the amount of the indexers own stake over the total usable stake (capped by the delegationRatio)." ownStakeRatio: BigDecimal! - "Ratio between the amount of delegated stake over the total usable stake." + "Ratio between the amount of delegated stake over the total usable stake (capped by the delegationRatio)." delegatedStakeRatio: BigDecimal! - "Percentage of indexers' own rewards received in relation to its own stake. 1 (100%) means that the indexer is receiving the exact amount that is generated by his own stake" + "Percentage of indexers' own rewards received in relation to its own stake. 1 (100%) means that the indexer is receiving the exact amount that is generated by his own stake, the value can be over 100% or below depending on the amount of delegation and cuts set" indexerRewardsOwnGenerationRatio: BigDecimal! "Service registry URL for the indexer" diff --git a/src/mappings/helpers/helpers.ts b/src/mappings/helpers/helpers.ts index f2f233c0..1787efbe 100644 --- a/src/mappings/helpers/helpers.ts +++ b/src/mappings/helpers/helpers.ts @@ -202,6 +202,8 @@ export function createOrLoadProvision(indexerAddress: Bytes, verifierAddress: By provision.dataService = verifierAddress.toHexString() provision.tokensProvisioned = BigInt.fromI32(0) provision.tokensAllocated = BigInt.fromI32(0) + provision.tokensSlashedServiceProvider = BigInt.fromI32(0) + provision.tokensSlashedDelegationPool = BigInt.fromI32(0) provision.totalAllocationCount = BigInt.fromI32(0) provision.allocationCount = 0 provision.tokensThawing = BigInt.fromI32(0) @@ -993,18 +995,21 @@ export function calculateQueryFeeEffectiveCutForProvision(provision: Provision): } export function calculateIndexerRewardOwnGenerationRatioForProvision(provision: Provision): BigDecimal { - let rewardCut = + let delegatorCut = provision.indexingRewardsCut.toBigDecimal() / BigDecimal.fromString('1000000') return provision.ownStakeRatio == BigDecimal.fromString('0') ? BigDecimal.fromString('0') - : rewardCut / provision.ownStakeRatio + : (BigDecimal.fromString('1') - delegatorCut) / provision.ownStakeRatio } export function calculateOverdelegationDilutionForProvision(provision: Provision): BigDecimal { let provisionedTokensBD = provision.tokensProvisioned.toBigDecimal() let delegatedTokensBD = provision.delegatedTokens.toBigDecimal() - let graphNetwork = GraphNetwork.load('1')! - let delegationRatioBD = BigInt.fromI32(graphNetwork.delegationRatio).toBigDecimal() + let dataService = DataService.load(provision.dataService)! + if (dataService.delegationRatio == null) { + return BigDecimal.fromString('0') + } + let delegationRatioBD = BigInt.fromI32(dataService.delegationRatio).toBigDecimal() let maxDelegatedStake = provisionedTokensBD * delegationRatioBD return provisionedTokensBD == BigDecimal.fromString('0') ? BigDecimal.fromString('0') diff --git a/src/mappings/horizonStaking.ts b/src/mappings/horizonStaking.ts index 40519a75..3407d6a2 100644 --- a/src/mappings/horizonStaking.ts +++ b/src/mappings/horizonStaking.ts @@ -230,15 +230,16 @@ export function handleProvisionSlashed(event: ProvisionSlashed): void { indexer.provisionedTokens = indexer.provisionedTokens.minus(event.params.tokens) indexer.stakedTokens = indexer.stakedTokens.minus(event.params.tokens) indexer.save() - + dataService.totalTokensProvisioned = dataService.totalTokensProvisioned.minus(event.params.tokens) dataService.save() - + graphNetwork.totalTokensProvisioned = graphNetwork.totalTokensProvisioned.minus(event.params.tokens) graphNetwork.totalTokensStaked = graphNetwork.totalTokensStaked.minus(event.params.tokens) graphNetwork.save() - + provision.tokensProvisioned = provision.tokensProvisioned.minus(event.params.tokens) + provision.tokensSlashedServiceProvider = provision.tokensSlashedServiceProvider.plus(event.params.tokens) provision.save() } @@ -366,6 +367,7 @@ export function handleDelegationSlashed(event: DelegationSlashed): void { // update provision let provision = createOrLoadProvision(event.params.serviceProvider, event.params.verifier, event.block.timestamp) provision.delegatedTokens = provision.delegatedTokens.minus(event.params.tokens) + provision.tokensSlashedDelegationPool = provision.tokensSlashedDelegationPool.plus(event.params.tokens) if (provision.delegatorShares != BigInt.fromI32(0)) { provision = updateDelegationExchangeRateForProvision(provision as Provision) } diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index dd27b7e0..fe686087 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -1,6 +1,6 @@ import { BigDecimal, BigInt, ethereum, log } from "@graphprotocol/graph-ts" -import { AllocationClosed, AllocationCreated, AllocationResized, IndexingRewardsCollected, QueryFeesCollected, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" -import { batchUpdateSubgraphSignalledTokens, calculatePricePerShare, createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadIndexerQueryFeePaymentAggregation, createOrLoadPaymentSource, createOrLoadProvision, createOrLoadSubgraphDeployment, joinID, updateDelegationExchangeRate } from "./helpers/helpers" +import { AllocationClosed, AllocationCreated, AllocationResized, DelegationRatioSet, IndexingRewardsCollected, QueryFeesCollected, RewardsDestinationSet, ServiceProviderRegistered } from "../types/SubgraphService/SubgraphService" +import { batchUpdateSubgraphSignalledTokens, calculatePricePerShare, createOrLoadDataService, createOrLoadEpoch, createOrLoadGraphNetwork, createOrLoadIndexerQueryFeePaymentAggregation, createOrLoadPaymentSource, createOrLoadProvision, createOrLoadSubgraphDeployment, joinID, updateDelegationExchangeRate } from "./helpers/helpers" import { Allocation, GraphAccount, Indexer, PoiSubmission, SubgraphDeployment } from "../types/schema" import { addresses } from "../../config/addresses" @@ -23,6 +23,12 @@ export function handleRewardsDestinationSet(event: RewardsDestinationSet): void provision.save() } +export function handleDelegationRatioSet(event: DelegationRatioSet): void { + let dataService = createOrLoadDataService(event.address) + dataService.delegationRatio = event.params.ratio + dataService.save() +} + export function handleAllocationCreated(event: AllocationCreated): void { let graphNetwork = createOrLoadGraphNetwork(event.block.number, event.address) let subgraphDeploymentID = event.params.subgraphDeploymentId.toHexString() diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 34b1f105..156c77a2 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -473,6 +473,8 @@ dataSources: handler: handleIndexingRewardsCollected - event: QueryFeesCollected(indexed address,indexed address,indexed address,bytes32,uint256,uint256) handler: handleQueryFeesCollected + - event: DelegationRatioSet(uint32) + handler: handleDelegationRatioSet - kind: ethereum/contract name: GraphPayments network: {{network}} From d216a93d16a5e6614a6a19ac23db2dfbf6215a5d Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Sun, 30 Mar 2025 18:05:59 -0300 Subject: [PATCH 15/16] fix: build issues and feedback from PaymentCollection PR --- schema.graphql | 4 ++-- src/mappings/graphPayments.ts | 1 + src/mappings/subgraphService.ts | 4 ++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/schema.graphql b/schema.graphql index fdf94006..7fe20c8a 100644 --- a/schema.graphql +++ b/schema.graphql @@ -930,8 +930,8 @@ type Provision @entity { "Total query fees collected. Includes the portion given to delegators" queryFeesCollected: BigInt! "Query fee amount collected from the protocol. Does not include portion given to delegators" - providerQueryFees: BigInt! - "Query fee amount collected from the protocol for Delegators. Does not include portion taken by the provider" + indexerQueryFees: BigInt! + "Query fee amount collected from the protocol for Delegators. Does not include portion taken by the indexer" delegatorQueryFees: BigInt! # Delegation diff --git a/src/mappings/graphPayments.ts b/src/mappings/graphPayments.ts index 408560ee..6a159149 100644 --- a/src/mappings/graphPayments.ts +++ b/src/mappings/graphPayments.ts @@ -17,6 +17,7 @@ export function handleGraphPaymentCollected(event: GraphPaymentCollected): void graphNetwork.save() // Replicate for payment source specific data + // Payer here is the PaymentsEscrow in most cases, might need to figure out how to know who funded the escrow in the future let paymentSource = createOrLoadPaymentSource(event.params.payer) paymentSource.totalTaxedQueryFees = paymentSource.totalTaxedQueryFees.plus(event.params.tokensProtocol) paymentSource.save() diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index fe686087..f9c1d3d4 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -25,7 +25,7 @@ export function handleRewardsDestinationSet(event: RewardsDestinationSet): void export function handleDelegationRatioSet(event: DelegationRatioSet): void { let dataService = createOrLoadDataService(event.address) - dataService.delegationRatio = event.params.ratio + dataService.delegationRatio = event.params.ratio.toI32() dataService.save() } @@ -265,7 +265,7 @@ export function handleQueryFeesCollected(event: QueryFeesCollected): void { let indexerQueryFees = event.params.tokensCollected.minus(delegationPoolQueryFees) provision.queryFeesCollected = provision.queryFeesCollected.plus(event.params.tokensCollected) - provision.providerQueryFees = provision.providerQueryFees.plus(indexerQueryFees) + provision.indexerQueryFees = provision.indexerQueryFees.plus(indexerQueryFees) provision.delegatorQueryFees = provision.delegatorQueryFees.plus(delegationPoolQueryFees) provision.save() From a8f4d1d4734a941feccc4468ab485be947d77fea Mon Sep 17 00:00:00 2001 From: Juan Manuel Rodriguez Defago Date: Sun, 30 Mar 2025 20:25:00 -0300 Subject: [PATCH 16/16] fix: addressed AllocationManagement pr feedback --- schema.graphql | 6 ++++++ src/mappings/staking.ts | 11 +++++++++-- src/mappings/subgraphService.ts | 20 +++++++++++++------- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/schema.graphql b/schema.graphql index 7fe20c8a..2110b3cd 100644 --- a/schema.graphql +++ b/schema.graphql @@ -1044,6 +1044,12 @@ type Allocation @entity { poi: Bytes "POIs submitted when collecting payments in Horizon" pois: [PoiSubmission!]! @derivedFrom(field: "allocation") + "Number of POIs submitted for this allocation. Only available for Horizon allocations" + poiCount: BigInt + "Whether this allocation was created in the legacy protocol. If true, the allocation will not have a provision since it's not a Horizon allocation" + isLegacy: Boolean! + "Whether this allocation was forced closed. Force closures in Horizon can happen when the latest PoI is stale, compared to the legacy protocol, where force closures can happen when the allocation hasn't been closed within the max amount of epochs" + forceClosed: Boolean # Indexer/Provision cut settings at start and close indexingRewardCutAtStart: Int! diff --git a/src/mappings/staking.ts b/src/mappings/staking.ts index ab4a2c71..db5551c2 100644 --- a/src/mappings/staking.ts +++ b/src/mappings/staking.ts @@ -374,6 +374,7 @@ export function handleAllocationCreated(event: AllocationCreated): void { allocation.indexingRewardEffectiveCutAtStart = indexer.indexingRewardEffectiveCut allocation.queryFeeCutAtStart = indexer.queryFeeCut allocation.queryFeeEffectiveCutAtStart = indexer.queryFeeEffectiveCut + allocation.isLegacy = true allocation.save() } @@ -493,12 +494,16 @@ export function handleAllocationClosed(event: AllocationClosed): void { // update indexer let indexer = Indexer.load(indexerID)! + let allocation = Allocation.load(allocationID)! const indexerAccount = GraphAccount.load(indexer.account)! const closedByIndexer = event.params.sender == event.params.indexer const closedByOperator = indexerAccount.operators.includes(event.params.sender.toHexString()) if (!closedByIndexer && !closedByOperator) { indexer.forcedClosures = indexer.forcedClosures + 1 + allocation.forceClosed = true + } else { + allocation.forceClosed = false } indexer.allocatedTokens = indexer.allocatedTokens.minus(event.params.tokens) indexer.allocationCount = indexer.allocationCount - 1 @@ -507,7 +512,6 @@ export function handleAllocationClosed(event: AllocationClosed): void { indexer.save() // update allocation - let allocation = Allocation.load(allocationID)! allocation.poolClosedIn = event.params.epoch.toString() allocation.activeForIndexer = null allocation.closedAtEpoch = event.params.epoch.toI32() @@ -561,12 +565,16 @@ export function handleAllocationClosedCobbDouglas(event: AllocationClosed1): voi // update indexer let indexer = Indexer.load(indexerID)! + let allocation = Allocation.load(allocationID)! const indexerAccount = GraphAccount.load(indexer.account)! const closedByIndexer = event.params.sender == event.params.indexer const closedByOperator = indexerAccount.operators.includes(event.params.sender.toHexString()) if (!closedByIndexer && !closedByOperator) { indexer.forcedClosures = indexer.forcedClosures + 1 + allocation.forceClosed = true + } else { + allocation.forceClosed = false } indexer.allocatedTokens = indexer.allocatedTokens.minus(event.params.tokens) indexer.allocationCount = indexer.allocationCount - 1 @@ -575,7 +583,6 @@ export function handleAllocationClosedCobbDouglas(event: AllocationClosed1): voi indexer.save() // update allocation - let allocation = Allocation.load(allocationID)! allocation.poolClosedIn = event.params.epoch.toString() allocation.activeForIndexer = null allocation.closedAtEpoch = event.params.epoch.toI32() diff --git a/src/mappings/subgraphService.ts b/src/mappings/subgraphService.ts index f9c1d3d4..6efed72c 100644 --- a/src/mappings/subgraphService.ts +++ b/src/mappings/subgraphService.ts @@ -88,9 +88,11 @@ export function handleAllocationCreated(event: AllocationCreated): void { allocation.annualizedReturn = BigDecimal.fromString('0') allocation.createdAt = event.block.timestamp.toI32() allocation.indexingRewardCutAtStart = provision.indexingRewardsCut.toI32() - allocation.indexingRewardEffectiveCutAtStart = provision.indexingRewardsCut.toBigDecimal() + allocation.indexingRewardEffectiveCutAtStart = provision.indexingRewardEffectiveCut allocation.queryFeeCutAtStart = provision.queryFeeCut.toI32() - allocation.queryFeeEffectiveCutAtStart = provision.queryFeeCut.toBigDecimal() + allocation.queryFeeEffectiveCutAtStart = provision.queryFeeEffectiveCut + allocation.poiCount = BigInt.fromI32(0) + allocation.isLegacy = false allocation.save() } @@ -101,12 +103,16 @@ export function handleAllocationClosed(event: AllocationClosed): void { // update indexer let indexer = Indexer.load(indexerID)! + let allocation = Allocation.load(allocationID)! const indexerAccount = GraphAccount.load(indexer.account)! const closedByIndexer = event.transaction.from == event.params.indexer const closedByOperator = indexerAccount.operators.includes(event.transaction.from.toHexString()) if (!closedByIndexer && !closedByOperator) { indexer.forcedClosures = indexer.forcedClosures + 1 + allocation.forceClosed = true + } else { + allocation.forceClosed = false } indexer.allocatedTokens = indexer.allocatedTokens.minus(event.params.tokens) indexer.allocationCount = indexer.allocationCount - 1 @@ -119,7 +125,6 @@ export function handleAllocationClosed(event: AllocationClosed): void { provision.save() // update allocation - let allocation = Allocation.load(allocationID)! allocation.poolClosedIn = graphNetwork.currentEpoch.toString() allocation.activeForIndexer = null allocation.closedAtEpoch = graphNetwork.currentEpoch @@ -129,10 +134,10 @@ export function handleAllocationClosed(event: AllocationClosed): void { ).toI32() allocation.status = 'Closed' allocation.closedAt = event.block.timestamp.toI32() - allocation.indexingRewardCutAtStart = provision.indexingRewardsCut.toI32() - allocation.indexingRewardEffectiveCutAtStart = provision.indexingRewardsCut.toBigDecimal() - allocation.queryFeeCutAtStart = provision.queryFeeCut.toI32() - allocation.queryFeeEffectiveCutAtStart = provision.queryFeeCut.toBigDecimal() + allocation.indexingRewardCutAtClose = provision.indexingRewardsCut.toI32() + allocation.indexingRewardEffectiveCutAtClose = provision.indexingRewardEffectiveCut + allocation.queryFeeCutAtClose = provision.queryFeeCut.toI32() + allocation.queryFeeEffectiveCutAtClose = provision.queryFeeEffectiveCut allocation.save() // update epoch - We do it here to have more epochs created, instead of seeing none created @@ -201,6 +206,7 @@ export function handleIndexingRewardsCollected(event: IndexingRewardsCollected): allocation.indexingDelegatorRewards = allocation.indexingDelegatorRewards.plus( event.params.tokensDelegationRewards, ) + allocation.poiCount = allocation.poiCount!.plus(BigInt.fromI32(1)) allocation.save() // Create PoI submission