diff --git a/src/config/development-mainnet.ts b/src/config/development-mainnet.ts index a26a7075..d24d20e1 100644 --- a/src/config/development-mainnet.ts +++ b/src/config/development-mainnet.ts @@ -1,11 +1,11 @@ // -import devConfig from './development' +import prodConfig from './production' import { TX_SERVICE_HOST, RELAY_API_URL } from 'src/config/names' -const devMainnetConfig = { - ...devConfig, - [TX_SERVICE_HOST]: 'https://safe-transaction.mainnet.staging.gnosisdev.com/api/v1/', - [RELAY_API_URL]: 'https://safe-relay.mainnet.staging.gnosisdev.com/api/v1/', +const prodMainnetConfig = { + ...prodConfig, + [TX_SERVICE_HOST]: 'https://safe-transaction.mainnet.gnosis.io/api/v1/', + [RELAY_API_URL]: 'https://safe-relay.gnosis.io/api/v1/', } -export default devMainnetConfig +export default prodMainnetConfig diff --git a/src/logic/tokens/utils/tokenHelpers.ts b/src/logic/tokens/utils/tokenHelpers.ts index 202d000b..4fab2c79 100644 --- a/src/logic/tokens/utils/tokenHelpers.ts +++ b/src/logic/tokens/utils/tokenHelpers.ts @@ -1,4 +1,3 @@ -import memoize from 'lodash.memoize' import logo from 'src/assets/icons/icon_etherTokens.svg' import generateBatchRequests from 'src/logic/contracts/generateBatchRequests' import { @@ -55,19 +54,17 @@ export const isSendERC721Transaction = (tx: any, txCode: string, knownTokens: an ) } -export const getERC721Symbol = memoize( - async (contractAddress: string): Promise => { - let tokenSymbol = 'UNKNOWN' - try { - const ERC721token = await getERC721TokenContract() - const tokenInstance = await ERC721token.at(contractAddress) - tokenSymbol = tokenInstance.symbol() - } catch (err) { - console.error(`Failed to retrieve token symbol for ERC721 token ${contractAddress}`) - } - return tokenSymbol - }, -) +export const getERC721Symbol = async (contractAddress: string): Promise => { + let tokenSymbol = 'UNKNOWN' + try { + const ERC721token = await getERC721TokenContract() + const tokenInstance = await ERC721token.at(contractAddress) + tokenSymbol = tokenInstance.symbol() + } catch (err) { + console.error(`Failed to retrieve token symbol for ERC721 token ${contractAddress}`) + } + return tokenSymbol +} export const getERC20DecimalsAndSymbol = async ( tokenAddress: string, diff --git a/src/routes/safe/store/actions/transactions/utils/transactionHelpers.ts b/src/routes/safe/store/actions/transactions/utils/transactionHelpers.ts index 99817565..ba8de692 100644 --- a/src/routes/safe/store/actions/transactions/utils/transactionHelpers.ts +++ b/src/routes/safe/store/actions/transactions/utils/transactionHelpers.ts @@ -256,13 +256,16 @@ export const buildTx = async ({ let tokenDecimals = 18 let tokenSymbol = 'ETH' - if (isSendERC20Tx) { - const { decimals, symbol } = await getERC20DecimalsAndSymbol(tx.to) - tokenDecimals = decimals - tokenSymbol = symbol - } else if (isSendERC721Tx) { - const { symbol } = await getERC721Symbol(tx.to) - tokenSymbol = symbol + try { + if (isSendERC20Tx) { + const { decimals, symbol } = await getERC20DecimalsAndSymbol(tx.to) + tokenDecimals = decimals + tokenSymbol = symbol + } else if (isSendERC721Tx) { + tokenSymbol = await getERC721Symbol(tx.to) + } + } catch (err) { + console.log(`Failed to retrieve token data from ${tx.to}`) } const txToStore = makeTransaction({