Skip to content
This repository was archived by the owner on Nov 10, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d109767
Add coin by network
nicosampler Oct 20, 2020
a5fd8a5
remove debugger
nicosampler Oct 20, 2020
2712525
review changes
nicosampler Oct 20, 2020
bd953f9
Add config for EWC and Volta
nicosampler Oct 21, 2020
894002a
review change
nicosampler Oct 21, 2020
0340485
Join tests in same file
Oct 22, 2020
d509f4c
Merge branch 'development' into issue-1498
Oct 22, 2020
d1d0ac1
Merge branch 'development' into issue-1253
nicosampler Oct 22, 2020
a61c1c1
change price oracle in volta
nicosampler Oct 22, 2020
90582ac
add travis config for volta and ewc
nicosampler Oct 22, 2020
2326fc2
change config file to camelCase
nicosampler Oct 22, 2020
329b048
add travis config to deploy for release v2.14.0
nicosampler Oct 22, 2020
b2716c0
rollback ewc filename
nicosampler Oct 22, 2020
e49bc68
Merge branch 'development' into issue-1253
nicosampler Oct 22, 2020
0206adb
Update travis to build xDai only in master or version release
Oct 23, 2020
bada045
Merge branch 'development' into issue-1498
Oct 23, 2020
38c5166
Merge remote-tracking branch 'origin/issue-1498' into issue-1253
Oct 23, 2020
5d0d695
Merge branch 'development' into issue-1253
Oct 23, 2020
0f6deef
Add PR environment by network
Oct 23, 2020
f209f8f
simplify some contstants assignments
nicosampler Oct 23, 2020
141f7d4
Add PUBLIC_URL overwrite for PRs
Oct 23, 2020
f6df33c
Change PULL_REQUEST condition test
Oct 23, 2020
57d1b14
Add brackets to env var
Oct 23, 2020
a327c82
Update env var
Oct 23, 2020
850c525
Set Public URL to base dir in PR
Oct 23, 2020
6052926
Set public_url base route
Oct 23, 2020
d3b3ff0
Use absolute path for PUBLIC_URL
Oct 23, 2020
13b4222
Fix missing https://
Oct 23, 2020
136d43e
Merge branch 'development' into issue-1253
Oct 23, 2020
873437c
Adapt EWC/Volta config to use new gasPriceOracle format
Oct 23, 2020
ed7264b
disable openZeppeling in volta and EWC
nicosampler Oct 27, 2020
7d6820b
Deploy EWC to staging
Oct 27, 2020
08e270b
Fix Portis, Fortmatic and Blocknative key refactor
Oct 27, 2020
04162fb
Set EWC deployment to release/2.14.0
Oct 28, 2020
8f59d50
Merge branch 'development' into issue-1253
Oct 28, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/travis/deploy_pull_request.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
4 changes: 1 addition & 3 deletions src/components/ConnectButton/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand All @@ -12,15 +11,14 @@ 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

const wallets = getSupportedWallets()

export const onboard = Onboard({
dappId: BLOCKNATIVE_API_KEY,
dappId: BLOCKNATIVE_KEY,
networkId: networkId,
subscriptions: {
wallet: (wallet) => {
Expand Down
18 changes: 18 additions & 0 deletions src/config/assets/token_ewc.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions src/config/networks/energy_web_chain.ts
Original file line number Diff line number Diff line change
@@ -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
4 changes: 4 additions & 0 deletions src/config/networks/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
47 changes: 47 additions & 0 deletions src/config/networks/volta.ts
Original file line number Diff line number Diff line change
@@ -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
8 changes: 3 additions & 5 deletions src/logic/wallets/utils/walletList.ts
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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 },
Expand Down
4 changes: 2 additions & 2 deletions src/routes/safe/components/Apps/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
],
},
Expand Down
20 changes: 3 additions & 17 deletions src/utils/constants.ts
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down