Add config for EWC and Volta (#1513)
* Add config for EWC and Volta * Join tests in same file * change price oracle in volta * add travis config for volta and ewc * Update travis to build xDai only in master or version release * Add PR environment by network * simplify some constants assignments * Add PUBLIC_URL overwrite for PRs * Change PULL_REQUEST condition test * Use absolute path for PUBLIC_URL * Fix missing https:// * Adapt EWC/Volta config to use new gasPriceOracle format * disable openZeppeling in volta and EWC * Deploy EWC to staging * Fix Portis, Fortmatic and Blocknative key refactor * Set EWC deployment to release/2.14.0 Co-authored-by: Daniel Sanchez <daniel.sanchez@gnosis.pm>
This commit is contained in:
parent
02ba83cef2
commit
0278722645
19
.travis.yml
19
.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
|
sudo: required
|
||||||
dist: bionic
|
dist: bionic
|
||||||
language: node_js
|
language: node_js
|
||||||
|
@ -23,10 +23,21 @@ matrix:
|
||||||
- REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_XDAI}
|
- REACT_APP_GOOGLE_ANALYTICS=${REACT_APP_GOOGLE_ANALYTICS_ID_XDAI}
|
||||||
- STAGING_BUCKET_NAME=${STAGING_XDAI_BUCKET_NAME}
|
- STAGING_BUCKET_NAME=${STAGING_XDAI_BUCKET_NAME}
|
||||||
if: (branch = master AND NOT type = pull_request) OR tag IS present
|
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:
|
cache:
|
||||||
yarn: true
|
yarn: true
|
||||||
before_script:
|
before_script:
|
||||||
- if [[ -n "$TRAVIS_TAG" ]]; then export REACT_APP_ENV='production'; fi;
|
- 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:
|
before_install:
|
||||||
# Needed to deploy pull request and releases
|
# Needed to deploy pull request and releases
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
|
@ -71,7 +82,7 @@ deploy:
|
||||||
on:
|
on:
|
||||||
branch: master
|
branch: master
|
||||||
|
|
||||||
# xDai testing on staging
|
# EWC testing on staging
|
||||||
- provider: s3
|
- provider: s3
|
||||||
bucket: $STAGING_BUCKET_NAME
|
bucket: $STAGING_BUCKET_NAME
|
||||||
access_key_id: $AWS_ACCESS_KEY_ID
|
access_key_id: $AWS_ACCESS_KEY_ID
|
||||||
|
@ -81,8 +92,8 @@ deploy:
|
||||||
upload_dir: current/app
|
upload_dir: current/app
|
||||||
region: $AWS_DEFAULT_REGION
|
region: $AWS_DEFAULT_REGION
|
||||||
on:
|
on:
|
||||||
branch: release/v2.13.0
|
branch: release/2.14.0
|
||||||
condition: $REACT_APP_NETWORK = xdai
|
condition: $REACT_APP_NETWORK = energy_web_chain
|
||||||
|
|
||||||
# Prepare production deployment
|
# Prepare production deployment
|
||||||
- provider: s3
|
- provider: s3
|
||||||
|
|
|
@ -15,11 +15,11 @@ function deploy_pull_request {
|
||||||
REVIEW_FEATURE_FOLDER="$REPO_NAME_ALPHANUMERIC/$PULL_REQUEST_NAME"
|
REVIEW_FEATURE_FOLDER="$REPO_NAME_ALPHANUMERIC/$PULL_REQUEST_NAME"
|
||||||
|
|
||||||
# Deploy safe-team project
|
# 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 {
|
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
|
# 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,
|
# Done so because every PR is an issue, and the issues api allows to post general comments,
|
||||||
|
|
|
@ -3,7 +3,6 @@ import React from 'react'
|
||||||
|
|
||||||
import Button from 'src/components/layout/Button'
|
import Button from 'src/components/layout/Button'
|
||||||
import { getNetworkId } from 'src/config'
|
import { getNetworkId } from 'src/config'
|
||||||
import { ETHEREUM_NETWORK } from 'src/config/networks/network.d'
|
|
||||||
import { getWeb3, setWeb3 } from 'src/logic/wallets/getWeb3'
|
import { getWeb3, setWeb3 } from 'src/logic/wallets/getWeb3'
|
||||||
import { fetchProvider } from 'src/logic/wallets/store/actions'
|
import { fetchProvider } from 'src/logic/wallets/store/actions'
|
||||||
import transactionDataCheck from 'src/logic/wallets/transactionDataCheck'
|
import transactionDataCheck from 'src/logic/wallets/transactionDataCheck'
|
||||||
|
@ -12,7 +11,6 @@ import { store } from 'src/store'
|
||||||
import { BLOCKNATIVE_KEY } from 'src/utils/constants'
|
import { BLOCKNATIVE_KEY } from 'src/utils/constants'
|
||||||
|
|
||||||
const networkId = getNetworkId()
|
const networkId = getNetworkId()
|
||||||
const BLOCKNATIVE_API_KEY = BLOCKNATIVE_KEY[networkId] ?? BLOCKNATIVE_KEY[ETHEREUM_NETWORK.RINKEBY]
|
|
||||||
|
|
||||||
let lastUsedAddress = ''
|
let lastUsedAddress = ''
|
||||||
let providerName
|
let providerName
|
||||||
|
@ -20,7 +18,7 @@ let providerName
|
||||||
const wallets = getSupportedWallets()
|
const wallets = getSupportedWallets()
|
||||||
|
|
||||||
export const onboard = Onboard({
|
export const onboard = Onboard({
|
||||||
dappId: BLOCKNATIVE_API_KEY,
|
dappId: BLOCKNATIVE_KEY,
|
||||||
networkId: networkId,
|
networkId: networkId,
|
||||||
subscriptions: {
|
subscriptions: {
|
||||||
wallet: (wallet) => {
|
wallet: (wallet) => {
|
||||||
|
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!-- Generator: Adobe Illustrator 24.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
|
||||||
|
viewBox="0 0 124.7 124.7" style="enable-background:new 0 0 124.7 124.7;" xml:space="preserve">
|
||||||
|
<style type="text/css">
|
||||||
|
.st0{fill:#A566FF;}
|
||||||
|
</style>
|
||||||
|
<title>ewf_logo</title>
|
||||||
|
<path class="st0" d="M62.3,0C27.9,0,0,27.9,0,62.3s27.9,62.3,62.3,62.3s62.3-27.9,62.3-62.3l0,0C124.7,27.9,96.8,0,62.3,0z M59.5,93
|
||||||
|
c-3.4,2.4-7.5,3.8-11.6,3.8c-7.2,0-13.8-3.9-18.8-11.1c-4.5-6.9-7-14.9-7.2-23.1c0-0.3,0.2-0.6,0.5-0.7l4.9-2.2c0.4-0.2,0.8,0,1,0.4
|
||||||
|
c0,0.1,0.1,0.2,0.1,0.3l0,0c0,8.2,2.2,15.9,6.1,21.6c3.7,5.4,8.5,8.3,13.5,8.3c2.7,0,5.4-0.8,7.6-2.3c0.3-0.2,0.8-0.1,1,0.2
|
||||||
|
c1,1.3,2,2.5,3.1,3.7C59.8,92.2,59.8,92.7,59.5,93C59.5,93,59.5,93,59.5,93z M95.6,85.7C90.7,92.8,84,96.8,76.8,96.8
|
||||||
|
S63,92.8,58,85.7c-4.7-6.8-7.3-15.8-7.3-25.3c0-8.8,5.1-15.7,11.5-15.7s11.5,6.9,11.5,15.7c0.1,7.7-1.7,15.2-5.3,22
|
||||||
|
c-0.2,0.4-0.7,0.5-1,0.3c-0.1,0-0.1-0.1-0.2-0.2c-0.6-0.7-1.2-1.4-1.7-2.1c-0.6-0.9-1.1-1.7-1.6-2.7c-0.1-0.2-0.1-0.5,0-0.7
|
||||||
|
c2.3-5.3,3.4-11,3.4-16.7c0-4.3-2.2-9.2-5.1-9.2s-5.1,4.9-5.1,9.2c0,8.2,2.2,15.9,6.1,21.6c3.7,5.4,8.5,8.3,13.5,8.3s9.8-3,13.5-8.3
|
||||||
|
c3.9-5.7,6.1-13.4,6.1-21.6s-2.2-15.9-6.1-21.6c-1.1-1.7-2.5-3.2-4-4.5c-0.3-0.3-0.3-0.8-0.1-1.1c0.1-0.1,0.2-0.2,0.3-0.2l4.9-2.2
|
||||||
|
c0.3-0.1,0.6-0.1,0.8,0.2c1.3,1.3,2.4,2.7,3.4,4.1c4.7,6.8,7.3,15.8,7.3,25.3S100.3,78.9,95.6,85.7z"/>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1.5 KiB |
|
@ -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
|
|
@ -2,10 +2,14 @@ import local from './local'
|
||||||
import mainnet from './mainnet'
|
import mainnet from './mainnet'
|
||||||
import rinkeby from './rinkeby'
|
import rinkeby from './rinkeby'
|
||||||
import xdai from './xdai'
|
import xdai from './xdai'
|
||||||
|
import energy_web_chain from './energy_web_chain'
|
||||||
|
import volta from './volta'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
local,
|
local,
|
||||||
mainnet,
|
mainnet,
|
||||||
rinkeby,
|
rinkeby,
|
||||||
xdai,
|
xdai,
|
||||||
|
energy_web_chain,
|
||||||
|
volta
|
||||||
}
|
}
|
||||||
|
|
|
@ -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
|
|
@ -1,13 +1,11 @@
|
||||||
import { WalletInitOptions } from 'bnc-onboard/dist/src/interfaces'
|
import { WalletInitOptions } from 'bnc-onboard/dist/src/interfaces'
|
||||||
|
|
||||||
import { getNetworkId, getRpcServiceUrl, getNetworkConfigDisabledWallets } from 'src/config'
|
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'
|
import { FORTMATIC_KEY, PORTIS_ID } from 'src/utils/constants'
|
||||||
|
|
||||||
const networkId = getNetworkId()
|
const networkId = getNetworkId()
|
||||||
const disabledWallets = getNetworkConfigDisabledWallets()
|
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 & {
|
type Wallet = WalletInitOptions & {
|
||||||
desktop: boolean
|
desktop: boolean
|
||||||
|
@ -44,12 +42,12 @@ const wallets: Wallet[] = [
|
||||||
{ walletName: WALLETS.DAPPER, desktop: false },
|
{ walletName: WALLETS.DAPPER, desktop: false },
|
||||||
{
|
{
|
||||||
walletName: WALLETS.FORTMATIC,
|
walletName: WALLETS.FORTMATIC,
|
||||||
apiKey: FORTMATIC_API_KEY,
|
apiKey: FORTMATIC_KEY,
|
||||||
desktop: true,
|
desktop: true,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
walletName: WALLETS.PORTIS,
|
walletName: WALLETS.PORTIS,
|
||||||
apiKey: PORTIS_DAPP_ID,
|
apiKey: PORTIS_ID,
|
||||||
desktop: true,
|
desktop: true,
|
||||||
},
|
},
|
||||||
{ walletName: WALLETS.AUTHEREUM, desktop: false },
|
{ walletName: WALLETS.AUTHEREUM, desktop: false },
|
||||||
|
|
|
@ -74,8 +74,8 @@ export const staticAppsList: Array<{ url: string; disabled: boolean; networks: n
|
||||||
networks: [
|
networks: [
|
||||||
ETHEREUM_NETWORK.MAINNET,
|
ETHEREUM_NETWORK.MAINNET,
|
||||||
ETHEREUM_NETWORK.RINKEBY,
|
ETHEREUM_NETWORK.RINKEBY,
|
||||||
ETHEREUM_NETWORK.ENERGY_WEB_CHAIN,
|
//ETHEREUM_NETWORK.ENERGY_WEB_CHAIN,
|
||||||
ETHEREUM_NETWORK.VOLTA,
|
//ETHEREUM_NETWORK.VOLTA,
|
||||||
// ETHEREUM_NETWORK.XDAI,
|
// ETHEREUM_NETWORK.XDAI,
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
|
@ -1,25 +1,11 @@
|
||||||
import { ETHEREUM_NETWORK } from 'src/config/networks/network.d'
|
|
||||||
|
|
||||||
export const APP_ENV = process.env.REACT_APP_ENV
|
export const APP_ENV = process.env.REACT_APP_ENV
|
||||||
export const NODE_ENV = process.env.NODE_ENV
|
export const NODE_ENV = process.env.NODE_ENV
|
||||||
export const NETWORK = process.env.REACT_APP_NETWORK?.toUpperCase() || 'RINKEBY'
|
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 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 GOOGLE_ANALYTICS_ID = process.env.REACT_APP_GOOGLE_ANALYTICS || ''
|
||||||
export const PORTIS_ID = {
|
export const PORTIS_ID = process.env.REACT_APP_PORTIS_ID ?? '852b763d-f28b-4463-80cb-846d7ec5806b'
|
||||||
[ETHEREUM_NETWORK.RINKEBY]: '852b763d-f28b-4463-80cb-846d7ec5806b',
|
export const FORTMATIC_KEY = process.env.REACT_APP_FORTMATIC_KEY ?? 'pk_test_CAD437AA29BE0A40'
|
||||||
[ETHEREUM_NETWORK.MAINNET]: process.env.REACT_APP_PORTIS_ID,
|
export const BLOCKNATIVE_KEY = process.env.REACT_APP_BLOCKNATIVE_KEY ?? '7fbb9cee-7e97-4436-8770-8b29a9a8814c'
|
||||||
[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,
|
|
||||||
}
|
|
||||||
/*
|
/*
|
||||||
* Not being used
|
* Not being used
|
||||||
export const SQUARELINK_ID = {
|
export const SQUARELINK_ID = {
|
||||||
|
|
Loading…
Reference in New Issue