Skip to content

Commit 65f70b7

Browse files
authored
feat: add support for optimism chain (#1816)
* feat: add support for optimism chain * feat: add op sepolia testnet * chore: fix OP chain config * chore: update use-wallet * refactor: remove deprecated ropsten network
1 parent 95706d3 commit 65f70b7

File tree

5 files changed

+804
-35
lines changed

5 files changed

+804
-35
lines changed

package.json

+2-7
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
"scrypt": "github:barrysteyn/node-scrypt#fb60a8d3c158fe115a624b5ffa7480f3a24b03fb",
6969
"secp256k1": "^4.0.2",
7070
"styled-components": ">=4.0.0",
71-
"use-wallet": "^0.13.6",
71+
"use-wallet": "^0.15.0",
7272
"web3": "^1.5.2",
7373
"web3-eth-abi": "^1.5.2",
7474
"web3-utils": "^1.5.2"
@@ -116,14 +116,12 @@
116116
"start:mainnet": "cross-env ARAGON_ETH_NETWORK_TYPE=main npm start",
117117
"start:goerli": "npm start",
118118
"start:staging": "cross-env ARAGON_ENS_REGISTRY_ADDRESS=0xfe03625ea880a8cba336f9b5ad6e15b0a3b5a939 npm start",
119-
"start:ropsten": "cross-env ARAGON_ETH_NETWORK_TYPE=ropsten npm start",
120119
"start:xdai": "cross-env ARAGON_ETH_NETWORK_TYPE=xdai npm start",
121120
"build": "node scripts/build",
122121
"build:local": "node scripts/build-local",
123122
"build:mainnet": "cross-env ARAGON_ETH_NETWORK_TYPE=main npm run build",
124123
"build:goerli": "npm run build",
125124
"build:staging": "cross-env ARAGON_ENS_REGISTRY_ADDRESS=0xfe03625ea880a8cba336f9b5ad6e15b0a3b5a939 npm run build",
126-
"build:ropsten": "cross-env ARAGON_ETH_NETWORK_TYPE=ropsten npm run build",
127125
"build:xdai": "cross-env ARAGON_ETH_NETWORK_TYPE=xdai npm run build",
128126
"lint": "eslint ./src",
129127
"test": "npm run lint && npm run jest",
@@ -139,10 +137,7 @@
139137
"publish:goerli:patch": "npm run publish:patch -- --environment goerli --build-script build:goerli",
140138
"publish:staging:major": "npm run publish:major -- --environment staging --build-script build:staging",
141139
"publish:staging:minor": "npm run publish:minor -- --environment staging --build-script build:staging",
142-
"publish:staging:patch": "npm run publish:patch -- --environment staging --build-script build:staging",
143-
"publish:ropsten:major": "npm run publish:major -- --environment ropsten --build-script build:ropsten",
144-
"publish:ropsten:minor": "npm run publish:minor -- --environment ropsten --build-script build:ropsten",
145-
"publish:ropsten:patch": "npm run publish:patch -- --environment ropsten --build-script build:ropsten"
140+
"publish:staging:patch": "npm run publish:patch -- --environment staging --build-script build:staging"
146141
},
147142
"browserslist": {
148143
"development": ">2%, last 1 edge versions, not ie > 0, not op_mini all",

src/ethereum-providers/connectors.js

+14-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,20 @@ export const connectors = [
77
{
88
id: 'injected',
99
properties: {
10-
chainId: [1, 5, 137, 80001, 1666600000, 1666700000, 97, 56, 588, 1088], // add here to handle more injected chains
10+
chainId: [
11+
1,
12+
5,
13+
10,
14+
11155420,
15+
137,
16+
80001,
17+
1666600000,
18+
1666700000,
19+
97,
20+
56,
21+
588,
22+
1088,
23+
], // add here to handle more injected chains
1124
},
1225
},
1326
{

src/network-config.js

+36-16
Original file line numberDiff line numberDiff line change
@@ -29,40 +29,60 @@ export const networkConfigs = {
2929
live: true,
3030
},
3131
},
32-
[chains.getChainInformation(3).type]: {
33-
isActive: false,
32+
[chains.getChainInformation(5).type]: {
33+
isActive: true,
34+
addresses: {
35+
ensRegistry:
36+
localEnsRegistryAddress || '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
37+
dai: DAI_GOERLI_TOKEN_ADDRESS,
38+
governExecutorProxy: '0x0451533f685fe028c439821b7502e4cf63b4c32f',
39+
},
40+
nodes: {
41+
defaultEth: 'wss://goerli.eth.aragon.network/ws',
42+
},
43+
connectGraphEndpoint:
44+
'https://api.thegraph.com/subgraphs/name/aragon/aragon-goerli',
45+
settings: {
46+
chainId: 5,
47+
testnet: true,
48+
...chains.getChainInformation(5), // as returned by web3.eth.net.getNetworkType()
49+
live: true,
50+
},
51+
},
52+
[chains.getChainInformation(10).type]: {
53+
isActive: true,
3454
addresses: {
3555
ensRegistry:
36-
localEnsRegistryAddress || '0x6afe2cacee211ea9179992f89dc61ff25c61e923',
56+
localEnsRegistryAddress || '0x6f2CA655f58d5fb94A08460aC19A552EB19909FD',
57+
dai: '0xda10009cbd5d07dd0cecc66161fc93d7c9000da1',
3758
governExecutorProxy: null,
3859
},
3960
nodes: {
40-
defaultEth: 'wss://ropsten.eth.aragon.network/ws',
61+
defaultEth: 'wss://optimism.publicnode.com/',
4162
},
4263
connectGraphEndpoint: null,
4364
settings: {
44-
chainId: 3,
45-
testnet: true,
46-
...chains.getChainInformation(3),
65+
chainId: 10,
66+
testnet: false,
67+
...chains.getChainInformation(10),
68+
live: true,
4769
},
4870
},
49-
[chains.getChainInformation(5).type]: {
71+
[chains.getChainInformation(11155420).type]: {
5072
isActive: true,
5173
addresses: {
5274
ensRegistry:
53-
localEnsRegistryAddress || '0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e',
54-
dai: DAI_GOERLI_TOKEN_ADDRESS,
55-
governExecutorProxy: '0x0451533f685fe028c439821b7502e4cf63b4c32f',
75+
localEnsRegistryAddress || '0xcb6c0101047dbbf242747c6f2e5a0a88f292dad4',
76+
governExecutorProxy: null,
5677
},
5778
nodes: {
58-
defaultEth: 'wss://goerli.eth.aragon.network/ws',
79+
defaultEth: 'https://sepolia.optimism.io/',
5980
},
60-
connectGraphEndpoint:
61-
'https://api.thegraph.com/subgraphs/name/aragon/aragon-goerli',
81+
connectGraphEndpoint: null,
6282
settings: {
63-
chainId: 5,
83+
chainId: 11155420,
6484
testnet: true,
65-
...chains.getChainInformation(5), // as returned by web3.eth.net.getNetworkType()
85+
...chains.getChainInformation(11155420),
6686
live: true,
6787
},
6888
},

src/templates/dandelion/config/helpers/getBlockTime.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
// Estimates based on block propagation rates in Feb. 2020
22
const NETWORK_TIMES = new Map([
33
['main', 13],
4-
['kovan', 4],
5-
['ropsten', 11],
64
['goerli', 15],
75
['private', 2],
6+
['optimism', 2],
7+
['op-sepolia', 2],
88
['matic', 2],
99
['mumbai', 2],
1010
['harmonyTest', 2],

0 commit comments

Comments
 (0)