-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMakefile
More file actions
225 lines (178 loc) · 7.2 KB
/
Makefile
File metadata and controls
225 lines (178 loc) · 7.2 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
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
# include .env file and export its env vars
# (-include to ignore error if it does not exist)
-include .env
# linux: allow shell scripts to be executed
allow-scripts:; chmod +x ./coverage.sh
# init the repo
install :; make allow-scripts && forge build
# create an HTML coverage report in ./report (requires lcov & genhtml)
coverage:; ./coverage.sh
# retrieve the deployment values from a factory
get-deployment-values :; forge script script/utils/GetDeploymentValues.sol:GetFactoryValues \
--rpc-url=$(RPC_URL) \
-vvvv
# run unit and integration tests
test-ui :; forge test --match-path "test/**/{unit,integration}/**/*.sol"
# curve sanity check (run before deploys)
check-curve :; python3 test/python/crosscheck.py
# run invariant tests
test-invariant :; forge test --match-path "test/**/invariant/**/*.sol" --show-progress
test-invariant-v1-2-0 :; forge test --match-path "test/v1_2_0/invariant/**/*.sol" --show-progress
test-invariant-v1-3-0 :; forge test --match-path "test/v1_3_0/invariant/**/*.sol" --show-progress
test-invariant-v1-4-0 :; forge test --match-path "test/v1_4_0/invariant/**/*.sol" --show-progress
# run unit tests for specific version
test-ui-100 :; forge test --match-path "test/v1_0_0/{unit,integration}/**/*.sol"
test-ui-110 :; forge test --match-path "test/v1_1_0/{unit,integration}/**/*.sol"
test-ui-120 :; forge test --match-path "test/v1_2_0/{unit,integration}/**/*.sol"
test-ui-130 :; forge test --match-path "test/v1_3_0/{unit,integration}/**/*.sol"
test-ui-140 :; forge test --match-path "test/v1_4_0/{unit,integration}/**/*.sol"
test-ui-season :; forge test --match-path "test/season/{unit,integration}/**/*.sol"
# run unit tests
test-unit :; forge test --match-path "test/**/unit/**/*.sol"
# run unit tests for specific version
test-unit-100 :; forge test --match-path "test/v1_0_0/unit/**/*.sol"
test-unit-110 :; forge test --match-path "test/v1_1_0/unit/**/*.sol"
test-unit-120 :; forge test --match-path "test/v1_2_0/unit/**/*.sol"
test-unit-130 :; forge test --match-path "test/v1_3_0/unit/**/*.sol"
test-unit-140 :; forge test --match-path "test/v1_4_0/unit/**/*.sol"
test-unit-season :; forge test --match-path "test/season/unit/**/*.sol"
# regression and upgrade tests
test-upgrade-110 :; forge test --match-path "test/v1_1_0/upgrade/**/*.sol" --force
test-upgrade-120 :; forge test --match-path "test/v1_2_0/upgrade/**/*.sol" --force
test-upgrade-130 :; forge test --match-path "test/v1_3_0/upgrade/**/*.sol" --force
test-upgrade-140 :; forge test --match-path "test/v1_4_0/upgrade/**/*.sol" --force
test-upgrade-season :; forge test --match-path "test/season/upgrade/**/*.sol" --force
#### Fork testing ####
# Fork testing - mode sepolia
ft-mode-sepolia-fork-100 :; forge test --match-contract TestE2E \
--rpc-url https://sepolia.mode.network \
-vv
ft-mode-sepolia-fork-110 :; forge test --match-contract TestE2EV1_1_0 \
--rpc-url https://sepolia.mode.network \
-vvvvv
ft-mode-sepolia-fork-120 :; forge test --match-contract TestE2EV1_2_0 \
--rpc-url https://sepolia.mode.network \
-vvvvv
# Fork testing - mode mainnet
ft-mode-fork-100 :; forge test --match-contract TestE2E \
--rpc-url https://mainnet.mode.network/ \
-vvvvv
ft-mode-fork-110 :; forge test --match-contract TestE2EV1_1_0 \
--rpc-url https://mainnet.mode.network/ \
-vvvvv
ft-mode-fork-120 :; forge test --match-contract TestE2EV1_2_0 \
--rpc-url https://mainnet.mode.network/ \
-vvvvv
# Fork testing - sepolia
ft-sepolia-fork-100 :; forge test --match-contract TestE2E \
--rpc-url $(RPC_URL) \
-vvvvv
ft-sepolia-fork-110 :; forge test --match-contract TestE2EV1_1_0 \
--rpc-url $(RPC_URL) \
-vvvvv
ft-sepolia-fork-120 :; forge test --match-contract TestE2EV1_2_0 \
--rpc-url $(RPC_URL) \
-vvvvv
## Upgrade testing
ft-mode-upgrade-fork :; forge test --match-contract UpgradeModeTo110 \
--rpc-url https://mainnet.mode.network/ \
--fork-block-number 18697900 \
-vvvv
ft-mode-sepolia-upgrade-fork :; forge test --match-contract UpgradeModeTo110 \
--rpc-url https://sepolia.mode.network/ \
--fork-block-number 26050695 \
--force \
-vvvv
upgrade-preview-mode-sepolia :; forge script UpgradeModeTo110 \
--rpc-url https://sepolia.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
-vvvvv
upgrade-mode-sepolia :; forge script UpgradeModeTo110 \
--rpc-url https://sepolia.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url https://sepolia.explorer.mode.network/api\? \
-vvvvv
# on an anvil fork will run the upgrade script
anvil-fork-mode :; anvil -f https://mainnet.mode.network --fork-block-number 18697900 # --auto-impersonate
upgrade-fork-mode :; forge script UpgradeModeTo110 \
--rpc-url http://localhost:8545 \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
-vvvvv
upgrade-preview-mode :; forge script UpgradeModeTo110 \
--rpc-url https://mainnet.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
-vvvvv
upgrade-mode :; forge script UpgradeModeTo110 \
--rpc-url https://mainnet.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url https://explorer.mode.network/api\? \
-vvvvv
#### Deployments ####
deploy-preview-mode-sepolia-110 :; forge script DeployGaugesV1_1_0 \
--rpc-url https://sepolia.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
-vvvvv
deploy-mode-sepolia :; forge script DeployGauges \
--rpc-url https://sepolia.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
--verify \
--verifier blockscout \
--verifier-url https://sepolia.explorer.mode.network/api\? \
-vvvvv
deploy-preview-1-3-sepolia :; forge script script/deploy/DeployGauges_v1_3_0.s.sol:DeployGaugesV1_3_0 \
--rpc-url $(RPC_URL) \
-vvvvv
deploy-1-3-sepolia :; forge script script/deploy/DeployGauges_v1_3_0.s.sol:DeployGaugesV1_3_0 \
--rpc-url $(RPC_URL) \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
--verify \
--slow \
--etherscan-api-key $(ETHERSCAN_API_KEY) \
-vvvvv
deploy-preview-1-4-sepolia :; forge script script/deploy/DeployGauges_v1_4_0.s.sol:DeployGaugesV1_4_0 \
--rpc-url $(RPC_URL) \
-vvvvv
deploy-1-4-sepolia :; forge script script/deploy/DeployGauges_v1_4_0.s.sol:DeployGaugesV1_4_0 \
--rpc-url $(RPC_URL) \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
--verify \
--slow \
--etherscan-api-key $(ETHERSCAN_API_KEY) \
-vvvvv
### Other scripts ###
seed-preview-mode-sepolia :; forge script SeedState \
--rpc-url https://sepolia.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
-vvvvv
seed-mode-sepolia :; forge script SeedState \
--rpc-url https://sepolia.mode.network \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
--verify \
--etherscan-api-key $(ETHERSCAN_API_KEY) \
-vvvvv
deploy-preview-ethereum-sepolia :; forge script DeployGauges \
--rpc-url $(RPC_URL) \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
-vvvvv
deploy-ethereum-sepolia :; forge script DeployGauges \
--rpc-url $(RPC_URL) \
--private-key $(DEPLOYMENT_PRIVATE_KEY) \
--broadcast \
--verify \
--verifier blockscout \
--etherscan-api-key $(ETHERSCAN_API_KEY) \
-vvvvv
get-deployment-values-sepolia-1-2 :; forge script script/utils/GetDeploymentValues_v1_2_0.sol:GetFactoryValuesV1_2_0 \
--rpc-url $(RPC_URL) \
-vvvvv