fix predictor detection

This commit is contained in:
alexcos20 2023-07-31 08:57:17 +03:00
parent 6a78790bd4
commit bb790aa9cd
2 changed files with 2 additions and 3 deletions

View File

@ -30,7 +30,7 @@ type Token @entity {
publishMarketFeeAmount: BigDecimal
"template ID of the datatoken"
templateId: BigInt
templateId: BigInt!
"number of addresses holding a balance of datatoken , TODO: can we actually calculate this? what happens when users trade the dts"
holderCount: BigInt!

View File

@ -18,7 +18,6 @@ import {
getErc20TemplateId,
getPredictContract
} from './utils/tokenUtils'
import { BigInt } from '@graphprotocol/graph-ts'
import { addDatatoken } from './utils/globalUtils'
export function handleNftCreated(event: NFTCreated): void {
@ -62,7 +61,7 @@ export function handleNewToken(event: TokenCreated): void {
token.templateId = getErc20TemplateId(event.params.templateAddress)
token.save()
addDatatoken()
if (token.templateId === BigInt.fromString('3')) {
if (token.templateId.toString() == '3') {
factoryERC20Template3.create(event.params.newTokenAddress)
const predictContract = getPredictContract(event.params.newTokenAddress)
predictContract.timestamp = event.block.timestamp.toI32()