on master help sign in
devex: switch Ropsten --> Goerli

TODO: update delegatedSending, linearSR, and conditionalSR in `contracts.js`

commitb660379f5e4af5645571672651c2acb40e538121 authortomholford <tomholford@users.noreply.github.com> dateTue 25 Oct 2022, 20:27 (4 years ago) parent6bf0691
16 files changed+40−41
.env.development+1−1 .github/ISSUE_TEMPLATE/l2-bug-report.md+1−1 DEVELOPMENT.md+3−3 package.json+3−3 src/Bridge.tsx+3−3 src/lib/constants.ts+1−1 src/lib/contracts.js+5−5 src/lib/explorer.js+2−2 src/lib/flags.js+2−2 src/lib/getSuggestedGasPrice.js+1−1 src/lib/inviteMail.js+2−2 src/lib/network.js+5−5 src/lib/tank.js+2−2 src/lib/txn.ts+1−2 src/lib/useRollerOptions.ts+5−5 src/store/network.jsx+3−3
.env.development+1−1
@@ -1,5 +1,5 @@
11VITE_DEV_MNEMONIC='benefit crew supreme gesture quantum web media hazard theory mercy wing kitten'
22VITE_DEV_GALAXY_TICKET='~wacfus-dabpex-danted-mosfep-pasrud-lavmer-nodtex-taslus-pactyp-milpub-pildeg-fornev-ralmed-dinfeb-fopbyr-sanbet-sovmyl-dozsut-mogsyx-mapwyc-sorrup-ricnec-marnys-lignex'
3−VITE_ROPSTEN_KEY='b7d2af9f01534031ba773374f766ef65'
3+VITE_GOERLI_KEY='b7d2af9f01534031ba773374f766ef65'
44VITE_HD_PATH="m/44'/60'/0'/0/0"
55VITE_STUB_LOCAL='false'
.github/ISSUE_TEMPLATE/l2-bug-report.md+1−1
@@ -23,7 +23,7 @@ A clear and concise description of what you expected to happen.
2323If applicable, add screenshots to help explain your problem. If possible, please also copy and paste any errors that appear in your browser's dev console. Here are [Chrome's docs](https://developers.google.com/web/tools/chrome-devtools/open) for using this feature.
2424
2525**Ethereum network:**
26−Were you testing on Ropsten or mainnet?
26+Were you testing on Goerli or mainnet?
2727
2828**Desktop (please complete the following information):**
2929 - OS: [e.g. MacOS 10.15.3]
DEVELOPMENT.md+3−3
@@ -119,9 +119,9 @@ Automated tests for critical user journeys are coming Soon™️. Until then, he
119119
120120"As a user, I can create a new invite"
121121
122−First, in `Bridge.js`, set the `INITIAL_NETWORK_TYPE` to Ropsten:
122+First, in `Bridge.js`, set the `INITIAL_NETWORK_TYPE` to Goerli:
123123```js
124−const INITIAL_NETWORK_TYPE = NETWORK_TYPES.ROPSTEN;
124+const INITIAL_NETWORK_TYPE = NETWORK_TYPES.GOERLI;
125125```
126126
127127Then, in `tank.js`, set the port to `3011`:
@@ -142,7 +142,7 @@ const baseUrl = 'https://gas-tank.urbit.org:3011';
1421423. Download the Passport file, then use the enclosed Master Ticket and ID to login to Bridge again
143143### Known Issues
144144
145−When testing the invite acceptance and login flow on Ropsten, some of the Azimuth API calls will fail (e.g., `getConditional`).
145+When testing the invite acceptance and login flow on Goerli, some of the Azimuth API calls will fail (e.g., `getConditional`).
146146
147147## Releases
148148
package.json+3−3
@@ -123,12 +123,12 @@
123123 "preview:mainnet": "VITE_MAINNET=true vite preview --port 3000",
124124 "start": "vite",
125125 "build": "VITE_MAINNET=true vite build",
126− "build:ropsten": "VITE_ROPSTEN=true vite build",
126+ "build:goerli": "VITE_GOERLI=true vite build",
127127 "test": "echo 'TODO: set up vitest'",
128128 "checksum": "cd build && find . -exec shasum -a256 {} ';' > ../checksums.txt && cd ..",
129129 "zip": "BRIDGE_VERSION=${VITE_BRIDGE_VERSION:-$npm_package_version}; zip -ur bridge-$BRIDGE_VERSION.zip README.md bridge-https.py checksums.txt && cd build && zip -ur ../bridge-$BRIDGE_VERSION.zip ./* && cd ..",
130130 "release": "npm install && npm run build && npm run checksum && npm run zip",
131− "release:ropsten": "export VITE_BRIDGE_VERSION=$npm_package_version\"r\"; npm install && npm run build:ropsten && npm run checksum && npm run zip",
131+ "release:goerli": "export VITE_BRIDGE_VERSION=$npm_package_version\"r\"; npm install && npm run build:goerli && npm run checksum && npm run zip",
132132 "pilot:ganache": "ganache-cli --blockTime 1 --networkId 5 --host '0.0.0.0' -m 'benefit crew supreme gesture quantum web media hazard theory mercy wing kitten' > /dev/null &",
133133 "pilot:setup": "npm run pilot:ganache && truffle deploy",
134134 "pilot": "HTTPS=true npm-run-all pilot:setup start pilot:cleanup --continue-on-error",
@@ -138,7 +138,7 @@
138138 "pilot-residents": "WITH_TEST_STATE=RESIDENTS npm run pilot",
139139 "pilot-l2": "BROWSER=NONE WITH_TEST_STATE=L2 HTTPS=false NODE_ENV=development npm-run-all pilot:setup start pilot:cleanup --continue-on-error",
140140 "pilot-l2-local": "BROWSER=NONE VITE_L2=true HTTPS=false NODE_ENV=development npm run start --continue-on-error",
141− "pilot-ropsten": "VITE_ROPSTEN=true HTTPS=true npm-run-all start --continue-on-error",
141+ "pilot-goerli": "VITE_GOERLI=true HTTPS=true npm-run-all start --continue-on-error",
142142 "pilot:cleanup": "pkill -f ganache-cli",
143143 "lint:check": "eslint 'src/**/*.{js,jsx,ts,tsx}'",
144144 "lint:fix": "eslint --fix 'src/**/*.{js,jsx,ts,tsx}'",
src/Bridge.tsx+3−3
@@ -10,7 +10,7 @@ import { ROUTE_NAMES } from 'lib/routeNames';
1010import { ROUTES } from 'lib/router';
1111import { NETWORK_TYPES } from 'lib/network';
1212import { walletFromMnemonic } from 'lib/wallet';
13−import { isDevelopment, isMainnet, isRopsten } from 'lib/flags';
13+import { isDevelopment, isMainnet, isGoerli } from 'lib/flags';
1414import useImpliedTicket from 'lib/useImpliedTicket';
1515import useHasDisclaimed from 'lib/useHasDisclaimed';
1616
@@ -26,8 +26,8 @@ import { Box } from '@tlon/indigo-react';
2626import LoadingOverlay from 'components/L2/LoadingOverlay';
2727import { useRollerPoller } from 'lib/useRollerPoller';
2828
29−const INITIAL_NETWORK_TYPE = isRopsten
30− ? NETWORK_TYPES.ROPSTEN
29+const INITIAL_NETWORK_TYPE = isGoerli
30+ ? NETWORK_TYPES.GOERLI
3131 : isDevelopment && !isMainnet
3232 ? NETWORK_TYPES.LOCAL
3333 : NETWORK_TYPES.MAINNET;
src/lib/constants.ts+1−1
@@ -102,7 +102,7 @@ const NONCUSTODIAL_WALLETS = new Set([
102102
103103const ROLLER_HOSTS = {
104104 LOCAL: 'localhost',
105− ROPSTEN: 'roller-tmp.urbit.org',
105+ GOERLI: 'roller-tmp.urbit.org',
106106 MAINNET: 'roller.urbit.org',
107107};
108108
src/lib/contracts.js+5−5
@@ -5,11 +5,11 @@ const CONTRACT_ADDRESSES = {
55 linearSR: '0x03C3dC12BE658158D1d7F9e66E08ec4099c568e4',
66 conditionalSR: '0x35EB3B102d9C1B69Ac1469C1B1FE1799850CD3EB',
77 },
8− ROPSTEN: {
9− azimuth: '0x308ab6a6024cf198b57e008d0ac9ad0219886579',
10− delegatedSending: '0x3e8ca510354bc2fdbbd6150252d93105c9c27bbe',
11− linearSR: '0x1f8edd031ee414740aedb39b84fb8f2f66ca422f',
12− conditionalSR: '0x1f8edd031ee414740aedb39b84fb8f2f66ca422f',
8+ GOERLI: {
9+ azimuth: '0xbB61Fa683E4B910418E27b00a1438a936234df52',
10+ delegatedSending: '0x3e8ca510354bc2fdbbd6150252d93105c9c27bbe', // TODO
11+ linearSR: '0x1f8edd031ee414740aedb39b84fb8f2f66ca422f', // TODO
12+ conditionalSR: '0x1f8edd031ee414740aedb39b84fb8f2f66ca422f', // TODO
1313 },
1414 MAINNET: {
1515 azimuth: '0x223c067f8cf28ae173ee5cafea60ca44c335fecb',
src/lib/explorer.js+2−2
@@ -5,8 +5,8 @@ function useEtherscanDomain() {
55 const { networkType } = useNetwork();
66
77 switch (networkType) {
8− case NETWORK_TYPES.ROPSTEN:
9− return 'https://ropsten.etherscan.io';
8+ case NETWORK_TYPES.GOERLI:
9+ return 'https://goerli.etherscan.io';
1010 case NETWORK_TYPES.OFFLINE:
1111 case NETWORK_TYPES.MAINNET:
1212 case NETWORK_TYPES.LOCAL:
src/lib/flags.js+2−2
@@ -2,10 +2,10 @@ import { version } from '../../package.json';
22
33// are we running bridge in a development build
44export const isDevelopment = import.meta.env.DEV === 'development';
5−export const isRopsten = import.meta.env.VITE_ROPSTEN === 'true';
5+export const isGoerli = import.meta.env.VITE_GOERLI === 'true';
66export const isMainnet = import.meta.env.VITE_MAINNET === 'true';
77export const versionLabel =
8− import.meta.env.VITE_BRIDGE_VERSION || `${version}${isRopsten ? 'r' : ''}`;
8+ import.meta.env.VITE_BRIDGE_VERSION || `${version}${isGoerli ? 'g' : ''}`;
99export const providedRollerOptions = {
1010 host: import.meta.env.VITE_ROLLER_HOST,
1111 port: import.meta.env.VITE_ROLLER_PORT,
src/lib/getSuggestedGasPrice.js+1−1
@@ -40,7 +40,7 @@ export const defaultGasValues = value => ({
4040
4141export default async function getSuggestedGasPrice(networkType) {
4242 switch (networkType) {
43− case NETWORK_TYPES.ROPSTEN:
43+ case NETWORK_TYPES.GOERLI:
4444 return defaultGasValues(10);
4545 case NETWORK_TYPES.OFFLINE:
4646 return defaultGasValues(DEFAULT_GAS_PRICE_GWEI);
src/lib/inviteMail.js+2−2
@@ -2,9 +2,9 @@
22// did not succeed", you might need to visit localhost:3001 or whatever
33// explicitly and tell your browser that's safe to access.
44// https://stackoverflow.com/a/53011185/1334324
5−import { isRopsten } from './flags';
5+import { isGoerli } from './flags';
66
7−const port = isRopsten ? '3012' : '3002';
7+const port = isGoerli ? '3012' : '3002';
88const baseUrl = `https://onboarding-emails.urbit.org:${port}`;
99
1010function sendRequest(where, what) {
src/lib/network.js+5−5
@@ -1,15 +1,15 @@
11const NETWORK_TYPES = {
22 OFFLINE: Symbol('OFFLINE'),
33 LOCAL: Symbol('LOCAL'),
4− ROPSTEN: Symbol('ROPSTEN'),
4+ GOERLI: Symbol('GOERLI'),
55 MAINNET: Symbol('MAINNET'),
66};
77
88const renderNetworkType = network =>
99 network === NETWORK_TYPES.OFFLINE
1010 ? 'Offline'
11− : network === NETWORK_TYPES.ROPSTEN
12− ? 'Ropsten'
11+ : network === NETWORK_TYPES.GOERLI
12+ ? 'Goerli'
1313 : network === NETWORK_TYPES.MAINNET
1414 ? 'Main Network'
1515 : network === NETWORK_TYPES.LOCAL
@@ -20,8 +20,8 @@ const chainIdToNetworkType = chainId => {
2020 switch (chainId) {
2121 case '0x1':
2222 return NETWORK_TYPES.MAINNET;
23− case '0x3':
24− return NETWORK_TYPES.ROPSTEN;
23+ case '0x5':
24+ return NETWORK_TYPES.GOERLI;
2525 default:
2626 return NETWORK_TYPES.LOCAL;
2727 }
src/lib/tank.js+2−2
@@ -3,7 +3,7 @@
33import retry from 'async-retry';
44import { toBN } from 'web3-utils';
55import { RETRY_OPTIONS, waitForTransactionConfirm } from './txn';
6−import { isRopsten } from './flags';
6+import { isGoerli } from './flags';
77
88const TANK_ADDRESS = '0x40f0A6db85f8D7A54fF3eA915b040dE8Cd4A0Eb5';
99
@@ -11,7 +11,7 @@ const TANK_ADDRESS = '0x40f0A6db85f8D7A54fF3eA915b040dE8Cd4A0Eb5';
1111// did not succeed", you might need to visit localhost:3001 or whatever
1212// explicitly and tell your browser that's safe to access.
1313// https://stackoverflow.com/a/53011185/1334324
14−const port = isRopsten ? '3011' : '3001';
14+const port = isGoerli ? '3011' : '3001';
1515const baseUrl = `https://gas-tank.urbit.org:${port}`;
1616
1717function sendRequest(where, what) {
src/lib/txn.ts+1−2
@@ -99,9 +99,8 @@ const signTransaction = async ({
9999 type: toHex(EIP1559_TRANSACTION_TYPE),
100100 }
101101
102− // TODO: Ropsten will sunset Q4 2022, need to replace w/ support for Goerli
103102 const chain =
104− networkType === NETWORK_TYPES.ROPSTEN ? Chain.Ropsten : Chain.Mainnet;
103+ networkType === NETWORK_TYPES.GOERLI ? Chain.Goerli : Chain.Mainnet;
105104
106105 const txConfig: TxOptions = {
107106 freeze: false,
src/lib/useRollerOptions.ts+5−5
@@ -2,7 +2,7 @@ import { Options } from '@urbit/roller-api';
22import { useMemo } from 'react';
33import { ROLLER_HOSTS, ROLLER_PATH } from './constants';
44import { convertToInt } from './convertToInt';
5−import { isMainnet, isRopsten, providedRollerOptions } from './flags';
5+import { isMainnet, isGoerli, providedRollerOptions } from './flags';
66
77type TransportType =
88 | 'websocket'
@@ -30,17 +30,17 @@ export const useRollerOptions = () => {
3030 const options: Options = useMemo(() => {
3131 const type =
3232 (providedType as TransportType | undefined) ||
33− (isMainnet || isRopsten ? 'https' : 'http');
33+ (isMainnet || isGoerli ? 'https' : 'http');
3434 const host =
3535 providedHost ||
3636 (isMainnet
3737 ? ROLLER_HOSTS.MAINNET
38− : isRopsten
39− ? ROLLER_HOSTS.ROPSTEN
38+ : isGoerli
39+ ? ROLLER_HOSTS.GOERLI
4040 : ROLLER_HOSTS.LOCAL);
4141 const port =
4242 (providedPort && convertToInt(providedPort, 10)) ||
43− (isMainnet || isRopsten ? 443 : 8080);
43+ (isMainnet || isGoerli ? 443 : 8080);
4444 const path = ROLLER_PATH;
4545
4646 return {
src/store/network.jsx+3−3
@@ -84,12 +84,12 @@ function _useNetwork(initialNetworkType = null) {
8484 );
8585 return;
8686 }
87− case NETWORK_TYPES.ROPSTEN: {
88− const endpoint = `https://ropsten.infura.io/v3/${import.meta.env.VITE_INFURA_ENDPOINT}`;
87+ case NETWORK_TYPES.GOERLI: {
88+ const endpoint = `https://goerli.infura.io/v3/${import.meta.env.VITE_INFURA_ENDPOINT}`;
8989
9090 initWeb3(
9191 new Web3.providers.HttpProvider(endpoint),
92− CONTRACT_ADDRESSES.ROPSTEN
92+ CONTRACT_ADDRESSES.GOERLI
9393 );
9494 return;
9595 }