Skip to content

Commit bf8b7a1

Browse files
committed
fix decimal overflow issue
1 parent 56873c6 commit bf8b7a1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/utils/token.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ export function fetchTokenDecimals(tokenAddress: Address): BigInt {
7676
let contract = ERC20.bind(tokenAddress)
7777
// try types uint8 for decimals
7878
let decimalValue = null
79-
let decimalResult = contract.try_decimals()
79+
let decimalResult = contract.tryCall("decimals", "decimals():(uint8)", []);
8080
if (!decimalResult.reverted) {
8181
if (decimalResult.value.kind == ethereum.ValueKind.INT || decimalResult.value.kind == ethereum.ValueKind.UINT) {
8282
// types(uint8).max=255

0 commit comments

Comments
 (0)