diff --git a/config/.env.example b/config/.env.example index 700efdd..1be5463 100644 --- a/config/.env.example +++ b/config/.env.example @@ -1,4 +1,5 @@ NODE_ENV=production|dev +NETWORK_TYPE=mainnet/testnet BACKEND_PORT= (port on which server will be accessed from browser) FRONTEND_PORT= URL=http://ip/localhost/domain diff --git a/config/config.js b/config/config.js index 2aaacce..52f0433 100644 --- a/config/config.js +++ b/config/config.js @@ -35,6 +35,7 @@ const envVariables = [ 'STAKING', 'PARAMS_ENDPOINT', 'BLOCK_EXPLORER', + 'NETWORK_TYPE' ]; if (process.env.NODE_ENV === 'production') { @@ -201,6 +202,7 @@ const Config = { API: `${URL_ROOT}/api`, }, CUDOS_NETWORK: { + NETWORK_TYPE: process.env.NETWORK_TYPE, CHAIN_NAME: process.env.CHAIN_NAME, CHAIN_ID: process.env.CHAIN_ID, GRAVITY_MODULE_ADDRESS: process.env.GRAVITY_MODULE_ADDRESS, @@ -221,6 +223,8 @@ const Config = { ETHEREUM: { ETHEREUM_GAS: process.env.ETHEREUM_GAS, ETHEREUM_RPC: process.env.ETHEREUM_RPC, + ETHERSCAN_RINKEBY: 'https://rinkeby.etherscan.io/tx', + ETHERSCAN_MAINNET: 'https://etherscan.io/tx' }, }; diff --git a/src/frontend/resources/common/js/components-popups/SummaryModal.tsx b/src/frontend/resources/common/js/components-popups/SummaryModal.tsx index 7b4b19e..a48d2d8 100644 --- a/src/frontend/resources/common/js/components-popups/SummaryModal.tsx +++ b/src/frontend/resources/common/js/components-popups/SummaryModal.tsx @@ -37,8 +37,10 @@ const SummaryModal = ({ const fromNetwork = selectedFromNetwork ? 'CUDOS' : 'Ethereum'; const ToNetwork = selectedToNetwork ? 'CUDOS' : 'Ethereum'; - const ETHERSCAN_RINKEBY = 'https://rinkeby.etherscan.io/tx'; - const ETHERSCAN_MAINNET = 'https://etherscan.io/tx'; + const ETHERSCAN_EXPLORER = + Config.CUDOS_NETWORK.NETWORK_TYPE === "mainnet"? + Config.ETHEREUM.ETHERSCAN_MAINNET: + Config.ETHEREUM.ETHERSCAN_RINKEBY const CUDOS_EXPLORER = Config.CUDOS_NETWORK.BLOCK_EXPLORER; const onCloseModal = async () => { @@ -102,7 +104,7 @@ const SummaryModal = ({
Transaction
-
+
Bridge transaction link