remove ss contracts

This commit is contained in:
alexcos20 2023-11-21 19:47:53 +02:00
parent 9d9493a6f8
commit 1c38afdae9
3 changed files with 5 additions and 31 deletions

View File

@ -403,7 +403,6 @@ type Template @entity{
id: ID!
fixedRateTemplates: [String!]
dispenserTemplates: [String!]
ssTemplates: [String!]
}
# Not tracking allocationToId or idToAllocation

View File

@ -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

View File

@ -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