-
Notifications
You must be signed in to change notification settings - Fork 74
Expand file tree
/
Copy pathJustfile
More file actions
123 lines (99 loc) · 5.23 KB
/
Copy pathJustfile
File metadata and controls
123 lines (99 loc) · 5.23 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
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
# Compile all contracts from scratch (force recompile)
build:
npx hardhat compile --force
# Remove Hardhat build artifacts and cache
clean:
npx hardhat clean
# Run test suite without gas enforcement (allows larger txs)
test:
NO_GAS_ENFORCE=true npx hardhat test
# Run unit tests only (test/unit/)
test-unit:
NO_GAS_ENFORCE=true npx hardhat test $(find test/unit -name "*.test.ts" | xargs)
# Run integration tests only (test/integration/)
test-integration:
NO_GAS_ENFORCE=true npx hardhat test $(find test/integration -maxdepth 1 -name "*.test.ts" | xargs)
# Run fork tests against mainnet state (requires MAINNET_RPC_URL in .env)
test-forked:
NO_GAS_ENFORCE=true RUN_FORK=true npx hardhat test $(find test/forked -name "*.test.ts" | xargs)
# Run tests with coverage report, then generate HTML report
coverage:
COVERAGE=true npx hardhat test --coverage
genhtml coverage/lcov.info -o coverage/html
# Compile contracts and display contract bytecode sizes
sizes:
npx hardhat compile --force
npx tsx ./scripts/contract-sizes.ts
# === Env-based Workflows ===
# All env-based recipes take `env` as the first arg.
# The network is auto-resolved from the env name (hoodi-* -> hoodi, mainnet -> mainnet, etc.).
# Pass an explicit network override as the second arg when needed (e.g. deploy to local with hoodi config).
# Fresh deployment (all contracts including proxies)
# Example: just deploy-fresh local
# just deploy-fresh hoodi-stage (deploys to hoodi)
# just deploy-fresh hoodi-stage local (deploys to local with hoodi-stage config)
deploy-fresh env="local" network="":
npx hardhat compile --force
npx tsx scripts/deploy-fresh.ts --env {{env}} {{ if network == "" { "" } else { "--network " + network } }}
# Deploy implementations + modules (no proxy upgrade)
# Example: just deploy hoodi-prod
# just deploy mainnet
deploy env network="":
npx hardhat compile --force
npx tsx scripts/deploy.ts --env {{env}} {{ if network == "" { "" } else { "--network " + network } }}
# Upgrade on fork (pre-deployment validation)
upgrade-fork env="hoodi-stage":
npx hardhat compile --force
npx tsx scripts/upgrade.ts --env {{env}} --fork --network local
# Fork tests
test-fork env="hoodi-stage":
npx hardhat compile --force
npx tsx scripts/run-forked-tests.ts --env {{env}} --fork-network hardhat_forked --use-deployed-state true --strict-deployed-state true --allow-deployed-fallback false --no-gas-enforce true
# End-to-end fork workflow: upgrade then run strict tests
upgrade-test-fork env="hoodi-stage":
just upgrade-fork {{env}}
just test-fork {{env}}
# Live upgrade (owner key required)
# Example: just upgrade hoodi-stage
# just upgrade hoodi-prod
upgrade env network="":
npx hardhat compile --force
npx tsx scripts/upgrade.ts --env {{env}} {{ if network == "" { "" } else { "--network " + network } }}
# Generate SAFE multi-sig batch
generate-safe-batch env="mainnet":
npx tsx scripts/generate-safe-batch.ts --env {{env}}
# Generate deployment attestation (bytecode hashes + config summary for committee review)
generate-attestation env="mainnet" network="":
npx tsx scripts/generate-deployment-attestation.ts --env {{env}} {{ if network == "" { "" } else { "--network " + network } }}
# Verify on-chain state (backward-compatible alias)
verify-upgrade env network="":
npx hardhat compile --force
npx tsx scripts/verify-post-upgrade-config.ts --env {{env}} {{ if network == "" { "" } else { "--network " + network } }}
# Post-upgrade smoke test on a local fork of the just-upgraded network state.
# Exercises register / deposit / stake / oracle commit / liquidate / unstake end-to-end.
# Requires the mainnet fork to be running locally (or --network <fork> override).
# Example: just smoke-test mainnet local
# just smoke-test hoodi-stage local
smoke-test env network="":
npx hardhat compile --force
npx tsx scripts/smoke-test.ts --env {{env}} {{ if network == "" { "" } else { "--network " + network } }}
# === One-off Utilities ===
# Deploy a specific module contract (e.g., SSVOperators, SSVClusters)
deploy-module module network *args:
npx hardhat compile --force
npx tsx scripts/deploy-module.ts --network {{network}} --module {{module}} {{ if args == "" { "" } else { "--args '[\"" + replace(args, " ", "\",\"") + "\"]'" } }}
# Attach an existing deployed module to the env-configured proxy
attach-module env module module-address network="":
npx hardhat compile --force
npx tsx scripts/attach-module.ts --env {{env}} --module {{module}} --module-address {{module-address}} {{ if network == "" { "" } else { "--network " + network } }}
# Upgrade a contract via UUPS proxy pattern (optionally with pre-deployed impl)
upgrade-contract contract proxy network *impl:
npx hardhat compile --force
npx tsx scripts/upgrade-contract.ts --network {{network}} --contract {{contract}} --proxy-address {{proxy}} {{ if impl == "" { "" } else { "--impl-address " + impl } }}
# Verify contract source code on Etherscan/block explorer
verify address network:
npx hardhat verify --network "{{network}}" "{{address}}"
# Export contract ABIs to JSON files for external use
abis:
npx hardhat compile --force
npx tsx scripts/common/export-abis.ts