Repository navigation
Expand file tree
/
Copy pathjustfile
More file actions
81 lines (56 loc) · 1.82 KB
/
Copy pathjustfile
File metadata and controls
81 lines (56 loc) · 1.82 KB
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
# Consent Ledger task runner
# Run `just` to see all available commands
set dotenv-load := true
default:
@just --list
fmt:
forge fmt
fmt-check:
forge fmt --check
lint:
solhint 'src/**/*.sol' 'script/**/*.sol' --max-warnings 0
forge-lint:
forge lint --deny warnings src
# Requires slither: `pipx install slither-analyzer==0.11.6` (same version as CI)
slither:
slither . --config-file slither.config.json --fail-medium
test:
forge test -vvv
build:
forge build --build-info --sizes src
clean:
forge clean
gas:
forge test --gas-report
coverage:
forge coverage --report summary --no-match-coverage "(test|script|lib)"
# Fails unless lines, statements, branches and functions are 100% covered
check-coverage:
./check-coverage.sh
gen-abis:
./generate-abis.sh
# Fails if abis/ is out of date with the contracts
check-abis: gen-abis
@test -z "$(git status --porcelain -- abis)" || (git status --short -- abis && echo "ABIs are out of date: run 'just gen-abis' and commit abis/" && exit 1)
deployment-tests:
just typecheck-deployment
just test-deployment-ts
typecheck-deployment:
npx tsc --noEmit
test-deployment-ts:
node --test script/*.test.ts
deploy network *args:
node script/deployment.ts deploy {{ network }} {{ args }}
finalize-deploy network:
node script/deployment.ts finalize-deploy {{ network }}
verify network:
node script/deployment.ts verify-sources {{ network }}
check-live network:
node script/deployment.ts check-live {{ network }}
# CI equivalent check
check: fmt-check lint forge-lint test deployment-tests check-coverage build slither check-abis
@echo "All checks passed."
pre-push: fmt-check lint forge-lint test deployment-tests check-coverage check-abis
@echo "Ready to push."
fix: fmt lint test
@echo "Fixed and validated."