You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
export function fetchTokenTotalSupply(tokenAddress: Address): BigInt {
let contract = ERC20.bind(tokenAddress)
let totalSupplyValue = null
let totalSupplyResult = contract.try_totalSupply()
if (!totalSupplyResult.reverted) {
totalSupplyValue = totalSupplyResult as i32
}
return BigInt.fromI32(totalSupplyValue as i32)
}
In this function, if we convert the result to i32, then the upper field is cut I think.
Shouldn't it be like this?
export function fetchTokenTotalSupply(tokenAddress: Address): BigInt {
let contract = ERC20.bind(tokenAddress)
let totalSupplyValue = new BigInt(0)
let totalSupplyResult = contract.try_totalSupply()
if (!totalSupplyResult.reverted) {
totalSupplyValue = totalSupplyResult.value
}
return totalSupplyValue;
}
If I am not recognizing the correct type of i32, pls tell me.
And may many know, does this function fetch the value from the latest block or the current scanning block?
The text was updated successfully, but these errors were encountered:
v2-subgraph/src/mappings/helpers.ts
Line 116 in 7c82235
In this function, if we convert the result to i32, then the upper field is cut I think.
Shouldn't it be like this?
If I am not recognizing the correct type of i32, pls tell me.
And may many know, does this function fetch the value from the latest block or the current scanning block?
The text was updated successfully, but these errors were encountered: