Skip to content

Commit

Permalink
fix: ethers contract results
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptodev-2s committed Jan 10, 2025
1 parent 213266f commit 24302eb
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions ui/helpers/utils/token-util.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ const DEFAULT_SYMBOL = '';
async function getSymbolFromContract(tokenAddress) {
const token = util.getContractAtAddress(tokenAddress);
try {
const result = await token.symbol();
return result[0];
return await token.symbol();
} catch (error) {
log.warn(
`symbol() call for token at address ${tokenAddress} resulted in error:`,
Expand All @@ -28,8 +27,7 @@ async function getSymbolFromContract(tokenAddress) {
async function getNameFromContract(tokenAddress) {
const token = util.getContractAtAddress(tokenAddress);
try {
const [name] = await token.name();
return name;
return await token.name();
} catch (error) {
log.warn(
`name() call for token at address ${tokenAddress} resulted in error:`,
Expand All @@ -43,8 +41,7 @@ async function getDecimalsFromContract(tokenAddress) {
const token = util.getContractAtAddress(tokenAddress);

try {
const result = await token.decimals();
const decimalsBN = result[0];
const decimalsBN = await token.decimals();
return decimalsBN?.toString();
} catch (error) {
log.warn(
Expand Down

0 comments on commit 24302eb

Please sign in to comment.