Skip to content

Commit 7f396aa

Browse files
authored
Merge pull request #5 from compound-finance/compound/2.5-rc2
Add Comp and Governor Alpha Contracts [Release Candidate 2]
2 parents bfc2914 + 63c992c commit 7f396aa

File tree

296 files changed

+53408
-25201
lines changed

Some content is hidden

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

296 files changed

+53408
-25201
lines changed

.circleci/config.yml

Lines changed: 62 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- run:
1313
|
14-
sudo wget https://github.com/ethereum/solidity/releases/download/v0.5.12/solc-static-linux -O /usr/local/bin/solc
14+
sudo wget https://github.com/ethereum/solidity/releases/download/v0.5.16/solc-static-linux -O /usr/local/bin/solc
1515
sudo chmod +x /usr/local/bin/solc
1616
- checkout
1717
- restore_cache:
@@ -22,16 +22,14 @@ jobs:
2222
keys:
2323
- v2-scenario/dependencies-{{ checksum "scenario/package.json" }}
2424
- v2-scenario/dependencies-
25+
- restore_cache:
26+
keys:
27+
- v2-solcache
28+
- restore_cache:
29+
keys:
30+
- v2-scencache
2531
- run: yarn install
2632
- run: cd scenario && yarn install
27-
- run:
28-
name: Ganache
29-
command: script/ganache
30-
background: true
31-
- run: |
32-
while ! nc -z localhost 8545; do
33-
sleep 0.1 # wait for ganache to start
34-
done
3533
- save_cache:
3634
paths:
3735
- node_modules
@@ -43,50 +41,47 @@ jobs:
4341
- attach_workspace:
4442
at: ~/repo
4543
- run: mkdir ~/junit
46-
- run: MOCHA_FILE=~/junit/test-results.xml script/test
44+
- run: ./script/build_scenarios
45+
- run:
46+
shell: /bin/bash -eox pipefail -O globstar
47+
name: yarn test
48+
command: JEST_JUNIT_OUTPUT_DIR=~/junit JEST_JUNIT_OUTPUT_NAME=test-results.xml yarn test $(circleci tests glob 'tests/**/**Test.js' | circleci tests split --split-by=timings)
49+
- save_cache:
50+
paths:
51+
- .build
52+
- .solcache
53+
key: v2-solcache
54+
- save_cache:
55+
paths:
56+
- scenario/.tsbuilt
57+
- .scencache
58+
key: v2-scencache
4759
- store_test_results:
4860
path: ~/junit
4961
- store_artifacts:
5062
path: ~/junit
51-
parallelism: 4
63+
parallelism: 3
64+
resource_class: xlarge
5265

53-
mocha_coverage:
54-
parallelism: 5
66+
verify:
5567
docker:
56-
- image: circleci/node:11
68+
- image: compoundfinance/alpine-java-z3:latest
5769
working_directory: ~/repo
5870
steps:
5971
- checkout
60-
- restore_cache:
61-
keys:
62-
- v2-dependencies-{{ checksum "package.json" }}
63-
- v2-dependencies-
64-
- run: yarn install
65-
- save_cache:
66-
paths:
67-
- node_modules
68-
key: v2-dependencies-{{ checksum "package.json" }}
6972
- attach_workspace:
7073
at: ~/repo
71-
- run:
72-
command: yarn run coverage mocha
73-
no_output_timeout: 20m
74-
- store_artifacts:
75-
path: ~/repo/coverage.json
76-
destination: coverage.json
77-
- store_artifacts:
78-
path: ~/repo/coverage
79-
destination: coverage
80-
- codecov/upload
74+
- run: script/verify
75+
parallelism: 4
8176

82-
scenario_coverage:
77+
coverage:
8378
docker:
8479
- image: circleci/node:11
8580
working_directory: ~/repo
8681
steps:
8782
- run:
8883
|
89-
sudo wget https://github.com/ethereum/solidity/releases/download/v0.5.8/solc-static-linux -O /usr/local/bin/solc
84+
sudo wget https://github.com/ethereum/solidity/releases/download/v0.5.16/solc-static-linux -O /usr/local/bin/solc
9085
sudo chmod +x /usr/local/bin/solc
9186
- checkout
9287
- restore_cache:
@@ -97,10 +92,12 @@ jobs:
9792
keys:
9893
- v2-scenario/dependencies-{{ checksum "scenario/package.json" }}
9994
- v2-scenario/dependencies-
100-
- run:
101-
|
102-
sudo wget https://github.com/ethereum/solidity/releases/download/v0.5.12/solc-static-linux -O /usr/local/bin/solc
103-
sudo chmod +x /usr/local/bin/solc
95+
- restore_cache:
96+
keys:
97+
- v2-solcache
98+
- restore_cache:
99+
keys:
100+
- v2-scencache
104101
- run: yarn install
105102
- run: cd scenario && yarn install
106103
- save_cache:
@@ -113,21 +110,38 @@ jobs:
113110
key: v2-scenario-dependencies-{{ checksum "scenario/package.json" }}
114111
- attach_workspace:
115112
at: ~/repo
113+
- run: mkdir ~/junit
114+
- run: ./script/build_scenarios
116115
- run:
117-
command: yarn run coverage scenario
118-
no_output_timeout: 20m
116+
shell: /bin/bash -eox pipefail -O globstar
117+
name: yarn test
118+
command: JEST_JUNIT_OUTPUT_DIR=~/junit JEST_JUNIT_OUTPUT_NAME=test-results.xml script/coverage $(circleci tests glob 'tests/**/**Test.js' | circleci tests split --split-by=timings) -- --maxWorkers=4
119+
- save_cache:
120+
paths:
121+
- .build
122+
- .solcachecov
123+
key: v2-solcache
124+
- save_cache:
125+
paths:
126+
- scenario/.tsbuilt
127+
- .scencache
128+
key: v2-scencache
129+
- store_test_results:
130+
path: ~/junit
119131
- store_artifacts:
120-
path: ~/repo/coverage.json
121-
destination: coverage.json
132+
path: ~/repo/coverage/coverage-final.json
133+
destination: coverage-final.json
122134
- store_artifacts:
123-
path: ~/repo/coverage
135+
path: ~/repo/coverage/lcov-report
124136
destination: coverage
125-
- codecov/upload
137+
- codecov/upload:
138+
file: ~/repo/coverage/coverage-final.json
139+
parallelism: 10
140+
resource_class: xlarge
126141

127142
lint:
128143
docker:
129144
- image: circleci/node:11
130-
- image: trufflesuite/ganache-cli:v6.7.0
131145
working_directory: ~/repo
132146
steps:
133147
- checkout
@@ -149,12 +163,6 @@ workflows:
149163
build-test-and-deploy:
150164
jobs:
151165
- test
152-
- mocha_coverage:
153-
filters:
154-
branches:
155-
only: /^(master|(.*-cov(er(age)?)?))$/
156-
- scenario_coverage:
157-
filters:
158-
branches:
159-
only: /^(master|(.*-cov(er(age)?)?))$/
166+
- coverage
160167
- lint
168+
- verify

.dockerignore

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,38 @@
1+
allFiredEvents
2+
build
3+
build_
14
node_modules
25
scenario/node_modules
3-
test
4-
!test/contracts
5-
*.DS_Store
6+
.env
7+
.certora*
8+
certora_*
9+
coverage/
10+
coverage.json
11+
emv-*/
12+
networks/test.json
13+
networks/test-abi.json
14+
networks/coverage.json
15+
networks/coverage-abi.json
16+
networks/development.json
17+
networks/development-abi.json
18+
networks/coverage-contracts/*
19+
networks/test-contracts/*
20+
networks/*-contracts.json
21+
networks/*-history
22+
networks/*-settings.json
23+
*.DS_Store
24+
test-results.xml
25+
.tsbuilt
26+
yarn-error.log
27+
scenario/build/webpack.js
28+
.scencache
29+
.solcache
30+
.solcachecov
31+
scenario/.tscache
32+
tests
33+
spec
34+
junit.xml
35+
.build
36+
.last_confs
37+
.git
38+
script/certora

.gitignore

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ build
44
build_
55
node_modules
66
.env
7+
.certora*
8+
certora_*
79
coverage/
810
coverage.json
911
coverageEnv/
12+
emv-*/
1013
formulas/
1114
networks/test.json
1215
networks/test-abi.json
@@ -26,4 +29,12 @@ scTopics
2629
test-results.xml
2730
.tsbuilt
2831
yarn-error.log
29-
scenario/build/webpack.js
32+
scenario/build/webpack.js
33+
.scencache
34+
.solcache
35+
.solcachecov
36+
scenario/.tscache
37+
tests/scenarios/
38+
junit.xml
39+
.build
40+
.last_confs

.soliumrc.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"error",
1414
200
1515
],
16+
"security/no-block-members": "off",
1617
"security/no-inline-assembly": "off",
1718
"security/no-low-level-calls": "off"
1819
}

Dockerfile

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,22 @@
1-
FROM mhart/alpine-node:11.10.1
1+
FROM mhart/alpine-node:13.8.0
22

33
RUN apk update && apk add --no-cache --virtual build-dependencies git python g++ make
4-
RUN yarn global add [email protected]
5-
RUN yarn global add [email protected]
6-
RUN yarn global add typescript
4+
RUN wget https://github.com/ethereum/solidity/releases/download/v0.5.13/solc-static-linux -O /bin/solc && chmod +x /bin/solc
75

8-
RUN wget https://github.com/ethereum/solidity/releases/download/v0.5.8/solc-static-linux -O /usr/local/bin/solc && \
9-
chmod +x /usr/local/bin/solc
10-
11-
RUN mkdir -p /deploy/compound-protocol/scenario
12-
WORKDIR /deploy/compound-protocol
6+
RUN mkdir -p /compound-protocol
7+
WORKDIR /compound-protocol
138

149
# First add deps
15-
ADD ./package.json /deploy/compound-protocol/
16-
ADD ./yarn.lock /deploy/compound-protocol/
17-
RUN yarn install
18-
ADD scenario/package.json /deploy/compound-protocol/scenario
19-
ADD scenario/yarn.lock /deploy/compound-protocol/scenario
20-
RUN ls -la /deploy/compound-protocol
21-
RUN ls -la /deploy/compound-protocol/scenario
22-
RUN cd /deploy/compound-protocol/scenario && yarn install
10+
ADD ./package.json /compound-protocol
11+
ADD ./yarn.lock /compound-protocol
12+
RUN yarn install --lock-file
2313

2414
# Then rest of code and build
25-
ADD . /deploy/compound-protocol
15+
ADD . /compound-protocol
2616

27-
RUN truffle compile
17+
ENV SADDLE_SHELL=/bin/sh
18+
ENV SADDLE_CONTRACTS="contracts/*.sol contracts/**/*.sol"
19+
RUN npx saddle compile
2820

2921
RUN apk del build-dependencies
3022
RUN yarn cache clean

0 commit comments

Comments
 (0)