From d8be4ecd775fe5ad07ea0149aebf75619e9d2858 Mon Sep 17 00:00:00 2001 From: Gabriel <0xgabi@gmail.com> Date: Tue, 20 Apr 2021 19:10:14 -0300 Subject: [PATCH 01/13] Update wrapper version and network configuration --- package.json | 6 +++--- src/App.js | 1 + src/aragonjs-wrapper.js | 2 +- src/local-settings.js | 2 +- src/network-config.js | 2 +- src/prop-types.js | 2 +- yarn.lock | 48 ++++++++++++++++++++--------------------- 7 files changed, 32 insertions(+), 31 deletions(-) diff --git a/package.json b/package.json index 8f7c93940..ecccea9e4 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "dependencies": { "@aragon/templates-tokens": "^1.2.1", "@aragon/ui": "^1.5.0", - "@aragon/wrapper": "^5.0.0-rc.28", + "@1hive/wrapper": "^5.0.0", "@sentry/browser": "^5.17.0", "@ungap/event-target": "^0.1.0", "clipboard-polyfill": "^2.8.6", @@ -98,8 +98,8 @@ "rimraf": "^2.6.2" }, "resolutions": { - "@aragon/wrapper/web3": "1.2.6", - "@aragon/wrapper/web3-eth-abi": "1.2.6" + "@1hive/wrapper/web3": "1.2.6", + "@1hive/wrapper/web3-eth-abi": "1.2.6" }, "scripts": { "bundlewatch": "bundlewatch", diff --git a/src/App.js b/src/App.js index ae989bc42..fab88a139 100644 --- a/src/App.js +++ b/src/App.js @@ -46,6 +46,7 @@ const INITIAL_DAO_STATE = { } const SELECTOR_NETWORKS = [ + ['xdai', 'xDai Network', 'https://aragon.1hive.org/'], ['main', 'Ethereum Mainnet', 'https://client.aragon.org/'], [ 'rinkeby', diff --git a/src/aragonjs-wrapper.js b/src/aragonjs-wrapper.js index 5b8facde9..d5624dc4f 100644 --- a/src/aragonjs-wrapper.js +++ b/src/aragonjs-wrapper.js @@ -4,7 +4,7 @@ import Aragon, { ensResolve, getRecommendedGasLimit, providers, -} from '@aragon/wrapper' +} from '@1hive/wrapper' import { appOverrides, sortAppsPair, diff --git a/src/local-settings.js b/src/local-settings.js index 7d40f5510..b3883b492 100644 --- a/src/local-settings.js +++ b/src/local-settings.js @@ -124,7 +124,7 @@ export function getEthSubscriptionEventDelay() { } export function getIpfsGateway() { - return getLocalSetting(IPFS_GATEWAY) || 'https://ipfs.eth.aragon.network/ipfs' + return getLocalSetting(IPFS_GATEWAY) || 'https://ipfs.io/ipfs' } export function setIpfsGateway(gateway) { diff --git a/src/network-config.js b/src/network-config.js index aa0cd5def..ebd619d4c 100644 --- a/src/network-config.js +++ b/src/network-config.js @@ -99,7 +99,7 @@ export const networkConfigs = { localEnsRegistryAddress || '0xaafca6b0c89521752e559650206d7c925fd0e530', }, nodes: { - defaultEth: 'wss://xdai.poanetwork.dev/wss', + defaultEth: 'wss://xdai.1hive.org', }, settings: { chainId: 100, diff --git a/src/prop-types.js b/src/prop-types.js index a7945ff59..f302729bd 100644 --- a/src/prop-types.js +++ b/src/prop-types.js @@ -1,5 +1,5 @@ import PropTypes from 'prop-types' -import Aragon from '@aragon/wrapper' +import Aragon from '@1hive/wrapper' import { APPS_STATUS_ERROR, APPS_STATUS_READY, diff --git a/yarn.lock b/yarn.lock index f78fa59d3..ab939ae20 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,26 @@ # yarn lockfile v1 +"@1hive/wrapper@^5.0.0": + version "5.0.0" + resolved "https://registry.yarnpkg.com/@1hive/wrapper/-/wrapper-5.0.0.tgz#f25234cf1d0bdee5e5168743778590951b5f0b02" + integrity sha512-bMnAbYiGp/QIsjaAqz33uF6AUzgq2DJE1hctm69W58GQgqpYG7QooNK+LNdWTCNg1tPUJ9qk8YjAEcf0URAjAQ== + dependencies: + "@aragon/os" "^4.2.1" + "@aragon/rpc-messenger" "^2.0.0" + "@babel/runtime" "^7.1.2" + axios "^0.19.0" + dot-prop "^4.2.0" + eth-ens-namehash "^2.0.8" + ethjs-ens "^2.0.1" + localforage "^1.7.3" + localforage-memoryStorageDriver "^0.9.2" + radspec "^1.8.0" + rxjs "^6.5.2" + web3 "1.2.6" + web3-eth-abi "1.2.6" + web3-utils "1.2.6" + "@aragon/os@^4.0.0", "@aragon/os@^4.2.1": version "4.3.0" resolved "https://registry.yarnpkg.com/@aragon/os/-/os-4.3.0.tgz#d40b27031affb2c4238648ae7c48970d47f3b9bc" @@ -59,26 +79,6 @@ recursive-copy "^2.0.9" use-inside "^0.2.0" -"@aragon/wrapper@^5.0.0-rc.28": - version "5.0.0-rc.28" - resolved "https://registry.yarnpkg.com/@aragon/wrapper/-/wrapper-5.0.0-rc.28.tgz#4d00928e1633935106395e558d05d0521ea6760e" - integrity sha512-78fWoE/oAOGHNlvq+aZyXy0hZ6JBeqxdS07HXvyucb/fFhphG/puDmkDudP1esMIYmQbbviB+dT6mpa2ctTzQw== - dependencies: - "@aragon/os" "^4.2.1" - "@aragon/rpc-messenger" "^2.0.0" - "@babel/runtime" "^7.1.2" - axios "^0.19.0" - dot-prop "^4.2.0" - eth-ens-namehash "^2.0.8" - ethjs-ens "^2.0.1" - localforage "^1.7.3" - localforage-memoryStorageDriver "^0.9.2" - radspec "^1.5.0" - rxjs "^6.5.2" - web3 "^1.2.6" - web3-eth-abi "^1.2.6" - web3-utils "^1.2.6" - "@babel/code-frame@^7.0.0", "@babel/code-frame@^7.8.3": version "7.8.3" resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.8.3.tgz#33e25903d7481181534e12ec0a25f16b6fcf419e" @@ -10301,10 +10301,10 @@ quote-stream@^1.0.1, quote-stream@~1.0.2: minimist "^1.1.3" through2 "^2.0.0" -radspec@^1.5.0: - version "1.10.0" - resolved "https://registry.yarnpkg.com/radspec/-/radspec-1.10.0.tgz#15230c496f3f924265e047bb51be800edb312a2f" - integrity sha512-vuDL7gwDcUFge9+PLnzgrhJDBiLbtOuE8rpZ1vEz0g0kiKBZXKyiF9zgpTRrEMFU+eKJgXQ8nqigSis/OBeodg== +radspec@^1.8.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/radspec/-/radspec-1.11.0.tgz#c3ac21625625726a1349ec011a1dc4dcf97fa10a" + integrity sha512-/77PHRjNaaFUyxCqz7bxyRswc4OhF3H3u6OTde7aHsYl/5s+7Cgi24Ia/hx6l/5fuNps57vgiMSbY6mceA+ovA== dependencies: "@babel/runtime" "^7.1.2" bn.js "^4.11.8" From b006b2d836fa761511d3bf2f818d40175380ef12 Mon Sep 17 00:00:00 2001 From: Gabriel <0xgabi@gmail.com> Date: Thu, 20 May 2021 04:05:47 -0300 Subject: [PATCH 02/13] Add support for Polygon network --- package.json | 2 ++ src/App.js | 2 ++ src/network-config.js | 21 +++++++++++++++++++++ 3 files changed, 25 insertions(+) diff --git a/package.json b/package.json index ecccea9e4..fac3002ef 100644 --- a/package.json +++ b/package.json @@ -110,6 +110,7 @@ "start:staging": "cross-env ARAGON_ENS_REGISTRY_ADDRESS=0xfe03625ea880a8cba336f9b5ad6e15b0a3b5a939 npm start", "start:ropsten": "cross-env ARAGON_ETH_NETWORK_TYPE=ropsten npm start", "start:xdai": "cross-env ARAGON_ETH_NETWORK_TYPE=xdai npm start", + "start:polygon": "cross-env ARAGON_ETH_NETWORK_TYPE=polygon npm start", "build": "node scripts/build", "build:local": "node scripts/build-local", "build:mainnet": "cross-env ARAGON_ETH_NETWORK_TYPE=main npm run build", @@ -117,6 +118,7 @@ "build:staging": "cross-env ARAGON_ENS_REGISTRY_ADDRESS=0xfe03625ea880a8cba336f9b5ad6e15b0a3b5a939 npm run build", "build:ropsten": "cross-env ARAGON_ETH_NETWORK_TYPE=ropsten npm run build", "build:xdai": "cross-env ARAGON_ETH_NETWORK_TYPE=xdai npm run build", + "build:polygon": "cross-env ARAGON_ETH_NETWORK_TYPE=polygon npm run build", "lint": "eslint ./src", "test": "npm run lint && npm run jest", "jest": "jest", diff --git a/src/App.js b/src/App.js index fab88a139..0d2006d4b 100644 --- a/src/App.js +++ b/src/App.js @@ -45,6 +45,8 @@ const INITIAL_DAO_STATE = { repos: [], } +// TODO: add polygon +// ['polygon', 'Polygon Network', 'https://aragon.polygon.1hive.org/'], const SELECTOR_NETWORKS = [ ['xdai', 'xDai Network', 'https://aragon.1hive.org/'], ['main', 'Ethereum Mainnet', 'https://client.aragon.org/'], diff --git a/src/network-config.js b/src/network-config.js index ebd619d4c..9b01412bd 100644 --- a/src/network-config.js +++ b/src/network-config.js @@ -114,6 +114,27 @@ export const networkConfigs = { portisDappId ? { id: 'portis', conf: portisDappId } : null, ].filter(p => p), }, + polygon: { + addresses: { + ensRegistry: + localEnsRegistryAddress || '0x4E065c622d584Fbe5D9078C3081840155FA69581', + }, + nodes: { + defaultEth: 'wss://rpc-mainnet.matic.quiknode.pro', + }, + settings: { + chainId: 137, + name: 'Polygon', + shortName: 'polygon', + type: 'private', + live: true, + }, + providers: [ + { id: 'provided' }, + { id: 'frame' }, + portisDappId ? { id: 'portis', conf: portisDappId } : null, + ].filter(p => p), + }, unknown: { addresses: { ensRegistry: localEnsRegistryAddress, From ac15347186cf3651016e6c01ad2375941c2da4ba Mon Sep 17 00:00:00 2001 From: Gabi Date: Mon, 31 May 2021 15:42:20 -0300 Subject: [PATCH 03/13] Update network-config.js --- src/network-config.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/network-config.js b/src/network-config.js index 9b01412bd..48796b1d3 100644 --- a/src/network-config.js +++ b/src/network-config.js @@ -120,7 +120,7 @@ export const networkConfigs = { localEnsRegistryAddress || '0x4E065c622d584Fbe5D9078C3081840155FA69581', }, nodes: { - defaultEth: 'wss://rpc-mainnet.matic.quiknode.pro', + defaultEth: 'wss://ws-matic-mainnet.chainstacklabs.com', }, settings: { chainId: 137, From 4e675a6f0273ea92d8d208ad409fc7fefc74c1f8 Mon Sep 17 00:00:00 2001 From: Gabi Date: Mon, 31 May 2021 15:47:07 -0300 Subject: [PATCH 04/13] Update App.js --- src/App.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/App.js b/src/App.js index 0d2006d4b..6fcb9eaa1 100644 --- a/src/App.js +++ b/src/App.js @@ -45,10 +45,10 @@ const INITIAL_DAO_STATE = { repos: [], } -// TODO: add polygon -// ['polygon', 'Polygon Network', 'https://aragon.polygon.1hive.org/'], + const SELECTOR_NETWORKS = [ ['xdai', 'xDai Network', 'https://aragon.1hive.org/'], + ['polygon', 'Polygon Network', 'https://aragon.polygon.1hive.org/'], ['main', 'Ethereum Mainnet', 'https://client.aragon.org/'], [ 'rinkeby', From c1f75d413f65871a56f1b4d58107508044396f43 Mon Sep 17 00:00:00 2001 From: Gabi Date: Mon, 31 May 2021 16:06:23 -0300 Subject: [PATCH 05/13] Update App.js --- src/App.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.js b/src/App.js index 6fcb9eaa1..2021ed495 100644 --- a/src/App.js +++ b/src/App.js @@ -48,7 +48,7 @@ const INITIAL_DAO_STATE = { const SELECTOR_NETWORKS = [ ['xdai', 'xDai Network', 'https://aragon.1hive.org/'], - ['polygon', 'Polygon Network', 'https://aragon.polygon.1hive.org/'], + ['polygon', 'Polygon Network', 'https://aragon.1hive.org/'], ['main', 'Ethereum Mainnet', 'https://client.aragon.org/'], [ 'rinkeby', From 3a789de4b416b78478c829dcf6bfe4d086412876 Mon Sep 17 00:00:00 2001 From: fabriziovigevani Date: Tue, 1 Jun 2021 12:24:32 -0300 Subject: [PATCH 06/13] Network change: Save in local settings --- src/local-settings.js | 4 ++++ src/onboarding/Welcome/Welcome.js | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/local-settings.js b/src/local-settings.js index b3883b492..8639b1b21 100644 --- a/src/local-settings.js +++ b/src/local-settings.js @@ -118,6 +118,10 @@ export function getEthNetworkType() { return getLocalSetting(ETH_NETWORK_TYPE) || 'rinkeby' } +export function setEthNetworkType(networkType) { + return setLocalSetting(ETH_NETWORK_TYPE, networkType) +} + export function getEthSubscriptionEventDelay() { const delay = parseInt(getLocalSetting(ETH_SUBSCRIPTION_EVENT_DELAY), 10) return Number.isFinite(delay) ? delay : 0 diff --git a/src/onboarding/Welcome/Welcome.js b/src/onboarding/Welcome/Welcome.js index 18f91f289..b6bb1d7da 100644 --- a/src/onboarding/Welcome/Welcome.js +++ b/src/onboarding/Welcome/Welcome.js @@ -7,6 +7,7 @@ import Header from '../Header/Header' import OpenOrg from './OpenOrg' import Suggestions from './Suggestions' import WelcomeAction from './WelcomeAction' +import { setEthNetworkType } from '../../local-settings' import actionCreate from './assets/action-create.png' import actionOpen from './assets/action-open.png' @@ -34,6 +35,7 @@ const Welcome = React.memo(function Welcome({ const changeNetwork = useCallback( index => { + setEthNetworkType(selectorNetworksSorted[index].type) window.location = selectorNetworksSorted[index].url }, [selectorNetworksSorted] From f6827666f0c02d2e4ea760fa6ecfac39aff67304 Mon Sep 17 00:00:00 2001 From: fabriziovigevani Date: Tue, 1 Jun 2021 12:26:40 -0300 Subject: [PATCH 07/13] Network config: Set xdai and polygon correct network type --- src/network-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network-config.js b/src/network-config.js index 48796b1d3..5dc3b75ce 100644 --- a/src/network-config.js +++ b/src/network-config.js @@ -105,7 +105,7 @@ export const networkConfigs = { chainId: 100, name: 'xDai', shortName: 'xdai', - type: 'private', + type: 'xdai', live: true, }, providers: [ @@ -126,7 +126,7 @@ export const networkConfigs = { chainId: 137, name: 'Polygon', shortName: 'polygon', - type: 'private', + type: 'polygon', live: true, }, providers: [ From b26f8053feb6c4770e9de4ef851ba70cff82e604 Mon Sep 17 00:00:00 2001 From: fabriziovigevani Date: Tue, 1 Jun 2021 12:27:54 -0300 Subject: [PATCH 08/13] Fix lint --- src/App.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/App.js b/src/App.js index 2021ed495..f83954c9b 100644 --- a/src/App.js +++ b/src/App.js @@ -45,7 +45,6 @@ const INITIAL_DAO_STATE = { repos: [], } - const SELECTOR_NETWORKS = [ ['xdai', 'xDai Network', 'https://aragon.1hive.org/'], ['polygon', 'Polygon Network', 'https://aragon.1hive.org/'], From 65872e62e7f4a0056e2f928544de4e76d568bdca Mon Sep 17 00:00:00 2001 From: Fabro Date: Wed, 2 Jun 2021 20:28:11 -0300 Subject: [PATCH 09/13] App: Add chainId to selector networks --- src/App.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/App.js b/src/App.js index f83954c9b..0fca6e42e 100644 --- a/src/App.js +++ b/src/App.js @@ -46,10 +46,11 @@ const INITIAL_DAO_STATE = { } const SELECTOR_NETWORKS = [ - ['xdai', 'xDai Network', 'https://aragon.1hive.org/'], - ['polygon', 'Polygon Network', 'https://aragon.1hive.org/'], - ['main', 'Ethereum Mainnet', 'https://client.aragon.org/'], + [100, 'xdai', 'xDai Network', 'https://aragon.1hive.org/'], + [137, 'polygon', 'Polygon Network', 'https://aragon.1hive.org/'], + [1, 'main', 'Ethereum Mainnet', 'https://client.aragon.org/'], [ + 4, 'rinkeby', 'Ethereum Testnet (Rinkeby)', 'https://rinkeby.client.aragon.org/', From 0ecc931e4929bcbc2a82bd57c1e4ebcafd5888e1 Mon Sep 17 00:00:00 2001 From: Fabro Date: Wed, 2 Jun 2021 20:28:36 -0300 Subject: [PATCH 10/13] Networks: Rollback network type change --- src/network-config.js | 4 ++-- src/onboarding/Welcome/Welcome.js | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network-config.js b/src/network-config.js index 5dc3b75ce..48796b1d3 100644 --- a/src/network-config.js +++ b/src/network-config.js @@ -105,7 +105,7 @@ export const networkConfigs = { chainId: 100, name: 'xDai', shortName: 'xdai', - type: 'xdai', + type: 'private', live: true, }, providers: [ @@ -126,7 +126,7 @@ export const networkConfigs = { chainId: 137, name: 'Polygon', shortName: 'polygon', - type: 'polygon', + type: 'private', live: true, }, providers: [ diff --git a/src/onboarding/Welcome/Welcome.js b/src/onboarding/Welcome/Welcome.js index b6bb1d7da..c4c37e36b 100644 --- a/src/onboarding/Welcome/Welcome.js +++ b/src/onboarding/Welcome/Welcome.js @@ -25,10 +25,10 @@ const Welcome = React.memo(function Welcome({ const selectorNetworksSorted = useMemo(() => { return selectorNetworks - .map(([type, name, url]) => ({ type, name, url })) + .map(([chainId, type, name, url]) => ({ chainId, type, name, url })) .sort((a, b) => { - if (b.type === network.type) return 1 - if (a.type === network.type) return -1 + if (b.chainId === network.chainId) return 1 + if (a.chainId === network.chainId) return -1 return 0 }) }, [selectorNetworks]) From b17636e96319f158dbc2dda42a009f8c5033239b Mon Sep 17 00:00:00 2001 From: fabriziovigevani Date: Fri, 25 Jun 2021 11:44:45 -0300 Subject: [PATCH 11/13] Network change: Update defualtEth node --- src/onboarding/Welcome/Welcome.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/onboarding/Welcome/Welcome.js b/src/onboarding/Welcome/Welcome.js index c4c37e36b..6c06235b9 100644 --- a/src/onboarding/Welcome/Welcome.js +++ b/src/onboarding/Welcome/Welcome.js @@ -7,10 +7,11 @@ import Header from '../Header/Header' import OpenOrg from './OpenOrg' import Suggestions from './Suggestions' import WelcomeAction from './WelcomeAction' -import { setEthNetworkType } from '../../local-settings' +import { setDefaultEthNode, setEthNetworkType } from '../../local-settings' import actionCreate from './assets/action-create.png' import actionOpen from './assets/action-open.png' +import { getNetworkConfig } from '../../network-config' const Welcome = React.memo(function Welcome({ createError, @@ -35,7 +36,11 @@ const Welcome = React.memo(function Welcome({ const changeNetwork = useCallback( index => { - setEthNetworkType(selectorNetworksSorted[index].type) + const networkType = selectorNetworksSorted[index].type + const networkConfig = getNetworkConfig(networkType) + + setEthNetworkType(networkType) + setDefaultEthNode(networkConfig.nodes.defaultEth) window.location = selectorNetworksSorted[index].url }, [selectorNetworksSorted] From 2eb40da1e21f144299849414b8389c9de98e3b17 Mon Sep 17 00:00:00 2001 From: Gabi Date: Tue, 9 Aug 2022 11:07:03 -0300 Subject: [PATCH 12/13] fix: update ws urls --- src/network-config.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/network-config.js b/src/network-config.js index 48796b1d3..0ec0508ec 100644 --- a/src/network-config.js +++ b/src/network-config.js @@ -99,7 +99,7 @@ export const networkConfigs = { localEnsRegistryAddress || '0xaafca6b0c89521752e559650206d7c925fd0e530', }, nodes: { - defaultEth: 'wss://xdai.1hive.org', + defaultEth: 'wss://rpc.gnosischain.com/wss', }, settings: { chainId: 100, @@ -120,7 +120,7 @@ export const networkConfigs = { localEnsRegistryAddress || '0x4E065c622d584Fbe5D9078C3081840155FA69581', }, nodes: { - defaultEth: 'wss://ws-matic-mainnet.chainstacklabs.com', + defaultEth: 'wss://rpc-mainnet.matic.network', }, settings: { chainId: 137, From 4e3a237765f43ec9da9db4f9aa2ccdd3851c5547 Mon Sep 17 00:00:00 2001 From: Gabi Date: Tue, 9 Aug 2022 11:10:01 -0300 Subject: [PATCH 13/13] fix: remove now.json --- now.json | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 now.json diff --git a/now.json b/now.json deleted file mode 100644 index 4c1007792..000000000 --- a/now.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": 2, - "public": true, - "scope": "aragon", - "github": { - "silent": true - }, - "build": { - "env": { - "ARAGON_FORTMATIC_API_KEY": "@aragon-client-fortmatic-testnet-api-key", - "ARAGON_PORTIS_DAPP_ID": "@aragon-client-portis-dapp-id", - "ARAGON_SENTRY_DSN": "@aragon-client-sentry-dsn", - "ARAGON_ETH_SUBSCRIPTION_EVENT_DELAY": "3000" - } - } -}