Skip to content

Commit

Permalink
refactor: update function for fetching token address
Browse files Browse the repository at this point in the history
  • Loading branch information
blockchainguyy committed Nov 8, 2023
1 parent 29e9933 commit 7708f0b
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ const { ethers } = require('ethers');
const axios = require('axios').default;

const ERC20_ABI = ['function symbol() external view returns (string)', 'function decimals() external view returns (uint8)'];
const ITS_ABI = ['function getTokenAddress(bytes32 tokenId) external view returns (address)'];
const ITS_ABI = ['function validTokenAddress(bytes32 tokenId) external view returns (address)'];

const COIN_MARKET_QUOTES_URL = 'https://pro-api.coinmarketcap.com/v2/cryptocurrency/quotes/latest';
const PAGER_DUTY_ALERT_URL = 'https://events.pagerduty.com/v2/enqueue';
Expand Down Expand Up @@ -56,7 +56,7 @@ const handleTokenTransferFn = async (context, event) => {
for (let index = 0; index < tokenIDs.length; index++) {
const id = tokenIDs[index];

const erc20Address = await its.getTokenAddress(id);
const erc20Address = await its.validTokenAddress(id);
const erc20 = new ethers.Contract(erc20Address, ERC20_ABI, provider);
const symbol = resolveTokenSymbol(await erc20.symbol());
const decimals = await erc20.decimals();
Expand Down

0 comments on commit 7708f0b

Please sign in to comment.