token metadata fixes for vault and orders view; faucet fix

This commit is contained in:
Tim
2024-03-26 14:55:07 -04:00
parent f69efad6b0
commit fb3b1f0fcd
2 changed files with 13 additions and 14 deletions

View File

@@ -34,12 +34,11 @@ export async function lookupToken(chainId, address) {
if (result === undefined) {
// todo look in tokens project
const addr = ethers.getAddress(address)
// console.log('addr', addr)
const token = erc20(chainId, addr)
const symbol = await token.symbol()
// console.log('symbol', symbol)
const decimals = Number(await token.decimals())
result = {name: null, symbol, decimals, address: addr}
let [name, symbol, decimals] = await Promise.all([token.name(), token.symbol(), token.decimals()])
name = Number(name)
decimals = Number(decimals)
result = {a: addr, n: name, s:symbol, d:decimals}
chainTokens[addr] = result
}
return result