-
Notifications
You must be signed in to change notification settings - Fork 40
/
config.yml
312 lines (305 loc) · 11.3 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
version: 2
jobs:
build_check:
machine:
image: ubuntu-1604:201903-01
working_directory: /home/circleci/github.com/tokencard/contracts
steps:
- checkout
- restore_cache:
keys:
- vendor-{{ checksum "go.sum" }}
- run: ./build.sh
- run: '[[ -z $(git status -uno --porcelain) ]] || (git status ; echo "Please run ./build.sh before committing changes!"; exit 1)'
- persist_to_workspace:
root: /home/circleci/github.com/tokencard/contracts
paths:
- build
build_test:
docker:
- image: quay.io/token/go-build:v0.3.7
resource_class: xlarge
working_directory: /home/circleci/github.com/tokencard/contracts
steps:
- checkout
- restore_cache:
keys:
- vendor-{{ checksum "go.sum" }}
- attach_workspace:
at: /tmp/home/circleci/github.com/tokencard/contracts
- run:
name: "Copy build files from previous job"
command: cp -r /tmp/home/circleci/github.com/tokencard/contracts/build /home/circleci/github.com/tokencard/contracts/build
- run:
name: "Setup custom environment variables"
command: |
echo "export GO111MODULE=on" >> $BASH_ENV # Redirect MY_ENV_VAR into $BASH_ENV
- run:
name: "Vendor Go dependencies"
command: go mod vendor
- run:
name: "Run smart contract tests"
command: go run github.com/onsi/ginkgo/ginkgo -r ./test/...
no_output_timeout: 30m
- save_cache:
key: vendor-{{ checksum "go.sum" }}
paths:
- "vendor"
format_check:
docker:
- image: node@sha256:d2734cb9a3b16e1103b27bca3f9db410cf6834a11302d1b5304c1d8627fb9732
working_directory: /home/circleci/github.com/tokencard/contracts
steps:
- run: apk add -U git openssh-client ca-certificates
- checkout
- run: npm install --no-package-lock [email protected] [email protected]
- run: npx prettier --list-different --plugin=prettier-plugin-solidity {contracts,contracts/mocks,contracts/internals,echidna}/*.sol
mythril:
docker:
- image: mythril/myth@sha256:48a0bbe632eca0312237cae70395e687c748f1cf2585494a305fee26fb685fc6
resource_class: xlarge
working_directory: /tmp/contracts
parallelism: 8
steps:
- checkout
- run:
working_directory: contracts
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 0 ]]; then
myth analyze --solv=0.6.11 ./oracle.sol --execution-timeout=800 --max-depth=15 --parallel-solving
fi
no_output_timeout: 20m
- run:
working_directory: contracts
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 1 ]]; then
myth analyze --solv=0.6.11 ./wallet.sol --execution-timeout=800 --max-depth=15 --parallel-solving
fi
no_output_timeout: 20m
- run:
working_directory: contracts
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 2 ]]; then
myth analyze --solv=0.6.11 ./holder.sol --execution-timeout=800 --max-depth=15 --parallel-solving
fi
no_output_timeout: 20m
- run:
working_directory: contracts
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 3 ]]; then
myth analyze --solv=0.6.11 ./licence.sol --execution-timeout=800 --max-depth=15 --parallel-solving
fi
no_output_timeout: 20m
- run:
working_directory: contracts
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 4 ]]; then
myth analyze --solv=0.6.11 ./tokenWhitelist.sol --execution-timeout=800 --max-depth=15 --parallel-solving
fi
no_output_timeout: 20m
- run:
working_directory: contracts
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 5 ]]; then
myth analyze --solv=0.6.11 ./walletDeployer.sol --execution-timeout=800 --max-depth=15 --parallel-solving
fi
no_output_timeout: 20m
- run:
working_directory: contracts
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 6 ]]; then
myth analyze --solv=0.6.11 ./controller.sol --execution-timeout=800 --max-depth=15 --parallel-solving
fi
no_output_timeout: 20m
- run:
working_directory: contracts
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 7 ]]; then
myth analyze --solv=0.5.17 ./gasProxy.sol --execution-timeout=800 --max-depth=15 --parallel-solving
fi
no_output_timeout: 20m
slither:
docker:
- image: trailofbits/eth-security-toolbox@sha256:6376ca0f1e01cfac40499650e3b5c3c430f7c6fee73fcd2ea71aad4d0fa0038b
working_directory: /tmp/contracts
parallelism: 7
steps:
- run: sudo -n apt-get update && sudo -n apt-get install -y openssh-client
- checkout
- run: solc-select 0.6.11
- run:
working_directory: tools/slither
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 0 ]]; then
slither ../../contracts/wallet.sol
fi
no_output_timeout: 5m
- run:
working_directory: tools/slither
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 1 ]]; then
slither ../../contracts/oracle.sol
fi
no_output_timeout: 5m
- run:
working_directory: tools/slither
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 2 ]]; then
slither ../../contracts/licence.sol
fi
no_output_timeout: 5m
- run:
working_directory: tools/slither
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 3 ]]; then
slither ../../contracts/holder.sol
fi
no_output_timeout: 5m
- run:
working_directory: tools/slither
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 4 ]]; then
slither ../../contracts/tokenWhitelist.sol
fi
no_output_timeout: 5m
- run:
working_directory: tools/slither
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 5 ]]; then
slither ../../contracts/walletDeployer.sol
fi
no_output_timeout: 5m
- run:
working_directory: tools/slither
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 6 ]]; then
slither ../../contracts/gasProxy.sol
fi
no_output_timeout: 5m
# echidna:
# docker:
# - image: trailofbits/eth-security-toolbox@sha256:6376ca0f1e01cfac40499650e3b5c3c430f7c6fee73fcd2ea71aad4d0fa0038b
# resource_class: xlarge
# working_directory: /tmp/contracts
# parallelism: 6
# steps:
# - run: sudo -n apt-get update && sudo -n apt-get install -y openssh-client
# - checkout
# - run: solc-select 0.6.11
# - run: find contracts -type f -name '*.sol' -exec slither-flat --convert-external {} \;
# - run:
# command: |
# if [[ "${CIRCLE_NODE_INDEX}" == 0 ]]; then
# echidna-test tools/echidna/wallet/wallet.sol --config=tools/echidna/wallet/wallet.yaml --contract=TEST
# fi
# no_output_timeout: 15m
# - run:
# command: |
# if [[ "${CIRCLE_NODE_INDEX}" == 1 ]]; then
# echidna-test tools/echidna/wallet/addressWhitelist.sol --config=tools/echidna/wallet/addressWhitelist.yaml --contract=TEST
# fi
# no_output_timeout: 15m
# - run:
# command: |
# if [[ "${CIRCLE_NODE_INDEX}" == 2 ]]; then
# echidna-test tools/echidna/wallet/spendLimit.sol --config=tools/echidna/wallet/spendLimit.yaml --contract=TEST
# fi
# no_output_timeout: 15m
# - run:
# command: |
# if [[ "${CIRCLE_NODE_INDEX}" == 3 ]]; then
# echidna-test tools/echidna/wallet/gasTopUpLimit.sol --config=tools/echidna/wallet/gasTopUpLimit.yaml --contract=TEST
# fi
# no_output_timeout: 15m
# - run:
# command: |
# if [[ "${CIRCLE_NODE_INDEX}" == 4 ]]; then
# echidna-test tools/echidna/controller/controller.sol --config=tools/echidna/controller/controller.yaml --contract=TEST
# fi
# no_output_timeout: 15m
# - run:
# command: |
# if [[ "${CIRCLE_NODE_INDEX}" == 5 ]]; then
# echidna-test tools/echidna/internals/ownable.sol --config=tools/echidna/internals/ownable.yaml --contract=TEST
# fi
# no_output_timeout: 15m
manticore:
docker:
- image: trailofbits/eth-security-toolbox@sha256:6376ca0f1e01cfac40499650e3b5c3c430f7c6fee73fcd2ea71aad4d0fa0038b
working_directory: /tmp/contracts
parallelism: 6
steps:
- run: ulimit -s 100000
- run: sudo -n apt-get update && sudo -n apt-get install -y openssh-client
- checkout
- run: solc-select 0.6.11
- run:
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 0 ]]; then
manticore contracts/holder.sol --contract=Holder --config=tools/manticore/manticore.yaml --quick-mode
fi
no_output_timeout: 15m
- run:
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 1 ]]; then
manticore contracts/walletDeployer.sol --contract=WalletDeployer --config=tools/manticore/manticore.yaml --quick-mode
fi
no_output_timeout: 15m
- run:
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 2 ]]; then
manticore contracts/internals/bytesUtils.sol --contract=BytesUtils --config=tools/manticore/manticore.yaml --quick-mode
fi
no_output_timeout: 15m
- run:
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 3 ]]; then
manticore contracts/internals/date.sol --contract=Date --config=tools/manticore/manticore.yaml --quick-mode
fi
no_output_timeout: 15m
- run:
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 4 ]]; then
manticore contracts/internals/parseIntScientific.sol --contract=ParseIntScientific --config=tools/manticore/manticore.yaml --quick-mode
fi
no_output_timeout: 15m
- run:
command: |
if [[ "${CIRCLE_NODE_INDEX}" == 5 ]]; then
manticore contracts/internals/balanceable.sol --contract=Balanceable --config=tools/manticore/manticore.yaml --quick-mode
fi
no_output_timeout: 15m
workflows:
version: 2
build_deploy:
jobs:
- build_check:
filters:
tags:
ignore: ""
- build_test:
requires:
- build_check
filters:
tags:
ignore: ""
- format_check:
filters:
tags:
ignore: ""
- mythril:
filters:
tags:
ignore: ""
- slither:
filters:
tags:
ignore: ""
# - echidna:
# filters:
# tags:
# ignore: ""
- manticore:
filters:
tags:
ignore: ""