diff --git a/src/routes/safe/components/Transactions/TxsTable/columns.js b/src/routes/safe/components/Transactions/TxsTable/columns.js index 80b576ad..b0741c5c 100644 --- a/src/routes/safe/components/Transactions/TxsTable/columns.js +++ b/src/routes/safe/components/Transactions/TxsTable/columns.js @@ -46,7 +46,7 @@ export const getTxAmount = (tx: Transaction) => { if (tx.isTokenTransfer && tx.decodedParams) { const tokenDecimals = tx.decimals.toNumber ? tx.decimals.toNumber() : tx.decimals - txAmount = `${new BigNumber(tx.decodedParams.value).div(10 ** tokenDecimals).toString()} ${tx.symbol}` + txAmount = `${new BigNumber(tx.decodedParams.value).div(10 ** tokenDecimals).toFixed()} ${tx.symbol}` } else if (Number(tx.value) > 0) { txAmount = `${fromWei(toBN(tx.value), 'ether')} ${tx.symbol}` } diff --git a/src/routes/safe/store/actions/fetchTransactions.js b/src/routes/safe/store/actions/fetchTransactions.js index 29574fe0..b12ac5d9 100644 --- a/src/routes/safe/store/actions/fetchTransactions.js +++ b/src/routes/safe/store/actions/fetchTransactions.js @@ -119,24 +119,26 @@ export const buildTransactionFrom = async ( let symbol = txTokenSymbol || 'ETH' let decimals = txTokenDecimals || 18 let decodedParams - if (isSendTokenTx && (txTokenSymbol === null || txTokenDecimals === null)) { - try { - const [tokenSymbol, tokenDecimals] = await Promise.all( - generateBatchRequests({ - abi: ALTERNATIVE_TOKEN_ABI, - address: tx.to, - methods: ['symbol', 'decimals'], - }), - ) + if (isSendTokenTx) { + if (txTokenSymbol === null || txTokenDecimals === null) { + try { + const [tokenSymbol, tokenDecimals] = await Promise.all( + generateBatchRequests({ + abi: ALTERNATIVE_TOKEN_ABI, + address: tx.to, + methods: ['symbol', 'decimals'], + }), + ) - symbol = tokenSymbol - decimals = tokenDecimals - } catch (e) { - // some contracts may implement the same methods as in ERC20 standard - // we may falsely treat them as tokens, so in case we get any errors when getting token info - // we fallback to displaying custom transaction - isSendTokenTx = false - customTx = true + symbol = tokenSymbol + decimals = tokenDecimals + } catch (e) { + // some contracts may implement the same methods as in ERC20 standard + // we may falsely treat them as tokens, so in case we get any errors when getting token info + // we fallback to displaying custom transaction + isSendTokenTx = false + customTx = true + } } const params = web3.eth.abi.decodeParameters(['address', 'uint256'], tx.data.slice(10)) @@ -325,7 +327,7 @@ export const loadSafeTransactions = async (safeAddress: string, getState: GetSta const txsWithData = await batchRequestTxsData(transactions) // In case that the etags don't match, we parse the new transactions and save them to the cache const txsRecord: Array> = await Promise.all( - txsWithData.map(([tx: TxServiceModel, decimals, symbol, name, code]) => + txsWithData.map(([tx: TxServiceModel, decimals, code, symbol, name]) => buildTransactionFrom(safeAddress, tx, knownTokens, decimals, symbol, name, code), ), )