Skip to content

Commit 6e94419

Browse files
Anyhowclickductm54
authored andcommitted
Sol5 -> Sol6 (KyberNetwork#905)
* Upgrade Katalyst from solidity 5 to solidity 6. Fix CI run. * Update enviorment: CI, coverage, buidler. Co-authored-by: Tran Minh Duc <[email protected]>
1 parent 7a3acac commit 6e94419

File tree

221 files changed

+2431
-2644
lines changed

Some content is hidden

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

221 files changed

+2431
-2644
lines changed

.solcover.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@ const fs = require('fs');
22
const path = require('path');
33
const mv = require('mv');
44

5-
const v4ArtifactsPath = path.join(__dirname, '.coverageV4Artifacts');
5+
const previousArtifactsPath = path.join(__dirname, '.coverageArtifacts');
66
const targetArtifactPath = path.join(__dirname, '.coverage_artifacts');
77

88
function moveFiles(config) {
9-
fs.readdir(v4ArtifactsPath, (err, files) => {
9+
fs.readdir(previousArtifactsPath, (err, files) => {
1010
if (err) console.log(err);
1111
files.forEach(file => {
12-
mv(path.join(v4ArtifactsPath, file), path.join(targetArtifactPath, file), err => {
12+
mv(path.join(previousArtifactsPath, file), path.join(targetArtifactPath, file), err => {
1313
if (err) throw err;
1414
console.log(`Moving ` + file);
1515
});
1616
})
1717
})
1818
}
1919

20-
function removeV4ArtifactsDir(config) {
21-
fs.rmdir(v4ArtifactsPath, err => {
20+
function removeArtifactsDir(config) {
21+
fs.rmdir(previousArtifactsPath, err => {
2222
if (err) console.log(err);
2323
})
2424
}
@@ -30,5 +30,5 @@ module.exports = {
3030
},
3131
istanbulReporter: ['html','json'],
3232
onCompileComplete: moveFiles,
33-
onIstanbulComplete: removeV4ArtifactsDir
33+
onIstanbulComplete: removeArtifactsDir
3434
}

.solhint.json

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
{
22
"extends": "solhint:default",
33
"rules": {
4-
"indent": ["error", 4],
54
"quotes": ["error", "double"],
65
"avoid-suicide": "error",
76
"avoid-sha3": "warn",
8-
"avoid-tx-origin:": "warn",
7+
"avoid-tx-origin": "warn",
98
"const-name-snakecase": "off",
109
"func-order": "warn",
1110
"not-rely-on-block-hash": "warn"
1211
}
1312
}
14-

.solhintignore

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
# zeppelin contracts
2-
contractsSol5/utils/zeppelin
3-
contractsSol5/bridges
2+
contracts/sol6/utils/zeppelin
3+
contracts/sol5/bridges
44

.travis.yml

+4-2
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ env:
1616
matrix:
1717
include:
1818
- env:
19-
- TEST_PART: Sol5
19+
- TEST_PART: Sol6
2020
- env:
2121
- TEST_PART: Coverage
2222

2323
install:
2424
- npm ci
2525

26+
before script:
27+
- npx solhint contracts/sol6/**/*.sol
28+
2629
script:
27-
- npx solhint contractsSol5/**/**.sol
2830
- ./cmp.sh
2931
- .travis/test-part.sh
3032

.travis/test-part.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ set -euxo pipefail
66
readonly test_part=${TEST_PART:-}
77

88
case "$test_part" in
9-
Sol5)
10-
npx buidler test --no-compile --config buidlerConfigSol5.js
9+
Sol6)
10+
npx buidler test --no-compile --config buidlerConfigSol6.js
1111
;;
1212
Coverage)
1313
if [[ $TRAVIS_EVENT_TYPE != "push" ]]; then

buidler.config.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ module.exports = {
139139
},
140140

141141
solc: {
142-
version: "0.5.11",
142+
version: "0.6.6",
143143
optimizer: require("./solcOptimiserSettings.js")
144144
},
145145

146146
paths: {
147-
sources: "./contractsSol5",
148-
tests: "./test",
147+
sources: "./contracts/sol6",
148+
tests: "./test/sol6",
149149
},
150150

151151
mocha: {

buidlerConfigSol4.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
module.exports = {
2-
defaultNetwork: "buidlerevm",
32
solc: {
43
version: "0.4.18",
54
optimizer: require("./solcOptimiserSettings.js")
65
},
76

87
paths: {
9-
sources: "./contracts"
8+
sources: "./contracts/sol4"
109
}
1110
};

buidlerConfigSol5.js

+1-145
Original file line numberDiff line numberDiff line change
@@ -1,155 +1,11 @@
1-
usePlugin("@nomiclabs/buidler-truffle5");
2-
usePlugin("@nomiclabs/buidler-web3");
3-
usePlugin("solidity-coverage");
4-
51
module.exports = {
6-
defaultNetwork: "buidlerevm",
7-
8-
networks: {
9-
develop: {
10-
url: "http://127.0.0.1:8545",
11-
gas: 6000000,
12-
timeout: 20000
13-
},
14-
buidlerevm: {
15-
accounts: [
16-
// 20 accounts with 10^14 ETH each
17-
// Addresses:
18-
// 0xc783df8a850f42e7f7e57013759c285caa701eb6
19-
// 0xead9c93b79ae7c1591b1fb5323bd777e86e150d4
20-
// 0xe5904695748fe4a84b40b3fc79de2277660bd1d3
21-
// 0x92561f28ec438ee9831d00d1d59fbdc981b762b2
22-
// 0x2ffd013aaa7b5a7da93336c2251075202b33fb2b
23-
// 0x9fc9c2dfba3b6cf204c37a5f690619772b926e39
24-
// 0xfbc51a9582d031f2ceaad3959256596c5d3a5468
25-
// 0x84fae3d3cba24a97817b2a18c2421d462dbbce9f
26-
// 0xfa3bdc8709226da0da13a4d904c8b66f16c3c8ba
27-
// 0x6c365935ca8710200c7595f0a72eb6023a7706cd
28-
// 0xd7de703d9bbc4602242d0f3149e5ffcd30eb3adf
29-
// 0x532792b73c0c6e7565912e7039c59986f7e1dd1f
30-
// 0xea960515f8b4c237730f028cbacf0a28e7f45de0
31-
// 0x3d91185a02774c70287f6c74dd26d13dfb58ff16
32-
// 0x5585738127d12542a8fd6c71c19d2e4cecdab08a
33-
// 0x0e0b5a3f244686cf9e7811754379b9114d42f78b
34-
// 0x704cf59b16fd50efd575342b46ce9c5e07076a4a
35-
// 0x0a057a7172d0466aef80976d7e8c80647dfd35e3
36-
// 0x68dfc526037e9030c8f813d014919cc89e7d4d74
37-
// 0x26c43a1d431a4e5ee86cd55ed7ef9edf3641e901
38-
{
39-
privateKey:
40-
"0xc5e8f61d1ab959b397eecc0a37a6517b8e67a0e7cf1f4bce5591f3ed80199122",
41-
balance: "100000000000000000000000000000000"
42-
},
43-
{
44-
privateKey:
45-
"0xd49743deccbccc5dc7baa8e69e5be03298da8688a15dd202e20f15d5e0e9a9fb",
46-
balance: "100000000000000000000000000000000"
47-
},
48-
{
49-
privateKey:
50-
"0x23c601ae397441f3ef6f1075dcb0031ff17fb079837beadaf3c84d96c6f3e569",
51-
balance: "100000000000000000000000000000000"
52-
},
53-
{
54-
privateKey:
55-
"0xee9d129c1997549ee09c0757af5939b2483d80ad649a0eda68e8b0357ad11131",
56-
balance: "100000000000000000000000000000000"
57-
},
58-
{
59-
privateKey:
60-
"0x87630b2d1de0fbd5044eb6891b3d9d98c34c8d310c852f98550ba774480e47cc",
61-
balance: "100000000000000000000000000000000"
62-
},
63-
{
64-
privateKey:
65-
"0x275cc4a2bfd4f612625204a20a2280ab53a6da2d14860c47a9f5affe58ad86d4",
66-
balance: "100000000000000000000000000000000"
67-
},
68-
{
69-
privateKey:
70-
"0x7f307c41137d1ed409f0a7b028f6c7596f12734b1d289b58099b99d60a96efff",
71-
balance: "100000000000000000000000000000000"
72-
},
73-
{
74-
privateKey:
75-
"0x2a8aede924268f84156a00761de73998dac7bf703408754b776ff3f873bcec60",
76-
balance: "100000000000000000000000000000000"
77-
},
78-
{
79-
privateKey:
80-
"0x8b24fd94f1ce869d81a34b95351e7f97b2cd88a891d5c00abc33d0ec9501902e",
81-
balance: "100000000000000000000000000000000"
82-
},
83-
{
84-
privateKey:
85-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b29085",
86-
balance: "100000000000000000000000000000000"
87-
},
88-
{
89-
privateKey:
90-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b29086",
91-
balance: "100000000000000000000000000000000"
92-
},
93-
{
94-
privateKey:
95-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b29087",
96-
balance: "100000000000000000000000000000000"
97-
},
98-
{
99-
privateKey:
100-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b29088",
101-
balance: "100000000000000000000000000000000"
102-
},
103-
{
104-
privateKey:
105-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b29089",
106-
balance: "100000000000000000000000000000000"
107-
},
108-
{
109-
privateKey:
110-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b2908a",
111-
balance: "100000000000000000000000000000000"
112-
},
113-
{
114-
privateKey:
115-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b2908b",
116-
balance: "100000000000000000000000000000000"
117-
},
118-
{
119-
privateKey:
120-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b2908c",
121-
balance: "100000000000000000000000000000000"
122-
},
123-
{
124-
privateKey:
125-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b2908d",
126-
balance: "100000000000000000000000000000000"
127-
},
128-
{
129-
privateKey:
130-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b2908e",
131-
balance: "100000000000000000000000000000000"
132-
},
133-
{
134-
privateKey:
135-
"0x28d1bfbbafe9d1d4f5a11c3c16ab6bf9084de48d99fbac4058bdfa3c80b2908f",
136-
balance: "100000000000000000000000000000000"
137-
}
138-
]
139-
}
140-
},
141-
1422
solc: {
1433
version: "0.5.11",
1444
optimizer: require("./solcOptimiserSettings.js")
1455
},
1466

1477
paths: {
148-
sources: "./contractsSol5",
8+
sources: "./contracts/sol5",
1499
tests: "./test/sol5"
150-
},
151-
152-
mocha: {
153-
enableTimeouts: false
15410
}
15511
};

0 commit comments

Comments
 (0)