diff --git a/schema.graphql b/schema.graphql index 334ae25..479e8b9 100644 --- a/schema.graphql +++ b/schema.graphql @@ -403,7 +403,6 @@ type Template @entity{ id: ID! fixedRateTemplates: [String!] dispenserTemplates: [String!] - ssTemplates: [String!] } # Not tracking allocationToId or idToAllocation diff --git a/src/mappings/factoryRouter.ts b/src/mappings/factoryRouter.ts index ef6ea6e..1eb7a9b 100644 --- a/src/mappings/factoryRouter.ts +++ b/src/mappings/factoryRouter.ts @@ -91,32 +91,6 @@ export function handleTokenRemoved(event: TokenRemoved): void { opc.approvedTokens = newList opc.save() } -export function handleSSContractAdded(event: SSContractAdded): void { - // add token to approvedTokens - const templates = getTemplates() - let existingContracts: string[] - if (!templates.ssTemplates) existingContracts = [] - else existingContracts = templates.ssTemplates as string[] - if (!existingContracts.includes(event.params.contractAddress.toHexString())) - existingContracts.push(event.params.contractAddress.toHexString()) - templates.ssTemplates = existingContracts - templates.save() -} -export function handleSSContractRemoved(event: SSContractRemoved): void { - const templates = getTemplates() - const newList: string[] = [] - let existingContracts: string[] - if (!templates.ssTemplates) existingContracts = [] - else existingContracts = templates.ssTemplates as string[] - if (!existingContracts || existingContracts.length < 1) return - while (existingContracts.length > 0) { - const role = existingContracts.shift().toString() - if (!role) break - if (role != event.params.contractAddress.toHexString()) newList.push(role) - } - templates.ssTemplates = newList - templates.save() -} export function handleFixedRateContractAdded( event: FixedRateContractAdded diff --git a/subgraph.template.yaml b/subgraph.template.yaml index 25f8a59..f451cee 100644 --- a/subgraph.template.yaml +++ b/subgraph.template.yaml @@ -268,10 +268,6 @@ dataSources: handler: handleTokenRemoved - event: OPCFeeChanged(indexed address,uint256,uint256,uint256,uint256) handler: handleOPCFeeChanged - - event: SSContractAdded(indexed address,indexed address) - handler: handleSSContractAdded - - event: SSContractRemoved(indexed address,indexed address) - handler: handleSSContractRemoved - event: FixedRateContractAdded(indexed address,indexed address) handler: handleFixedRateContractAdded - event: FixedRateContractRemoved(indexed address,indexed address) @@ -280,3 +276,8 @@ dataSources: handler: handleDispenserContractAdded - event: DispenserContractRemoved(indexed address,indexed address) handler: handleDispenserContractRemoved + + - event: SSContractAdded(indexed address,indexed address) + handler: handleSSContractAdded + - event: SSContractRemoved(indexed address,indexed address) + handler: handleSSContractRemoved