remove ss contracts
This commit is contained in:
parent
9d9493a6f8
commit
1c38afdae9
|
@ -403,7 +403,6 @@ type Template @entity{
|
||||||
id: ID!
|
id: ID!
|
||||||
fixedRateTemplates: [String!]
|
fixedRateTemplates: [String!]
|
||||||
dispenserTemplates: [String!]
|
dispenserTemplates: [String!]
|
||||||
ssTemplates: [String!]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Not tracking allocationToId or idToAllocation
|
# Not tracking allocationToId or idToAllocation
|
||||||
|
|
|
@ -91,32 +91,6 @@ export function handleTokenRemoved(event: TokenRemoved): void {
|
||||||
opc.approvedTokens = newList
|
opc.approvedTokens = newList
|
||||||
opc.save()
|
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(
|
export function handleFixedRateContractAdded(
|
||||||
event: FixedRateContractAdded
|
event: FixedRateContractAdded
|
||||||
|
|
|
@ -268,10 +268,6 @@ dataSources:
|
||||||
handler: handleTokenRemoved
|
handler: handleTokenRemoved
|
||||||
- event: OPCFeeChanged(indexed address,uint256,uint256,uint256,uint256)
|
- event: OPCFeeChanged(indexed address,uint256,uint256,uint256,uint256)
|
||||||
handler: handleOPCFeeChanged
|
handler: handleOPCFeeChanged
|
||||||
- event: SSContractAdded(indexed address,indexed address)
|
|
||||||
handler: handleSSContractAdded
|
|
||||||
- event: SSContractRemoved(indexed address,indexed address)
|
|
||||||
handler: handleSSContractRemoved
|
|
||||||
- event: FixedRateContractAdded(indexed address,indexed address)
|
- event: FixedRateContractAdded(indexed address,indexed address)
|
||||||
handler: handleFixedRateContractAdded
|
handler: handleFixedRateContractAdded
|
||||||
- event: FixedRateContractRemoved(indexed address,indexed address)
|
- event: FixedRateContractRemoved(indexed address,indexed address)
|
||||||
|
@ -280,3 +276,8 @@ dataSources:
|
||||||
handler: handleDispenserContractAdded
|
handler: handleDispenserContractAdded
|
||||||
- event: DispenserContractRemoved(indexed address,indexed address)
|
- event: DispenserContractRemoved(indexed address,indexed address)
|
||||||
handler: handleDispenserContractRemoved
|
handler: handleDispenserContractRemoved
|
||||||
|
|
||||||
|
- event: SSContractAdded(indexed address,indexed address)
|
||||||
|
handler: handleSSContractAdded
|
||||||
|
- event: SSContractRemoved(indexed address,indexed address)
|
||||||
|
handler: handleSSContractRemoved
|
||||||
|
|
Loading…
Reference in New Issue