fixes
This commit is contained in:
parent
4ed9f5558f
commit
371eae73ed
|
@ -1,4 +1,4 @@
|
|||
import { BigInt, BigDecimal, log } from '@graphprotocol/graph-ts'
|
||||
import { BigInt, BigDecimal } from '@graphprotocol/graph-ts'
|
||||
import { OrderStarted, Transfer } from '../types/templates/DataToken/DataToken'
|
||||
|
||||
import { Datatoken, TokenBalance, TokenOrder } from '../types/schema'
|
||||
|
|
|
@ -7,7 +7,7 @@ import { ZERO_BD } from './helpers'
|
|||
export function handleNewPool(event: BPoolRegistered): void {
|
||||
let factory = PoolFactory.load('1')
|
||||
|
||||
if (factory == null) {
|
||||
if (factory === null) {
|
||||
factory = new PoolFactory('1')
|
||||
factory.totalLiquidity = ZERO_BD
|
||||
factory.totalSwapVolume = ZERO_BD
|
||||
|
|
|
@ -152,7 +152,7 @@ export function _handleRebind(
|
|||
const pool = Pool.load(poolId)
|
||||
const decimals = BigInt.fromI32(18).toI32()
|
||||
|
||||
if (tokenAddress != OCEAN) {
|
||||
if (tokenAddress !== OCEAN) {
|
||||
pool.datatokenAddress = tokenAddress
|
||||
}
|
||||
pool.tokenCount += BigInt.fromI32(1)
|
||||
|
@ -233,8 +233,7 @@ export function handleJoinPool(event: LOG_JOIN): void {
|
|||
return
|
||||
}
|
||||
|
||||
let datatoken: Datatoken | null
|
||||
datatoken =
|
||||
const datatoken: Datatoken =
|
||||
poolToken.tokenId != null ? Datatoken.load(poolToken.tokenId) : null
|
||||
const decimals =
|
||||
datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals
|
||||
|
@ -279,8 +278,7 @@ export function handleExitPool(event: LOG_EXIT): void {
|
|||
return
|
||||
}
|
||||
|
||||
let datatoken: Datatoken | null
|
||||
datatoken =
|
||||
const datatoken: Datatoken =
|
||||
poolToken.tokenId != null ? Datatoken.load(poolToken.tokenId) : null
|
||||
const decimals =
|
||||
datatoken == null ? BigInt.fromI32(18).toI32() : datatoken.decimals
|
||||
|
@ -408,8 +406,8 @@ export function handleTransfer(event: Transfer): void {
|
|||
|
||||
const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'
|
||||
|
||||
const isMint = event.params.from.toHex() == ZERO_ADDRESS
|
||||
const isBurn = event.params.to.toHex() == ZERO_ADDRESS
|
||||
const isMint = event.params.from.toHex() === ZERO_ADDRESS
|
||||
const isBurn = event.params.to.toHex() === ZERO_ADDRESS
|
||||
|
||||
const poolShareFromId = poolId.concat('-').concat(event.params.from.toHex())
|
||||
let poolShareFrom = PoolShare.load(poolShareFromId)
|
||||
|
|
Loading…
Reference in New Issue