Skip to content

Commit 4e41391

Browse files
web3-react migration (#269)
* put suspense below redux * don't mount qr * properly format .json's * remove useless Web3Connect component * remove react-responsive header logic * finalize initial web3-react migration * add rudimentary network support * address ci/cd issues * fix syntax * add infura support rewrite create-exchange closes #173 * remove CI flag, lazy loaded disabled for now * roll back /pool * fix currency input errors fix valid state of buttons * fix nav * obscure env variables * fix mobile header bug
1 parent f855706 commit 4e41391

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+1820
-1736
lines changed

.env.example

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
REACT_APP_NETWORK_ID="1"
2+
REACT_APP_NETWORK_URL=""
3+
REACT_APP_NETWORK_NAME="Main Ethereum Network"

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
# misc
1313
.DS_Store
14+
.env
1415
.env.local
1516
.env.development.local
1617
.env.test.local

README.md

+9-7
Original file line numberDiff line numberDiff line change
@@ -16,24 +16,26 @@ This an an open source interface for Uniswap - a protocol for decentralized exch
1616

1717
## To Start Development
1818

19-
###### Installing dependencies
19+
### Install Dependencies
2020

2121
```bash
2222
yarn
2323
```
2424

25-
###### Running locally on Rinkeby
25+
### Configure Environment
2626

27-
```bash
28-
yarn start:rinkeby
29-
```
27+
Rename `.env.example` to `.env` and fill in the appropriate variables.
3028

31-
###### Running locally on other testnet
29+
### Run
3230

3331
```bash
34-
REACT_APP_NETWORK_ID=2 REACT_APP_NETWORK='Ropsten Test Network' yarn start
32+
yarn start
33+
# or
34+
yarn start:rinkeby
3535
```
3636

37+
More robust support for other testnets is in the works!
38+
3739
## Contributions
3840

3941
**Please open all pull requests against the `beta` branch.** CI checks will run against all PRs. To ensure that your changes will pass, run `yarn check:all` before pushing. If this command fails, you can try to automatically fix problems with `yarn fix:all`, or do it manually.

netlify.toml

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# support SPA setup
12
[[redirects]]
23
from = "/*"
34
to = "/index.html"

package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
"react-ga": "^2.5.7",
2121
"react-i18next": "^10.7.0",
2222
"react-redux": "^5.0.7",
23-
"react-responsive": "^5.0.0",
2423
"react-router-dom": "^5.0.0",
2524
"react-scripts": "^2.1.8",
2625
"react-transition-group": "1.x",
@@ -29,13 +28,13 @@
2928
"redux-thunk": "^2.2.0",
3029
"ua-parser-js": "^0.7.18",
3130
"web3": "1.0.0-beta.52",
32-
"web3-react": "^4.0.0"
31+
"web3-react": "^5.0.4"
3332
},
3433
"scripts": {
3534
"start": "react-scripts start",
36-
"start:rinkeby": "REACT_APP_NETWORK_ID=4 REACT_APP_NETWORK='Rinkeby Test Network' yarn start",
3735
"build": "react-scripts build",
38-
"build:rinkeby": "REACT_APP_NETWORK_ID=4 REACT_APP_NETWORK='Rinkeby Test Network' yarn build",
36+
"start:rinkeby": "REACT_APP_NETWORK_ID=4 REACT_APP_NETWORK_NAME='Rinkeby Test Network' yarn start",
37+
"build:rinkeby": "REACT_APP_NETWORK_ID=4 REACT_APP_NETWORK_NAME='Rinkeby Test Network' yarn build",
3938
"test": "react-scripts test --env=jsdom",
4039
"eject": "react-scripts eject",
4140
"lint:base": "yarn eslint './src/**/*.{js,jsx}'",

public/locales/en.json

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"invalidDecimals": "Invalid decimals",
7171
"tokenAddress": "Token Address",
7272
"label": "Label",
73+
"symbol": "Symbol",
7374
"decimals": "Decimals",
7475
"enterTokenCont": "Enter a token address to continue"
7576
}

src/abi/erc20.json

+23-137
Original file line numberDiff line numberDiff line change
@@ -3,35 +3,16 @@
33
"constant": true,
44
"inputs": [],
55
"name": "name",
6-
"outputs": [
7-
{
8-
"name": "",
9-
"type": "string"
10-
}
11-
],
6+
"outputs": [{ "name": "", "type": "string" }],
127
"payable": false,
138
"stateMutability": "view",
149
"type": "function"
1510
},
1611
{
1712
"constant": false,
18-
"inputs": [
19-
{
20-
"name": "_spender",
21-
"type": "address"
22-
},
23-
{
24-
"name": "_value",
25-
"type": "uint256"
26-
}
27-
],
13+
"inputs": [{ "name": "_spender", "type": "address" }, { "name": "_value", "type": "uint256" }],
2814
"name": "approve",
29-
"outputs": [
30-
{
31-
"name": "",
32-
"type": "bool"
33-
}
34-
],
15+
"outputs": [{ "name": "", "type": "bool" }],
3516
"payable": false,
3617
"stateMutability": "nonpayable",
3718
"type": "function"
@@ -40,39 +21,20 @@
4021
"constant": true,
4122
"inputs": [],
4223
"name": "totalSupply",
43-
"outputs": [
44-
{
45-
"name": "",
46-
"type": "uint256"
47-
}
48-
],
24+
"outputs": [{ "name": "", "type": "uint256" }],
4925
"payable": false,
5026
"stateMutability": "view",
5127
"type": "function"
5228
},
5329
{
5430
"constant": false,
5531
"inputs": [
56-
{
57-
"name": "_from",
58-
"type": "address"
59-
},
60-
{
61-
"name": "_to",
62-
"type": "address"
63-
},
64-
{
65-
"name": "_value",
66-
"type": "uint256"
67-
}
32+
{ "name": "_from", "type": "address" },
33+
{ "name": "_to", "type": "address" },
34+
{ "name": "_value", "type": "uint256" }
6835
],
6936
"name": "transferFrom",
70-
"outputs": [
71-
{
72-
"name": "",
73-
"type": "bool"
74-
}
75-
],
37+
"outputs": [{ "name": "", "type": "bool" }],
7638
"payable": false,
7739
"stateMutability": "nonpayable",
7840
"type": "function"
@@ -81,31 +43,16 @@
8143
"constant": true,
8244
"inputs": [],
8345
"name": "decimals",
84-
"outputs": [
85-
{
86-
"name": "",
87-
"type": "uint8"
88-
}
89-
],
46+
"outputs": [{ "name": "", "type": "uint8" }],
9047
"payable": false,
9148
"stateMutability": "view",
9249
"type": "function"
9350
},
9451
{
9552
"constant": true,
96-
"inputs": [
97-
{
98-
"name": "_owner",
99-
"type": "address"
100-
}
101-
],
53+
"inputs": [{ "name": "_owner", "type": "address" }],
10254
"name": "balanceOf",
103-
"outputs": [
104-
{
105-
"name": "balance",
106-
"type": "uint256"
107-
}
108-
],
55+
"outputs": [{ "name": "balance", "type": "uint256" }],
10956
"payable": false,
11057
"stateMutability": "view",
11158
"type": "function"
@@ -114,107 +61,46 @@
11461
"constant": true,
11562
"inputs": [],
11663
"name": "symbol",
117-
"outputs": [
118-
{
119-
"name": "",
120-
"type": "string"
121-
}
122-
],
64+
"outputs": [{ "name": "", "type": "string" }],
12365
"payable": false,
12466
"stateMutability": "view",
12567
"type": "function"
12668
},
12769
{
12870
"constant": false,
129-
"inputs": [
130-
{
131-
"name": "_to",
132-
"type": "address"
133-
},
134-
{
135-
"name": "_value",
136-
"type": "uint256"
137-
}
138-
],
71+
"inputs": [{ "name": "_to", "type": "address" }, { "name": "_value", "type": "uint256" }],
13972
"name": "transfer",
140-
"outputs": [
141-
{
142-
"name": "",
143-
"type": "bool"
144-
}
145-
],
73+
"outputs": [{ "name": "", "type": "bool" }],
14674
"payable": false,
14775
"stateMutability": "nonpayable",
14876
"type": "function"
14977
},
15078
{
15179
"constant": true,
152-
"inputs": [
153-
{
154-
"name": "_owner",
155-
"type": "address"
156-
},
157-
{
158-
"name": "_spender",
159-
"type": "address"
160-
}
161-
],
80+
"inputs": [{ "name": "_owner", "type": "address" }, { "name": "_spender", "type": "address" }],
16281
"name": "allowance",
163-
"outputs": [
164-
{
165-
"name": "",
166-
"type": "uint256"
167-
}
168-
],
82+
"outputs": [{ "name": "", "type": "uint256" }],
16983
"payable": false,
17084
"stateMutability": "view",
17185
"type": "function"
17286
},
173-
{
174-
"payable": true,
175-
"stateMutability": "payable",
176-
"type": "fallback"
177-
},
87+
{ "payable": true, "stateMutability": "payable", "type": "fallback" },
17888
{
17989
"anonymous": false,
18090
"inputs": [
181-
{
182-
"indexed": true,
183-
"name": "owner",
184-
"type": "address"
185-
},
186-
{
187-
"indexed": true,
188-
"name": "spender",
189-
"type": "address"
190-
},
191-
{
192-
"indexed": false,
193-
"name": "value",
194-
"type": "uint256"
195-
}
91+
{ "indexed": true, "name": "owner", "type": "address" },
92+
{ "indexed": true, "name": "spender", "type": "address" },
93+
{ "indexed": false, "name": "value", "type": "uint256" }
19694
],
19795
"name": "Approval",
19896
"type": "event"
19997
},
20098
{
20199
"anonymous": false,
202100
"inputs": [
203-
{
204-
"indexed": true,
205-
"name": "from",
206-
"type": "address"
207-
},
208-
{
209-
"indexed": true,
210-
"name": "to",
211-
"type": "address"
212-
},
213-
{
214-
"indexed": false,
215-
"name": "value",
216-
"type": "uint256"
217-
}
101+
{ "indexed": true, "name": "from", "type": "address" },
102+
{ "indexed": true, "name": "to", "type": "address" },
103+
{ "indexed": false, "name": "value", "type": "uint256" }
218104
],
219105
"name": "Transfer",
220106
"type": "event"

0 commit comments

Comments
 (0)