-
+
{`${formatAmount(safe.ethBalance)} ETH`}
diff --git a/src/config/networks/local.ts b/src/config/networks/local.ts
index 0be103570d..ad51c88312 100644
--- a/src/config/networks/local.ts
+++ b/src/config/networks/local.ts
@@ -23,6 +23,7 @@ const local: NetworkConfig = {
backgroundColor: '#E8673C',
textColor: '#ffffff',
label: 'LocalRPC',
+ isTestNet: true,
nativeCoin: {
address: '0x000',
name: 'Ether',
diff --git a/src/config/networks/mainnet.ts b/src/config/networks/mainnet.ts
index 4876af22d3..89945ae6af 100644
--- a/src/config/networks/mainnet.ts
+++ b/src/config/networks/mainnet.ts
@@ -31,6 +31,7 @@ const mainnet: NetworkConfig = {
backgroundColor: '#E8E7E6',
textColor: '#001428',
label: 'Mainnet',
+ isTestNet: false,
nativeCoin: {
address: '0x000',
name: 'Ether',
diff --git a/src/config/networks/network.d.ts b/src/config/networks/network.d.ts
index 77345ea9e8..fbdebfca83 100644
--- a/src/config/networks/network.d.ts
+++ b/src/config/networks/network.d.ts
@@ -27,6 +27,7 @@ export type NetworkSettings = {
backgroundColor: string,
textColor: string,
label: string,
+ isTestNet: boolean,
nativeCoin: Token,
}
diff --git a/src/config/networks/rinkeby.ts b/src/config/networks/rinkeby.ts
index 41e2977a4f..2f0650b0e3 100644
--- a/src/config/networks/rinkeby.ts
+++ b/src/config/networks/rinkeby.ts
@@ -31,6 +31,7 @@ const rinkeby: NetworkConfig = {
backgroundColor: '#E8673C',
textColor: '#ffffff',
label: 'Rinkeby',
+ isTestNet: true,
nativeCoin: {
address: '0x000',
name: 'Ether',
diff --git a/src/config/networks/xdai.ts b/src/config/networks/xdai.ts
index 86dd160429..4756b9c409 100644
--- a/src/config/networks/xdai.ts
+++ b/src/config/networks/xdai.ts
@@ -16,7 +16,8 @@ const xDai: NetworkConfig = {
id: ETHEREUM_NETWORK.XDAI,
backgroundColor: '#48A8A6',
textColor: '#ffffff',
- label: 'xDai STAKE',
+ label: 'xDai',
+ isTestNet: false,
nativeCoin: {
address: '0x000',
name: 'xDai',
diff --git a/src/logic/notifications/notificationTypes.ts b/src/logic/notifications/notificationTypes.ts
index d1b1b90cd7..9765045660 100644
--- a/src/logic/notifications/notificationTypes.ts
+++ b/src/logic/notifications/notificationTypes.ts
@@ -45,7 +45,7 @@ const NOTIFICATION_IDS = {
SETTINGS_CHANGE_EXECUTED_MSG: 'SETTINGS_CHANGE_EXECUTED_MSG',
SETTINGS_CHANGE_EXECUTED_MORE_CONFIRMATIONS_MSG: 'SETTINGS_CHANGE_EXECUTED_MORE_CONFIRMATIONS_MSG',
SETTINGS_CHANGE_FAILED_MSG: 'SETTINGS_CHANGE_FAILED_MSG',
- RINKEBY_VERSION_MSG: 'RINKEBY_VERSION_MSG',
+ TESTNET_VERSION_MSG: 'TESTNET_VERSION_MSG',
WRONG_NETWORK_MSG: 'WRONG_NETWORK_MSG',
ADDRESS_BOOK_NEW_ENTRY_SUCCESS: 'ADDRESS_BOOK_NEW_ENTRY_SUCCESS',
ADDRESS_BOOK_EDIT_ENTRY_SUCCESS: 'ADDRESS_BOOK_EDIT_ENTRY_SUCCESS',
@@ -192,8 +192,8 @@ export const NOTIFICATIONS: Record = {
},
// Network
- RINKEBY_VERSION_MSG: {
- message: "Rinkeby Version: Don't send Mainnet assets to this Safe",
+ TESTNET_VERSION_MSG: {
+ message: "Testnet Version: Don't send production assets to this Safe",
options: { variant: WARNING, persist: true, preventDuplicate: true },
},
WRONG_NETWORK_MSG: {
diff --git a/src/logic/wallets/store/actions/fetchProvider.ts b/src/logic/wallets/store/actions/fetchProvider.ts
index c2907c67dc..79ce447960 100644
--- a/src/logic/wallets/store/actions/fetchProvider.ts
+++ b/src/logic/wallets/store/actions/fetchProvider.ts
@@ -2,10 +2,9 @@ import ReactGA from 'react-ga'
import addProvider from './addProvider'
-import { getNetworkId } from 'src/config'
+import { getNetworkId, getNetworkInfo } from 'src/config'
import { NOTIFICATIONS, enhanceSnackbarForAction } from 'src/logic/notifications'
import enqueueSnackbar from 'src/logic/notifications/store/actions/enqueueSnackbar'
-import { ETHEREUM_NETWORK } from 'src/config/networks/network.d'
import { getProviderInfo, getWeb3 } from 'src/logic/wallets/getWeb3'
import { makeProvider } from 'src/logic/wallets/store/model/provider'
import { updateStoredTransactionsStatus } from 'src/logic/safe/store/actions/transactions/utils/transactionHelpers'
@@ -29,8 +28,9 @@ const handleProviderNotification = (provider, dispatch) => {
dispatch(enqueueSnackbar(NOTIFICATIONS.WRONG_NETWORK_MSG))
return
}
- if (ETHEREUM_NETWORK.RINKEBY === getNetworkId()) {
- dispatch(enqueueSnackbar(enhanceSnackbarForAction(NOTIFICATIONS.RINKEBY_VERSION_MSG)))
+
+ if (getNetworkInfo().isTestNet) {
+ dispatch(enqueueSnackbar(enhanceSnackbarForAction(NOTIFICATIONS.TESTNET_VERSION_MSG)))
}
if (available) {