-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
257 lines (206 loc) · 13.9 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
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
# include .env file and export its env vars
# (-include to ignore error if it does not exist)
-include .env
export ETHEREUM_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/ETHEREUM_RPC_URL/credential)
export BSC_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BSC_RPC_URL/credential)
export AVALANCHE_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/AVALANCHE_RPC_URL/credential)
export POLYGON_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/POLYGON_RPC_URL/credential)
export ARBITRUM_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/ARBITRUM_RPC_URL/credential)
export OPTIMISM_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/OPTIMISM_RPC_URL/credential)
export BASE_RPC_URL := $(shell op read op://5ylebqljbh3x6zomdxi3qd7tsa/BASE_RPC_URL/credential)
# deps
install:; forge install
update:; forge update
# Build & test
build :; forge build
test :; forge test --no-match-contract stEthSwapTest -vvv
clean :; forge clean
snapshot :; forge snapshot
fmt :; forge fmt && forge fmt test/
# General test
test-aave :; forge test --match-contract Aave* -vvv
test-compound :; forge test --match-contract Compound* -vvv
test-compound-v3 :; forge test --match-contract CompoundV3* -vvv
test-steth :; forge test --match-contract stEth.*Test -vvv
test-steth-swap :; forge test --match-contract stEthSwap.*Test -vvv
test-stmatic :; forge test --match-contract stMatic.*Test -vv
test-uniswapV2 :; forge test --match-contract UniswapV2Test -vvv
test-uniswapV2swap :; forge test --match-contract UniswapV2TestSwap -vv
test-reth :; forge test --match-contract rEthTest -vvv
test-arrakis :; forge test --match-contract Arrakis_LP_Test -vvv
test-geist :; forge test --match-contract GeistERC4626ReinvestTest -vvv
test-alpaca :; forge test --match-contract AlpacaERC4626ReinvestTest -vvv
test-aavev3-uni :; forge test --match-contract AaveV3ERC4626ReinvestUniTest -vvv
test-aavev3-incentive :; forge test --match-contract AaveV3ERC4626ReinvestIncentiveTest -vvv
# Reinvest test
test-venus-reinvest :; forge test --match-contract VenusERC4626WrapperTest -vvv
test-aaveV2-reinvest :; forge test --match-contract AaveV2ERC4626ReinvestTest -vvv
test-aaveV3-reinvest :; forge test --match-contract AaveV3ERC4626ReinvestTest -vvv
test-benqi-reinvest :; forge test --match-contract BenqiERC4626ReinvestTest -vvv
test-benqiNative-reinvest :; forge test --match-contract BenqiNativeERC4626ReinvestTest -vvv
test-aaveV3-uni-reinvest :; forge test --match-contract AaveV3ERC4626ReinvestUniTest --match-test testHarvester -vvv
# Harvester tests (check tests comments)
test-aaveV3-harvest :; forge test --match-contract AaveV3ERC4626ReinvestTest --match-test testHarvester -vvv
test-venus-harvest :; forge test --match-contract VenusERC4626HarvestTest -vvv
# Uniswap tests
test-uniswapV2swap-withdraw :; forge test --match-contract UniswapV2TestSwap --match-test testDepositWithdraw -vvv
test-uniswapV2swap-localhost :; forge test --match-contract UniswapV2TestSwapLocalHost -vvv
# Benqi-Staking tests
test-benqi-staking :; forge test --match-contract BenqiERC4626StakingTest -vvvvv
# KYCDao4626 tests
test-kycdao :; forge test --match-contract kycDAO4626Test -vvv
####################
### BINANCE CHAIN ##
####################
# VENUS-BSC-USDC
deploy-venus-usdc :; forge create --rpc-url $(BSC_RPC_URL) \
--constructor-args $(VENUS_USDC_ASSET) $(VENUS_REWARD_XVS) $(VENUS_VUSDC_CTOKEN) $(VENUS_COMPTROLLER) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/venus/VenusERC4626Reinvest.sol:VenusERC4626Reinvest
# VENUS-BSC-BUSD
deploy-venus-busd :; forge create --rpc-url $(BSC_RPC_URL) \
--constructor-args $(VENUS_BUSD_ASSET) $(VENUS_REWARD_XVS) \
$(VENUS_BUSD_CTOKEN) $(VENUS_COMPTROLLER) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/venus/VenusERC4626Reinvest.sol:VenusERC4626Reinvest
##############
### POLYGON ##
##############
# AAVE-V3-POLYGON-FACTORY
deploy-aave3-polygon-factory :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(AAVEV3_POLYGON_LENDINGPOOL) $(AAVEV3_POLYGON_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626ReinvestFactory.sol:AaveV3ERC4626ReinvestFactory
# AAVE-V3-POLY-USDC
deploy-aave3-polygon-dai :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(AAVEV3_POLYGON_DAI) $(AAVEV3_POLYGON_ADAI) $(AAVEV3_POLYGON_LENDINGPOOL) $(AAVEV3_POLYGON_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626Reinvest.sol:AaveV3ERC4626Reinvest
# AAVE-V3-POLY-DAI
deploy-aave3-polygon-usdc :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(AAVEV3_POLYGON_USDC) $(AAVEV3_POLYGON_AUSDC) $(AAVEV3_POLYGON_LENDINGPOOL) $(AAVEV3_POLYGON_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626Reinvest.sol:AaveV3ERC4626Reinvest
# AAVE-V2-POLYGON-FACTORY
deploy-aave2-polygon-factory :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(AAVEV2_POLYGON_REWARDS) $(AAVEV2_POLYGON_LENDINGPOOL) $(AAVEV2_POLYGON_REWARDTOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v2/AaveV2ERC4626ReinvestFactory.sol:AaveV2ERC4626ReinvestFactory
# AAVE-V2-POLY-DAI
deploy-aave2-polygon-dai :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(AAVEV2_POLYGON_DAI) $(AAVEV2_POLYGON_ADAI) $(AAVEV2_POLYGON_REWARDS) $(AAVEV2_POLYGON_LENDINGPOOL) $(AAVEV2_POLYGON_REWARDTOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v2/AaveV2ERC4626Reinvest.sol:AaveV2ERC4626Reinvest
# AAVE-V2-POLY-WMATIC
deploy-aave2-polygon-wmatic :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(AAVEV2_POLYGON_WMATIC) $(AAVEV2_POLYGON_AWMATIC) $(AAVEV2_POLYGON_REWARDS) $(AAVEV2_POLYGON_LENDINGPOOL) $(AAVEV2_POLYGON_REWARDTOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v2/AaveV2ERC4626Reinvest.sol:AaveV2ERC4626Reinvest
# ARRAKIS-POLY-USDC-WMATIC-FACTORY
deploy-arrakis-poly-factory :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(ARRAKIS_ROUTER_CONFIG) \
--private-key $(PRIVATE_KEY) src/arrakis/Arrakis_Factory.sol:ArrakisFactory
# ARRAKIS-POLY-WMATIC
deploy-arrakis-poly-wmatic :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(ARRAKIS_USDC_MATIC_GUNI_POOL) "Arrakis WMATIC/USDC LP Vault" "aLP4626" true $(ARRAKIS_ROUTER_CONFIG) 50 \
--private-key $(PRIVATE_KEY) src/arrakis/Arrakis_Non_Native_LP_Vault.sol:ArrakisNonNativeVault
# ARRAKIS-POLY-USDC
deploy-arrakis-poly-usdc :; forge create --rpc-url $(POLYGON_RPC_URL) \
--constructor-args $(ARRAKIS_USDC_MATIC_GUNI_POOL) "Arrakis WMATIC/USDC LP Vault" "aLP4626" false $(ARRAKIS_ROUTER_CONFIG) 50 \
--private-key $(PRIVATE_KEY) src/arrakis/Arrakis_Non_Native_LP_Vault.sol:ArrakisNonNativeVault
#############
### AVAX ####
#############
# AAVE-V3-AVAX-FACTORY
deploy-aave3-avax-factory :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(AAVEV3_AVAX_LENDINGPOOL) $(AAVEV3_AVAX_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626ReinvestFactory.sol:AaveV3ERC4626ReinvestFactory
# AAVE-V3-AVAX-USDC
deploy-aave3-avax-usdc :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(AAVEV3_AVAX_USDC) $(AAVEV3_AVAX_AUSDC) $(AAVEV3_AVAX_LENDINGPOOL) $(AAVEV3_AVAX_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626Reinvest.sol:AaveV3ERC4626Reinvest
# AAVE-V3-AVAX-DAI
deploy-aave3-avax-dai :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(AAVEV3_AVAX_DAI) $(AAVEV3_AVAX_ADAI) $(AAVEV3_AVAX_LENDINGPOOL) $(AAVEV3_AVAX_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626Reinvest.sol:AaveV3ERC4626Reinvest
# AAVE-V2-AVAX-FACTORY
deploy-aave2-avax-factory :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(AAVEV2_AVAX_REWARDS) $(AAVEV2_AVAX_LENDINGPOOL) $(AAVEV2_AVAX_REWARDTOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v2/AaveV2ERC4626ReinvestFactory.sol:AaveV2ERC4626ReinvestFactory
# AAVE-V2-AVAX-DAI
deploy-aave2-avax-dai :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(AAVEV2_AVAX_DAI) $(AAVEV2_AVAX_ADAI) $(AAVEV2_AVAX_REWARDS) $(AAVEV2_AVAX_LENDINGPOOL) $(AAVEV2_AVAX_REWARDTOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v2/AaveV2ERC4626Reinvest.sol:AaveV2ERC4626Reinvest
# AAVE-V2-AVAX-WAVAX
deploy-aave2-avax-wavax :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(AAVEV2_AVAX_WAVAX) $(AAVEV2_AVAX_AWAVAX) $(AAVEV2_AVAX_REWARDS) $(AAVEV2_AVAX_LENDINGPOOL) $(AAVEV2_AVAX_REWARDTOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v2/AaveV2ERC4626Reinvest.sol:AaveV2ERC4626Reinvest
# BENQI-AVAX-USDC
deploy-benqi-usdc :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(BENQI_USDC_ASSET) $(BENQI_USDC_CTOKEN) $(BENQI_COMPTROLLER) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/benqi/BenqiERC4626Reinvest.sol:BenqiERC4626Reinvest
# BENQI-AVAX-WAVAX (native)
deploy-benqi-wavax :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(BENQI_WAVAX_ASSET) $(BENQI_REWARD_QI) $(BENQI_WAVAX_CETHER) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/benqi/BenqiNativeERC4626Reinvest.sol:BenqiNativeERC4626Reinvest
# BENQI-AVAX-sAVAX (liquid staking)
deploy-benqi-savax :; forge create --rpc-url $(AVALANCHE_RPC_URL) \
--constructor-args $(BENQI_WAVAX_ASSET) $(BENQI_sAVAX_ASSET) $(BENQI_WAVAX_SAVAX_POOL) \
--private-key $(PRIVATE_KEY) src/benqi/BenqiERC4626Staking.sol:BenqiERC4626Staking
###############
### ARBITRUM ##
###############
# AAVE-V3-ARBITRUM-FACTORY
deploy-aave3-arbitrum-factory :; forge create --rpc-url $(ARBITRUM_RPC_URL) \
--constructor-args $(AAVEV3_ARBITRUM_LENDINGPOOL) $(AAVEV3_ARBITRUM_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626ReinvestFactory.sol:AaveV3ERC4626ReinvestFactory
# AAVE-V3-ARB-DAI
deploy-aave3-arbitrum-dai :; forge create --rpc-url $(ARBITRUM_RPC_URL) \
--constructor-args $(AAVEV3_ARBITRUM_DAI) $(AAVEV3_ARBITRUM_ADAI) $(AAVEV3_ARBITRUM_LENDINGPOOL) $(AAVEV3_ARBITRUM_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626Reinvest.sol:AaveV3ERC4626Reinvest
# AAVE-V3-ARB-USDC
deploy-aave3-arbitrum-usdc :; forge create --rpc-url $(ARBITRUM_RPC_URL) \
--constructor-args $(AAVEV3_ARBITRUM_USDC) $(AAVEV3_ARBITRUM_AUSDC) $(AAVEV3_ARBITRUM_LENDINGPOOL) $(AAVEV3_ARBITRUM_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626Reinvest.sol:AaveV3ERC4626Reinvest
###############
### OPTIMISM ##
###############
# AAVE-V3-OPTIMISM-FACTORY
deploy-aave3-optimism-factory :; forge create --rpc-url $(OPTIMISM_RPC_URL) \
--constructor-args $(AAVEV3_OPTIMISM_LENDINGPOOL) $(AAVEV3_OPTIMISM_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626ReinvestFactory.sol:AaveV3ERC4626ReinvestFactory
# AAVE-V3-OPT-DAI
deploy-aave3-optimism-dai :; forge create --rpc-url $(OPTIMISM_RPC_URL) \
--constructor-args $(AAVEV3_OPTIMISM_DAI) $(AAVEV3_OPTIMISM_ADAI) $(AAVEV3_OPTIMISM_LENDINGPOOL) $(AAVEV3_OPTIMISM_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626Reinvest.sol:AaveV3ERC4626Reinvest
# AAVE-V3-OPT-USDC
deploy-aave3-optimism-usdc :; forge create --rpc-url $(OPTIMISM_RPC_URL) \
--constructor-args $(AAVEV3_OPTIMISM_USDC) $(AAVEV3_OPTIMISM_AUSDC) $(AAVEV3_OPTIMISM_LENDINGPOOL) $(AAVEV3_OPTIMISM_REWARDS) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/aave-v3/AaveV3ERC4626Reinvest.sol:AaveV3ERC4626Reinvest
###############
### FANTOM ####
###############
# GEIST-FTM-DAI
deploy-geist-ftm-dai :; forge create --rpc-url $(FANTOM_RPC_URL) \
--constructor-args $(GEIST_DAI_ASSET) $(GEIST_DAI_ATOKEN) $(GEIST_REWARDS_DISTRIBUTION) $(GEIST_LENDINGPOOL) $(GEIST_REWARD_TOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/geist/GeistERC4626Reinvest.sol:GeistERC4626Reinvest
# GEIST-FTM-USDC
deploy-geist-ftm-usdc :; forge create --rpc-url $(FANTOM_RPC_URL) \
--constructor-args $(GEIST_USDC_ASSET) $(GEIST_USDC_ATOKEN) $(GEIST_REWARDS_DISTRIBUTION) $(GEIST_LENDINGPOOL) $(GEIST_REWARD_TOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/geist/GeistERC4626Reinvest.sol:GeistERC4626Reinvest
# GEIST-FTM-USDT
deploy-geist-ftm-usdt :; forge create --rpc-url $(FANTOM_RPC_URL) \
--constructor-args $(GEIST_USDT_ASSET) $(GEIST_USDT_ATOKEN) $(GEIST_REWARDS_DISTRIBUTION) $(GEIST_LENDINGPOOL) $(GEIST_REWARD_TOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/geist/GeistERC4626Reinvest.sol:GeistERC4626Reinvest
# GEIST-FTM-MIM
deploy-geist-ftm-mim :; forge create --rpc-url $(FANTOM_RPC_URL) \
--constructor-args $(GEIST_MIM_ASSET) $(GEIST_MIM_ATOKEN) $(GEIST_REWARDS_DISTRIBUTION) $(GEIST_LENDINGPOOL) $(GEIST_REWARD_TOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/geist/GeistERC4626Reinvest.sol:GeistERC4626Reinvest
# GEIST-FTM-WETH
deploy-geist-ftm-weth :; forge create --rpc-url $(FANTOM_RPC_URL) \
--constructor-args $(GEIST_WETH_ASSET) $(GEIST_WETH_ATOKEN) $(GEIST_REWARDS_DISTRIBUTION) $(GEIST_LENDINGPOOL) $(GEIST_REWARD_TOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/geist/GeistERC4626Reinvest.sol:GeistERC4626Reinvest
# GEIST-FTM-WFTM
deploy-geist-ftm-wftm :; forge create --rpc-url $(FANTOM_RPC_URL) \
--constructor-args $(GEIST_FTM_ASSET) $(GEIST_FTM_ATOKEN) $(GEIST_REWARDS_DISTRIBUTION) $(GEIST_LENDINGPOOL) $(GEIST_REWARD_TOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/geist/GeistERC4626Reinvest.sol:GeistERC4626Reinvest
# GEIST-FTM-CRV
deploy-geist-ftm-crv :; forge create --rpc-url $(FANTOM_RPC_URL) \
--constructor-args $(GEIST_CRV_ASSET) $(GEIST_CRV_ATOKEN) $(GEIST_REWARDS_DISTRIBUTION) $(GEIST_LENDINGPOOL) $(GEIST_REWARD_TOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/geist/GeistERC4626Reinvest.sol:GeistERC4626Reinvest
# GEIST-FTM-WBTC
deploy-geist-ftm-wbtc :; forge create --rpc-url $(FANTOM_RPC_URL) \
--constructor-args $(GEIST_WBTC_ASSET) $(GEIST_WBTC_ATOKEN) $(GEIST_REWARDS_DISTRIBUTION) $(GEIST_LENDINGPOOL) $(GEIST_REWARD_TOKEN) $(MANAGER) \
--private-key $(PRIVATE_KEY) src/geist/GeistERC4626Reinvest.sol:GeistERC4626Reinvest