-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
175 lines (134 loc) · 4.7 KB
/
Makefile
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
# include .env file and export its env vars
# (-include to ignore error if it does not exist)
-include .env
# env var check
check-env :; echo $(ETHERSCAN_API_KEY)
all: clean install build
# Clean the repo
clean :; forge clean
# Install the Modules
install :; foundryup && forge install
# setup foundry, install node modules and initialize husky
build :; forge build && yarn && yarn prepare
# Allow executable scripts
executable :; chmod +x scripts/*
# create an HTML coverage report in ./report (requires lcov & genhtml)
coverage :; forge coverage --no-match-path "test/fork/**/*.sol" --report lcov && genhtml lcov.info -o report --branch-coverage
# Run the slither container
analyze :; python3 analysis/remappings.py && ./analysis/analyze.sh
# run unit tests (and exclude fork tests)
test-unit :; forge test --no-match-path "test/fork/**/*.sol"
test-unit-gas :; forge test --no-match-path "test/fork/**/*.sol" --gas-report
# run unit tests in watch mode
test-unit-w :; forge test --no-match-path "test/fork/**/*.sol" --watch
# run only fork tests (and exclude unit)
# Note: this can take 10 - 20 minutes the first time you run it
test-fork :; forge test --match-path "test/fork/**/*t.sol"
# run all tests
test :; forge test
#### Deployment scripts ####
# MAINNET #
deploy-mainnet-sim :; forge script DeployAuxoProduction \
--rpc-url ${RPC_URL} \
-vvvv
deploy-mainnet :; forge script DeployAuxoProduction \
--rpc-url ${RPC_URL} \
--broadcast \
--keystores ${KEYSTORE_PATH} \
--verify \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
-vvvv
deploy-verifier-sim :; forge script DeployPRVVerifier \
--rpc-url ${RPC_URL} \
-vvvv
deploy-verifier-mainnet :; forge script DeployPRVVerifier \
--rpc-url ${RPC_URL} \
--broadcast \
--keystores ${KEYSTORE_PATH} \
--verify \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
-vvvv
deploy-upgradoor-sim :; forge script DeployUpgradoor \
--rpc-url ${RPC_URL} \
-vvvvv
deploy-upgradoor-mainnet :; forge script DeployUpgradoor \
--rpc-url ${RPC_URL} \
--keystores ${KEYSTORE_PATH} \
--broadcast \
--verify \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
-vvvvv
# TESTNETS AND FORKS #
# simulate a mainnet deployment with mocks for the Sharestimelock
mock-deploy :; forge script DeployAuxoLocal
# simulate a mainnet deployment against a remote fork
sim-deploy :; forge script DeployAuxoForked \
--rpc-url ${RPC_URL} \
--block-number 16632830 \
-vvvvv
# deploy a local, persistent fork against which to run simulations
fork :; anvil --fork-url ${RPC_URL} --fork-block-number 16890699
# deploy to the persistent fork with real broadcast
# run make fork first, or use an alternative fork such as bestnet
sim-deploy-fork :; forge script DeployAuxoPersistentFork \
--rpc-url http://127.0.0.1:8545 \
--private-key ${PRIVATE_KEY} \
--broadcast \
-vvvvv
setup-dist :; chmod +x scripts/setup-distributors.sh && scripts/setup-distributors.sh
# adjusted command for bestnet deploy
deploy-bestnet :; forge script DeployAuxoPersistentFork \
--rpc-url ${RPC} \
--private-key ${PRIVATE_KEY} \
--broadcast
# deploy to goerli and verify on goerli.etherscan
deploy-goerli :; forge script DeployGovernance \
--rpc-url https://rpc.ankr.com/eth_goerli \
--private-key ${PRIVATE_KEY} \
--broadcast \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
--verify \
-vvvv
# preview a deployment with transaction logs without actually posting Txs
sim-deploy-goerli :; forge script DeployGovernance \
--rpc-url https://rpc.ankr.com/eth_goerli \
-vvvv
deploy-fork :; forge script DeployGovernanceFork \
--rpc-url $(RPC) \
--private-key ${PRIVATE_KEY} \
--broadcast \
-vv
sim-deploy-upgradoor :; forge script DeployUpgradoor \
--rpc-url ${RPC_URL} \
-vvvvv
deploy-fork-remote :; forge script DeployAuxoPersistentFork \
--rpc-url $(RPC) \
--private-key ${PRIVATE_KEY} \
--broadcast \
--slow \
-vv
deploy-oracle-goerli :; forge script DeployOracle \
--rpc-url https://rpc.ankr.com/eth_goerli \
--private-key ${PRIVATE_KEY} \
--broadcast \
--etherscan-api-key ${ETHERSCAN_API_KEY} \
--verify \
-vvvv
sim-deploy-fuji :; forge script DeployAuxoProduction \
--rpc-url ${FUJI_URL}
deploy-fuji :; forge script DeployAuxoProduction \
--rpc-url ${FUJI_URL} \
--keystores ${KEYSTORE_PATH} \
--broadcast \
-vvvv
sim-activate-migration :; forge script ActivateMigration \
--rpc-url ${RPC_URL} \
-vvvvv
simulation :; forge script AuxoProtocolSimulation \
--rpc-url ${RPC_URL} \
--block-number 17046052
depositFor :; forge script DepositFor \
--rpc-url ${FUJI_URL} \
--private-key ${PRIVATE_KEY} \
--broadcast \
-vvvv