diff --git a/.travis.yml b/.travis.yml index 0de26386..9002cad5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -if: (branch = development) OR (branch = master) OR (type = pull_request) OR (tag IS present) +if: (branch = development) OR (branch = master) OR (branch = release/2.14.0) OR (type = pull_request) OR (tag IS present) sudo: required dist: bionic language: node_js @@ -23,10 +23,21 @@ matrix: - REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_XDAI} - STAGING_BUCKET_NAME=${STAGING_XDAI_BUCKET_NAME} if: (branch = master AND NOT type = pull_request) OR tag IS present + - env: + - REACT_APP_NETWORK='volta' + - REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_VOLTA} + - STAGING_BUCKET_NAME=${STAGING_VOLTA_BUCKET_NAME} + - env: + - REACT_APP_NETWORK='energy_web_chain' + - REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_EWC} + - STAGING_BUCKET_NAME=${STAGING_EWC_BUCKET_NAME} + if: ((branch = master OR branch = release/2.14.0) AND NOT type = pull_request) OR tag IS present + cache: yarn: true before_script: - if [[ -n "$TRAVIS_TAG" ]]; then export REACT_APP_ENV='production'; fi; + - if [ $TRAVIS_PULL_REQUEST != "false" ]; then export PUBLIC_URL="/${REACT_APP_NETWORK}/app"; fi; before_install: # Needed to deploy pull request and releases - sudo apt-get update @@ -71,7 +82,7 @@ deploy: on: branch: master - # xDai testing on staging + # EWC testing on staging - provider: s3 bucket: $STAGING_BUCKET_NAME access_key_id: $AWS_ACCESS_KEY_ID @@ -81,8 +92,8 @@ deploy: upload_dir: current/app region: $AWS_DEFAULT_REGION on: - branch: release/v2.13.0 - condition: $REACT_APP_NETWORK = xdai + branch: release/2.14.0 + condition: $REACT_APP_NETWORK = energy_web_chain # Prepare production deployment - provider: s3 diff --git a/config/travis/deploy_pull_request.sh b/config/travis/deploy_pull_request.sh index ca0e155d..e6f5e884 100755 --- a/config/travis/deploy_pull_request.sh +++ b/config/travis/deploy_pull_request.sh @@ -15,11 +15,11 @@ function deploy_pull_request { REVIEW_FEATURE_FOLDER="$REPO_NAME_ALPHANUMERIC/$PULL_REQUEST_NAME" # Deploy safe-team project - aws s3 sync build s3://${REVIEW_BUCKET_NAME}/${REVIEW_FEATURE_FOLDER}/app --delete + aws s3 sync build s3://${REVIEW_BUCKET_NAME}/${REVIEW_FEATURE_FOLDER}/${REACT_APP_NETWORK}/app --delete } function publish_pull_request_urls_in_github { - REVIEW_FEATURE_URL="https://$PULL_REQUEST_NAME--$REPO_NAME_ALPHANUMERIC.$REVIEW_ENVIRONMENT_DOMAIN/app" + REVIEW_FEATURE_URL="https://$PULL_REQUEST_NAME--$REPO_NAME_ALPHANUMERIC.$REVIEW_ENVIRONMENT_DOMAIN/$REACT_APP_NETWORK/app" # Using the Issues api instead of the PR api # Done so because every PR is an issue, and the issues api allows to post general comments, diff --git a/src/components/ConnectButton/index.tsx b/src/components/ConnectButton/index.tsx index a520594b..478a5712 100644 --- a/src/components/ConnectButton/index.tsx +++ b/src/components/ConnectButton/index.tsx @@ -3,7 +3,6 @@ import React from 'react' import Button from 'src/components/layout/Button' import { getNetworkId } from 'src/config' -import { ETHEREUM_NETWORK } from 'src/config/networks/network.d' import { getWeb3, setWeb3 } from 'src/logic/wallets/getWeb3' import { fetchProvider } from 'src/logic/wallets/store/actions' import transactionDataCheck from 'src/logic/wallets/transactionDataCheck' @@ -12,7 +11,6 @@ import { store } from 'src/store' import { BLOCKNATIVE_KEY } from 'src/utils/constants' const networkId = getNetworkId() -const BLOCKNATIVE_API_KEY = BLOCKNATIVE_KEY[networkId] ?? BLOCKNATIVE_KEY[ETHEREUM_NETWORK.RINKEBY] let lastUsedAddress = '' let providerName @@ -20,7 +18,7 @@ let providerName const wallets = getSupportedWallets() export const onboard = Onboard({ - dappId: BLOCKNATIVE_API_KEY, + dappId: BLOCKNATIVE_KEY, networkId: networkId, subscriptions: { wallet: (wallet) => { diff --git a/src/config/assets/token_ewc.svg b/src/config/assets/token_ewc.svg new file mode 100644 index 00000000..f52e2285 --- /dev/null +++ b/src/config/assets/token_ewc.svg @@ -0,0 +1,18 @@ + + + + +ewf_logo + + diff --git a/src/config/networks/energy_web_chain.ts b/src/config/networks/energy_web_chain.ts new file mode 100644 index 00000000..ee705489 --- /dev/null +++ b/src/config/networks/energy_web_chain.ts @@ -0,0 +1,47 @@ +import EwcLogo from 'src/config/assets/token_ewc.svg' +import { EnvironmentSettings, ETHEREUM_NETWORK, NetworkConfig } from 'src/config/networks/network.d' + +const baseConfig: EnvironmentSettings = { + txServiceUrl: 'https://safe-transaction.ewc.gnosis.io/api/v1', + safeAppsUrl: 'https://safe-apps.dev.gnosisdev.com', + gasPriceOracle: { + url: 'https://station.energyweb.org', + gasParameter: 'standard', + }, + rpcServiceUrl: 'https://rpc.energyweb.org', + networkExplorerName: 'Energy web explorer', + networkExplorerUrl: 'https://explorer.energyweb.org', + networkExplorerApiUrl: 'https://explorer.energyweb.org/api', +} + +const mainnet: NetworkConfig = { + environment: { + dev: { + ...baseConfig, + }, + staging: { + ...baseConfig, + safeAppsUrl: 'https://safe-apps.staging.gnosisdev.com', + }, + production: { + ...baseConfig, + safeAppsUrl: 'https://apps.gnosis-safe.io', + }, + }, + network: { + id: ETHEREUM_NETWORK.ENERGY_WEB_CHAIN, + backgroundColor: '#A566FF', + textColor: '#ffffff', + label: 'EWC', + isTestNet: false, + nativeCoin: { + address: '0x000', + name: 'Energy web token', + symbol: 'EWT', + decimals: 18, + logoUri: EwcLogo, + }, + } +} + +export default mainnet diff --git a/src/config/networks/index.ts b/src/config/networks/index.ts index 8944d16d..682b33d3 100644 --- a/src/config/networks/index.ts +++ b/src/config/networks/index.ts @@ -2,10 +2,14 @@ import local from './local' import mainnet from './mainnet' import rinkeby from './rinkeby' import xdai from './xdai' +import energy_web_chain from './energy_web_chain' +import volta from './volta' export default { local, mainnet, rinkeby, xdai, + energy_web_chain, + volta } diff --git a/src/config/networks/volta.ts b/src/config/networks/volta.ts new file mode 100644 index 00000000..d8930e6b --- /dev/null +++ b/src/config/networks/volta.ts @@ -0,0 +1,47 @@ +import EwcLogo from 'src/config/assets/token_ewc.svg' +import { EnvironmentSettings, ETHEREUM_NETWORK, NetworkConfig } from 'src/config/networks/network.d' + +const baseConfig: EnvironmentSettings = { + txServiceUrl: 'https://safe-transaction.volta.gnosis.io/api/v1', + safeAppsUrl: 'https://safe-apps.dev.gnosisdev.com', + gasPriceOracle: { + url: 'https://station.energyweb.org', + gasParameter: 'standard', + }, + rpcServiceUrl: 'https://volta-rpc.energyweb.org', + networkExplorerName: 'Volta explorer', + networkExplorerUrl: 'https://volta-explorer.energyweb.org', + networkExplorerApiUrl: 'https://volta-explorer.energyweb.org/api', +} + +const mainnet: NetworkConfig = { + environment: { + dev: { + ...baseConfig, + }, + staging: { + ...baseConfig, + safeAppsUrl: 'https://safe-apps.staging.gnosisdev.com', + }, + production: { + ...baseConfig, + safeAppsUrl: 'https://apps.gnosis-safe.io', + }, + }, + network: { + id: ETHEREUM_NETWORK.VOLTA, + backgroundColor: '#514989', + textColor: '#ffffff', + label: 'Volta', + isTestNet: true, + nativeCoin: { + address: '0x000', + name: 'Energy web token', + symbol: 'EWT', + decimals: 18, + logoUri: EwcLogo, + }, + } +} + +export default mainnet diff --git a/src/logic/wallets/utils/walletList.ts b/src/logic/wallets/utils/walletList.ts index 02f13f09..05e2b730 100644 --- a/src/logic/wallets/utils/walletList.ts +++ b/src/logic/wallets/utils/walletList.ts @@ -1,13 +1,11 @@ import { WalletInitOptions } from 'bnc-onboard/dist/src/interfaces' import { getNetworkId, getRpcServiceUrl, getNetworkConfigDisabledWallets } from 'src/config' -import { ETHEREUM_NETWORK, WALLETS } from 'src/config/networks/network.d' +import { WALLETS } from 'src/config/networks/network.d' import { FORTMATIC_KEY, PORTIS_ID } from 'src/utils/constants' const networkId = getNetworkId() const disabledWallets = getNetworkConfigDisabledWallets() -const PORTIS_DAPP_ID = PORTIS_ID[networkId] ?? PORTIS_ID[ETHEREUM_NETWORK.RINKEBY] -const FORTMATIC_API_KEY = FORTMATIC_KEY[networkId] ?? FORTMATIC_KEY[ETHEREUM_NETWORK.RINKEBY] type Wallet = WalletInitOptions & { desktop: boolean @@ -44,12 +42,12 @@ const wallets: Wallet[] = [ { walletName: WALLETS.DAPPER, desktop: false }, { walletName: WALLETS.FORTMATIC, - apiKey: FORTMATIC_API_KEY, + apiKey: FORTMATIC_KEY, desktop: true, }, { walletName: WALLETS.PORTIS, - apiKey: PORTIS_DAPP_ID, + apiKey: PORTIS_ID, desktop: true, }, { walletName: WALLETS.AUTHEREUM, desktop: false }, diff --git a/src/routes/safe/components/Apps/utils.ts b/src/routes/safe/components/Apps/utils.ts index c2471953..f26bfff4 100644 --- a/src/routes/safe/components/Apps/utils.ts +++ b/src/routes/safe/components/Apps/utils.ts @@ -74,8 +74,8 @@ export const staticAppsList: Array<{ url: string; disabled: boolean; networks: n networks: [ ETHEREUM_NETWORK.MAINNET, ETHEREUM_NETWORK.RINKEBY, - ETHEREUM_NETWORK.ENERGY_WEB_CHAIN, - ETHEREUM_NETWORK.VOLTA, + //ETHEREUM_NETWORK.ENERGY_WEB_CHAIN, + //ETHEREUM_NETWORK.VOLTA, // ETHEREUM_NETWORK.XDAI, ], }, diff --git a/src/utils/constants.ts b/src/utils/constants.ts index cf6fbe2e..4a9e2bb0 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -1,25 +1,11 @@ -import { ETHEREUM_NETWORK } from 'src/config/networks/network.d' - export const APP_ENV = process.env.REACT_APP_ENV export const NODE_ENV = process.env.NODE_ENV export const NETWORK = process.env.REACT_APP_NETWORK?.toUpperCase() || 'RINKEBY' export const INTERCOM_ID = APP_ENV === 'production' ? process.env.REACT_APP_INTERCOM_ID : 'plssl1fl' export const GOOGLE_ANALYTICS_ID = process.env.REACT_APP_GOOGLE_ANALYTICS || '' -export const PORTIS_ID = { - [ETHEREUM_NETWORK.RINKEBY]: '852b763d-f28b-4463-80cb-846d7ec5806b', - [ETHEREUM_NETWORK.MAINNET]: process.env.REACT_APP_PORTIS_ID, - [ETHEREUM_NETWORK.XDAI]: process.env.REACT_APP_PORTIS_ID, -} -export const FORTMATIC_KEY = { - [ETHEREUM_NETWORK.RINKEBY]: 'pk_test_CAD437AA29BE0A40', - [ETHEREUM_NETWORK.MAINNET]: process.env.REACT_APP_FORTMATIC_KEY, - [ETHEREUM_NETWORK.XDAI]: process.env.REACT_APP_FORTMATIC_KEY, -} -export const BLOCKNATIVE_KEY = { - [ETHEREUM_NETWORK.RINKEBY]: '7fbb9cee-7e97-4436-8770-8b29a9a8814c', - [ETHEREUM_NETWORK.MAINNET]: process.env.REACT_APP_BLOCKNATIVE_KEY, - [ETHEREUM_NETWORK.XDAI]: process.env.REACT_APP_BLOCKNATIVE_KEY, -} +export const PORTIS_ID = process.env.REACT_APP_PORTIS_ID ?? '852b763d-f28b-4463-80cb-846d7ec5806b' +export const FORTMATIC_KEY = process.env.REACT_APP_FORTMATIC_KEY ?? 'pk_test_CAD437AA29BE0A40' +export const BLOCKNATIVE_KEY = process.env.REACT_APP_BLOCKNATIVE_KEY ?? '7fbb9cee-7e97-4436-8770-8b29a9a8814c' /* * Not being used export const SQUARELINK_ID = {