generated from agusduha/router-proxy-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcannonfile.test.toml
378 lines (321 loc) · 11.4 KB
/
cannonfile.test.toml
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
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
name = "grateful"
version = "<%= package.version %>"
description = "Grateful protocol"
# `salt` here only affects proxy contract
[setting.salt]
description = "Change this to a unique string when deploying multiple instances of the system. Note that only the proxy contract will be unique."
defaultValue = "main3"
[setting.owner]
description = "Initial admin user for the system"
defaultValue = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
[setting.finalOwner]
description = "Admin user for the system"
defaultValue = "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
[contract.CoreModule]
artifact = "contracts/modules/CoreModule.sol:MainCoreModule"
salt = "<%= settings.salt %>"
create2 = true
[contract.AssociatedSystemsModule]
artifact = "contracts/modules/associated-systems/AssociatedSystemsModule.sol:GratefulAssociatedSystemsModule"
[contract.BalancesModule]
artifact = "contracts/modules/BalancesModule.sol:BalancesModule"
[contract.ConfigModule]
artifact = "contracts/modules/ConfigModule.sol:ConfigModule"
[contract.FeesModule]
artifact = "contracts/modules/FeesModule.sol:FeesModule"
[contract.FundsModule]
artifact = "contracts/modules/FundsModule.sol:FundsModule"
[contract.LiquidationsModule]
artifact = "contracts/modules/LiquidationsModule.sol:LiquidationsModule"
[contract.MulticallModule]
artifact = "contracts/modules/MulticallModule.sol:MulticallModule"
[contract.ProfilesModule]
artifact = "contracts/modules/ProfilesModule.sol:ProfilesModule"
[contract.SubscriptionsModule]
artifact = "contracts/modules/SubscriptionsModule.sol:SubscriptionsModule"
[contract.VaultsModule]
artifact = "contracts/modules/VaultsModule.sol:VaultsModule"
[router.CoreRouter]
contracts = [
"CoreModule",
"AssociatedSystemsModule",
"BalancesModule",
"ConfigModule",
"FeesModule",
"FundsModule",
"LiquidationsModule",
"MulticallModule",
"ProfilesModule",
"SubscriptionsModule",
"VaultsModule",
]
depends = [
"contract.CoreModule",
"contract.AssociatedSystemsModule",
"contract.BalancesModule",
"contract.ConfigModule",
"contract.FeesModule",
"contract.FundsModule",
"contract.LiquidationsModule",
"contract.MulticallModule",
"contract.ProfilesModule",
"contract.SubscriptionsModule",
"contract.VaultsModule"
]
[contract.InitialProxy]
artifact = "contracts/Proxy.sol:Proxy"
args = ["<%= contracts.CoreModule.address %>", "<%= settings.owner %>"]
abiOf = ["CoreModule"]
salt = "<%= settings.salt %>"
create2 = true
depends = ["contract.CoreModule"]
[invoke.upgrade_proxy]
target = ["InitialProxy"]
abi = "UpgradeModule"
from = "<%= settings.owner %>"
func = "upgradeTo"
args = ["<%= contracts.CoreRouter.address %>"]
factory.CoreProxy.abiOf = ["CoreRouter"]
factory.CoreProxy.event = "Upgraded"
factory.CoreProxy.arg = 0
depends = ["contract.InitialProxy", "router.CoreRouter"]
# Grateful Profile
[contract.GratefulProfile]
artifact = "contracts/modules/associated-systems/GratefulProfile.sol:GratefulProfile"
[router.ProfileRouter]
contracts = [
"CoreModule",
"GratefulProfile",
]
depends = [
"contract.CoreModule",
"contract.GratefulProfile"
]
[invoke.init_profile]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "initOrUpgradeNft"
args = [
"0x677261746566756c50726f66696c654e66740000000000000000000000000000", # "gratefulProfileNft"
"Grateful Protocol Profile",
"GPP",
"https://imgrateful.io",
"<%= contracts.ProfileRouter.address %>"
]
depends = [
"invoke.upgrade_proxy",
"router.ProfileRouter"
]
factory.ProfileProxy.abiOf = ["ProfileRouter"]
factory.ProfileProxy.event = "AssociatedSystemSet"
factory.ProfileProxy.arg = 2
# Grateful Subscription
[contract.GratefulSubscription]
artifact = "contracts/modules/associated-systems/GratefulSubscription.sol:GratefulSubscription"
[router.SubscriptionRouter]
contracts = [
"CoreModule",
"GratefulSubscription",
]
depends = [
"contract.CoreModule",
"contract.GratefulSubscription"
]
[invoke.init_subscription]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "initOrUpgradeNft"
args = [
"0x677261746566756c537562736372697074696f6e4e6674000000000000000000", # "gratefulSubscriptionNft"
"Grateful Payments",
"GP",
"https://imgrateful.io",
"<%= contracts.SubscriptionRouter.address %>"
]
depends = [
"invoke.upgrade_proxy",
"router.SubscriptionRouter"
]
factory.SubscriptionProxy.abiOf = ["SubscriptionRouter"]
factory.SubscriptionProxy.event = "AssociatedSystemSet"
factory.SubscriptionProxy.arg = 2
# Initialize config
[setting.solvencyTime]
description = "Minimum time that the profile must be solvent to start new subscriptions or withdrawals"
defaultValue = "604800" # 1 week
[setting.liquidationTime]
description = "Minimum time that the profile must be solvent to not be liquidated"
defaultValue = "259200" # 3 days
[invoke.initialize_config]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "initializeConfigModule"
args = ["<%= settings.solvencyTime %>", "<%= settings.liquidationTime %>"]
depends = ["invoke.upgrade_proxy"]
# Intialize fees
[setting.feePercentage]
description = "Fee percentage take for every subscription"
defaultValue = "4" # 4%
[run.initialize_fees]
exec = "scripts/initializeFeesModule.ts"
func = "initializeFeesModule"
args = [
"<%= contracts.ProfileProxy.address %>",
"<%= contracts.CoreProxy.address %>",
"<%= settings.owner %>",
"<%= settings.feePercentage %>"
]
depends = ["invoke.init_profile"]
# Intialize Aave v2 vaults
[setting.aaveMining]
description = "The Aave liquidity mining contract"
defaultValue = "0xd41aE58e803Edf4304334acCE4DC4Ec34a63C644" # Aave v2 Incentives Mumbai address
[setting.lendingPool]
description = "The Aave LendingPool contract"
defaultValue = "0x9198F13B08E299d85E096929fA9781A1E3d5d827" # Aave v2 Pool Mumbai address
[setting.minRate]
description = "Minimum subscription rate for this vault"
defaultValue = "38580246913580" # 1e20 per month
[setting.maxRate]
description = "Maximum subscription rate for this vault"
defaultValue = "3858024691358024" # 100e20 per month
# Intialize Aave v2 DAI vault
[setting.aaveV2DaiVaultId]
description = "Vault name"
defaultValue = "0x414156455f56325f444149000000000000000000000000000000000000000000" # AAVE_V2_DAI (Aave v2 DAI vault name)
[setting.daiAsset]
description = "Token contrect to use in the vault"
defaultValue = "0x001B3B4d0F3714Ca98ba10F6042DaEbF0B1B7b6F" # DAI Mumbai address
[setting.daiAToken]
description = "The Aave aToken contract for the asset"
defaultValue = "0x639cB7b21ee2161DF9c882483C9D55c90c20Ca3e" # aDAI Mumbai address
[contract.AaveV2DAIVault]
artifact = "contracts/vaults/AaveV2Vault.sol:AaveV2Vault"
args = [
"<%= settings.daiAsset %>",
"<%= settings.daiAToken %>",
"<%= settings.owner %>",
"<%= settings.aaveMining %>",
"<%= settings.lendingPool %>",
"<%= contracts.CoreProxy.address %>"
]
depends = ["invoke.upgrade_proxy"]
[invoke.init_aave_v2_dai_vault]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "addVault"
args = ["<%= settings.aaveV2DaiVaultId %>", "<%= contracts.AaveV2DAIVault.address %>", "<%= settings.minRate %>", "<%= settings.maxRate %>"]
depends = ["contract.AaveV2DAIVault"]
# Intialize Aave v2 USDC vault
[setting.aaveV2UsdcVaultId]
description = "Vault name"
defaultValue = "0x414156455f56325f555344430000000000000000000000000000000000000000" # AAVE_V2_USDC (Aave v2 USDC vault name)
[setting.usdcAsset]
description = "Token contrect to use in the vault"
defaultValue = "0x2058A9D7613eEE744279e3856Ef0eAda5FCbaA7e" # USDC Mumbai address
[setting.usdcAToken]
description = "The Aave aToken contract for the asset"
defaultValue = "0x2271e3Fef9e15046d09E1d78a8FF038c691E9Cf9" # aUSDC Mumbai address
[contract.AaveV2USDCVault]
artifact = "contracts/vaults/AaveV2Vault.sol:AaveV2Vault"
args = [
"<%= settings.usdcAsset %>",
"<%= settings.usdcAToken %>",
"<%= settings.owner %>",
"<%= settings.aaveMining %>",
"<%= settings.lendingPool %>",
"<%= contracts.CoreProxy.address %>"
]
depends = ["invoke.upgrade_proxy"]
[invoke.init_aave_v2_usdc_vault]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "addVault"
args = ["<%= settings.aaveV2UsdcVaultId %>", "<%= contracts.AaveV2USDCVault.address %>", "<%= settings.minRate %>", "<%= settings.maxRate %>"]
depends = ["contract.AaveV2USDCVault"]
# Intialize Aave v2 USDT vault
[setting.aaveV2UsdtVaultId]
description = "Vault name"
defaultValue = "0x414156455f56325f555344540000000000000000000000000000000000000000" # AAVE_V2_USDT (Aave v2 USDT vault name)
[setting.usdtAsset]
description = "Token contrect to use in the vault"
defaultValue = "0xBD21A10F619BE90d6066c941b04e340841F1F989" # USDT Mumbai address
[setting.usdtAToken]
description = "The Aave aToken contract for the asset"
defaultValue = "0xF8744C0bD8C7adeA522d6DDE2298b17284A79D1b" # aUSDT Mumbai address
[contract.AaveV2USDTVault]
artifact = "contracts/vaults/AaveV2Vault.sol:AaveV2Vault"
args = [
"<%= settings.usdtAsset %>",
"<%= settings.usdtAToken %>",
"<%= settings.owner %>",
"<%= settings.aaveMining %>",
"<%= settings.lendingPool %>",
"<%= contracts.CoreProxy.address %>"
]
depends = ["invoke.upgrade_proxy"]
[invoke.init_aave_v2_usdt_vault]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "addVault"
args = ["<%= settings.aaveV2UsdtVaultId %>", "<%= contracts.AaveV2USDTVault.address %>", "<%= settings.minRate %>", "<%= settings.maxRate %>"]
depends = ["contract.AaveV2USDTVault"]
# Intialize single asset vaults
# Intialize DAI vault
[setting.daiVaultId]
description = "Vault name"
defaultValue = "0x4441495f5641554c540000000000000000000000000000000000000000000000" # DAI_VAULT (DAI vault name)
[contract.DAIVault]
artifact = "contracts/vaults/SimpleVault.sol:SimpleVault"
args = [
"<%= settings.daiAsset %>",
"<%= contracts.CoreProxy.address %>"
]
depends = ["invoke.upgrade_proxy"]
[invoke.init_dai_vault]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "addVault"
args = ["<%= settings.daiVaultId %>", "<%= contracts.DAIVault.address %>", "<%= settings.minRate %>", "<%= settings.maxRate %>"]
depends = ["contract.DAIVault"]
# Intialize USDC vault
[setting.usdcVaultId]
description = "Vault name"
defaultValue = "0x555344435f5641554c5400000000000000000000000000000000000000000000" # USDC_VAULT (USDC vault name)
[contract.USDCVault]
artifact = "contracts/vaults/SimpleVault.sol:SimpleVault"
args = [
"<%= settings.usdcAsset %>",
"<%= contracts.CoreProxy.address %>"
]
depends = ["invoke.upgrade_proxy"]
[invoke.init_usdc_vault]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "addVault"
args = ["<%= settings.usdcVaultId %>", "<%= contracts.USDCVault.address %>", "<%= settings.minRate %>", "<%= settings.maxRate %>"]
depends = ["contract.USDCVault"]
# Intialize USDT vault
[setting.usdtVaultId]
description = "Vault name"
defaultValue = "0x555344545f5641554c5400000000000000000000000000000000000000000000" # USDT_VAULT (USDT vault name)
[contract.USDTVault]
artifact = "contracts/vaults/SimpleVault.sol:SimpleVault"
args = [
"<%= settings.usdtAsset %>",
"<%= contracts.CoreProxy.address %>"
]
depends = ["invoke.upgrade_proxy"]
[invoke.init_usdt_vault]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "addVault"
args = ["<%= settings.usdtVaultId %>", "<%= contracts.USDTVault.address %>", "<%= settings.minRate %>", "<%= settings.maxRate %>"]
depends = ["contract.USDTVault"]
# Transfer system ownership
[invoke.transfer_system_owner]
target = ["CoreProxy"]
from = "<%= settings.owner %>"
func = "nominateNewOwner"
args = ["<%= settings.finalOwner %>"]
depends = ["invoke.upgrade_proxy"]