Skip to content

Commit 41b7d91

Browse files
authored
Merge pull request JoinColony#1097 from JoinColony/develop
Merge GLWSS release in to master
2 parents f861050 + d7fb7bc commit 41b7d91

File tree

231 files changed

+53467
-28241
lines changed

Some content is hidden

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

231 files changed

+53467
-28241
lines changed

.circleci/config.yml

Lines changed: 50 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,37 @@ version: 2
22

33
job_common: &job_common
44
docker:
5-
- image: cimg/node:12.22.12
5+
- image: cimg/node:14.18.2
66
auth:
77
username: colonyci
88
password: $COLONYCI_DOCKERHUB_PASSWORD
99
working_directory: ~/colonyNetwork
10+
run:
1011
job_python: &job_python
1112
docker:
12-
- image: circleci/python:3.8.0b1-stretch-node
13+
- image: cimg/python:3.8.13-node
1314
auth:
1415
username: colonyci
1516
password: $COLONYCI_DOCKERHUB_PASSWORD
1617
working_directory: ~/colonyNetwork
1718
step_save_cache: &step_save_cache
1819
save_cache:
1920
paths:
20-
- ~/.cache/yarn
21-
key: node-modules-{{ checksum "yarn.lock" }}
21+
- ~/.npm
22+
key: node-modules-{{ checksum "package-lock.json" }}
2223
step_restore_cache: &step_restore_cache
2324
restore_cache:
2425
keys:
25-
- node-modules-{{ checksum "yarn.lock" }}
26+
- node-modules-{{ checksum "package-lock.json" }}
2627
step_setup_global_packages: &step_setup_global_packages
2728
run:
2829
name: "Set up global packages"
2930
command: |
30-
yarn --pure-lockfile --ignore-engines --network-concurrency 1
31+
npm set cache ~/.npm
32+
sudo npm install -g npm@8.5.5
33+
npm ci
3134
git submodule update --remote --init
32-
yarn run provision:token:contracts
35+
npm run provision:token:contracts
3336
step_pull_solc_docker: &step_pull_solc_docker
3437
run:
3538
name: "Pull solc docker image"
@@ -41,10 +44,10 @@ step_setup_slither: &step_setup_slither
4144
wget https://github.com/ethereum/solidity/releases/download/v0.5.8/solc-static-linux
4245
chmod +x solc-static-linux
4346
sudo mv solc-static-linux /usr/local/bin/solc
44-
sudo pip install slither-analyzer
45-
sudo pip install solc-select
46-
sudo solc-select install 0.7.3
47-
sudo solc-select use 0.7.3
47+
pip install slither-analyzer
48+
pip install solc-select
49+
solc-select install 0.7.3
50+
solc-select use 0.7.3
4851
4952
jobs:
5053
reputation-test:
@@ -63,10 +66,10 @@ jobs:
6366
sudo apt-get install lsof
6467
- run:
6568
name: "Running reputation system unit tests"
66-
command: yarn run test:reputation
69+
command: npm run test:reputation
6770
- run:
6871
name: "Running storage consistency smoke tests"
69-
command: yarn run test:contracts:smoke
72+
command: npm run test:contracts:smoke
7073
lint-and-unit-test:
7174
<<: *job_common
7275
steps:
@@ -111,43 +114,52 @@ jobs:
111114
sudo apt-get install lsof
112115
- run:
113116
name: "Linting JavaScript"
114-
command: yarn run eslint
117+
command: npm run eslint
115118
- run:
116119
name: "Linting Solidity"
117-
command: yarn run solhint
120+
command: npm run solhint
121+
- run:
122+
name: "Building Docs"
123+
command: npm run build:docs
124+
- run:
125+
name: "Check git hooks run"
126+
command: npm run check:gitchanges
118127
- run:
119128
name: "Checking contract storage variables"
120-
command: yarn run check:storagevars
129+
command: npm run check:storagevars
121130
- run:
122131
name: "Checking contract recovery modifiers"
123-
command: yarn run check:recoverymods
132+
command: npm run check:recoverymods
124133
- run:
125134
name: "Checking contract versions"
126-
command: yarn run check:versioning
135+
command: npm run check:versioning
136+
- run:
137+
name: "Provision token contracts again (needed after version check script)"
138+
command: npm run provision:token:contracts
127139
- run:
128140
name: "Checking contract authDomain modifiers"
129-
command: yarn run check:auth
141+
command: npm run check:auth
130142
- run:
131143
name: "Running network contracts unit tests"
132-
command: yarn run test:contracts
144+
command: npm run test:contracts
133145
- run:
134146
name: "Cleanup ganache leftovers"
135-
command: yarn run clean:ganache
147+
command: npm run clean:ganache
136148
- run:
137149
name: "Running extension contracts unit tests"
138-
command: yarn run test:contracts:extensions
150+
command: npm run test:contracts:extensions
139151
- run:
140152
name: "Cleanup ganache leftovers"
141-
command: yarn run clean:ganache
153+
command: npm run clean:ganache
142154
- run:
143155
name: "Running upgrade tests"
144-
command: yarn run test:contracts:upgrade:parity && yarn run test:contracts:upgrade:ganache
156+
command: npm run test:contracts:upgrade:parity && npm run test:contracts:upgrade:ganache
145157
- run:
146158
name: "Running gas cost tests"
147-
command: yarn run test:contracts:gasCosts && yarn run codechecks
159+
command: npm run test:contracts:gasCosts && npx codechecks
148160
- run:
149161
name: "Running patricia tree tests"
150-
command: yarn run test:contracts:patricia
162+
command: npm run test:contracts:patricia
151163
- <<: *step_save_cache
152164
# Save test results
153165
- store_test_results:
@@ -167,7 +179,7 @@ jobs:
167179
- <<: *step_setup_global_packages
168180
- run:
169181
name: "Running core contract unit tests with coverage"
170-
command: yarn run test:contracts:coverage
182+
command: npm run test:contracts:coverage
171183
environment:
172184
NODE_OPTIONS: --max_old_space_size=4096
173185
- persist_to_workspace:
@@ -185,7 +197,7 @@ jobs:
185197
- <<: *step_setup_global_packages
186198
- run:
187199
name: "Running upgrade tests with coverage"
188-
command: yarn run test:contracts:upgrade:coverage
200+
command: npm run test:contracts:upgrade:coverage
189201
environment:
190202
NODE_OPTIONS: --max_old_space_size=4096
191203
- persist_to_workspace:
@@ -203,7 +215,7 @@ jobs:
203215
- <<: *step_setup_global_packages
204216
- run:
205217
name: "Running extension contract unit tests with coverage"
206-
command: yarn run test:contracts:extensions:coverage
218+
command: npm run test:contracts:extensions:coverage
207219
environment:
208220
NODE_OPTIONS: --max_old_space_size=4096
209221
- persist_to_workspace:
@@ -221,7 +233,7 @@ jobs:
221233
- <<: *step_setup_global_packages
222234
- run:
223235
name: "Running reputation tests with coverage"
224-
command: yarn run test:reputation:coverage
236+
command: npm run test:reputation:coverage
225237
environment:
226238
NODE_OPTIONS: --max_old_space_size=4096
227239
- persist_to_workspace:
@@ -239,22 +251,22 @@ jobs:
239251
- <<: *step_setup_global_packages
240252
- run:
241253
name: "Running chainid tests with coverage for mainnet"
242-
command: CHAIN_ID=1 yarn run test:contracts:chainid:coverage
254+
command: CHAIN_ID=1 npm run test:contracts:chainid:coverage
243255
environment:
244256
NODE_OPTIONS: --max_old_space_size=4096
245257
- run:
246258
name: "Running chainid tests with coverage for goerli"
247-
command: CHAIN_ID=5 yarn run test:contracts:chainid:coverage
259+
command: CHAIN_ID=5 npm run test:contracts:chainid:coverage
248260
environment:
249261
NODE_OPTIONS: --max_old_space_size=4096
250262
- run:
251263
name: "Running chainid tests with coverage for xDai"
252-
command: CHAIN_ID=100 yarn run test:contracts:chainid:coverage
264+
command: CHAIN_ID=100 npm run test:contracts:chainid:coverage
253265
environment:
254266
NODE_OPTIONS: --max_old_space_size=4096
255267
- run:
256268
name: "Running chainid tests with coverage for an unsupported network"
257-
command: CHAIN_ID=777 yarn run test:contracts:chainid:coverage
269+
command: CHAIN_ID=777 npm run test:contracts:chainid:coverage
258270
environment:
259271
NODE_OPTIONS: --max_old_space_size=4096
260272
- persist_to_workspace:
@@ -271,12 +283,12 @@ jobs:
271283
- <<: *step_restore_cache
272284
- run:
273285
name: "Install packages"
274-
command: yarn --pure-lockfile --ignore-engines --network-concurrency 1
286+
command: npm ci
275287
- attach_workspace:
276288
at: ./
277289
- run:
278290
name: "Merge coverage runs and check coverage thresholds"
279-
command: yarn run check:coverage
291+
command: npm run check:coverage
280292
# Save coverage artifacts
281293
- store_artifacts:
282294
path: coverage-merged
@@ -294,7 +306,7 @@ jobs:
294306
name: "Slither analysis"
295307
command: |
296308
rm build/contracts/*
297-
yarn run test:security:slither
309+
npm run test:security:slither
298310
end-to-end-tests:
299311
<<: *job_common
300312
steps:
@@ -306,7 +318,7 @@ jobs:
306318
- <<: *step_setup_global_packages
307319
- run:
308320
name: "Running end-to-end tests"
309-
command: yarn run test:contracts:e2e
321+
command: npm run test:contracts:e2e
310322

311323
workflows:
312324
version: 2
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/README.md renamed to .github/README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<img src="/docs/img/colonyNetwork_color.svg" width="600" />
2+
<img src="https://raw.githubusercontent.com/JoinColony/brand/v1.0.0/logo_network.svg" width="600" />
33
</div>
44
<div align="center">
55
<a href="https://circleci.com/gh/JoinColony/colonyNetwork">
@@ -27,9 +27,7 @@ See the [Bug Bounty program overview](./_bug_rules.md) for more information abou
2727

2828
## Prerequisites
2929

30-
`node` v10.12 or higher (we recommend using `nvm`)
31-
32-
`yarn` v1.13 or higher
30+
`node` v16.15.x (we recommend using [`nvm`](https://github.com/nvm-sh/nvm))
3331

3432
`docker` v18 or higher
3533

@@ -49,7 +47,7 @@ $ git clone https://github.com/JoinColony/colonyNetwork.git
4947
Move into the directory and install dependencies:
5048

5149
```
52-
$ cd colonyNetwork && yarn
50+
$ cd colonyNetwork && npm install
5351
```
5452

5553
Update submodule libraries:
@@ -60,7 +58,7 @@ $ git submodule update --init
6058
Provision token contracts for testing:
6159

6260
```
63-
$ yarn provision:token:contracts
61+
$ npm run provision:token:contracts
6462
```
6563

6664
## Contracts
@@ -73,31 +71,31 @@ The `math`, `erc20`, `auth`, `roles` and a significant part of the `token` contr
7371
You can start a local test node and deploy the contracts yourself using the locally installed `truffle` package.
7472

7573
```
76-
yarn start:blockchain:client
74+
npm run start:blockchain:client
7775
78-
yarn truffle migrate --reset --compile-all
76+
npx truffle migrate --reset --compile-all
7977
```
8078

8179
To deploy all contracts and run all contract tests:
8280
```
83-
yarn test:contracts
81+
npm run test:contracts
8482
```
8583
To deploy all contracts and run all reputation mining tests:
8684
```
87-
yarn test:reputation
85+
npm run test:reputation
8886
```
8987
To run tests with code coverage using [solidity-coverage](https://github.com/sc-forks/solidity-coverage):
9088
```
91-
yarn run test:contracts:coverage
89+
npm run test:contracts:coverage
9290
```
9391
To lint contracts using [Solium](https://github.com/duaraghav8/Solium)
9492
```
95-
yarn run solium
93+
npm run solium
9694
```
9795

9896
To lint JS using `eslint` (this is also a pre-commit hook)
9997
```
100-
yarn run eslint
98+
npm run eslint
10199
```
102100

103101
## Contributing

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ test-results.xml
77
0
88
parityPassword
99
**/build/*
10+
*.sqlite*
1011
coverageEnv
1112
coverage-contracts
1213
coverage-merged
@@ -18,14 +19,9 @@ coverage-miner
1819
lib/*
1920
ganache-accounts.json
2021
.vscode/
21-
yarn-error.log
2222
reputations.json
23-
reputationStates.sqlite
24-
reputationStates.sqlite-shm
25-
reputationStates.sqlite-wal
2623
justificationTreeCache.json
2724
truffle-security-output.json
2825
.coverage_contracts
2926
etherrouter-address.json
3027
ganache-chain-db
31-
mtxCache.sqlite

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run eslint-staged && npm run solhint-staged && npm run build:docs && git add docs

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
12.22.12
1+
14.18.2

.nycrc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
{
2-
"require": ["@babel/register"],
32
"include": "packages/reputation-miner/ReputationMiner*.js",
43
"reporter": ["lcov", "html"],
54
"report-dir": "./coverage-miner",

0 commit comments

Comments
 (0)