@strkfarm/sdk 2.0.0-staging.49 → 2.0.0-staging.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -28826,1151 +28826,6 @@ var SenseiStrategies = [
28826
28826
  // src/strategies/yoloVault.ts
28827
28827
  var import_starknet20 = require("starknet");
28828
28828
  var import_starknet21 = require("starknet");
28829
-
28830
- // src/data/yoloVault.abi.json
28831
- var yoloVault_abi_default = [
28832
- {
28833
- type: "impl",
28834
- name: "YoloERC20Impl",
28835
- interface_name: "openzeppelin_token::erc20::interface::IERC20Mixin"
28836
- },
28837
- {
28838
- type: "struct",
28839
- name: "core::integer::u256",
28840
- members: [
28841
- {
28842
- name: "low",
28843
- type: "core::integer::u128"
28844
- },
28845
- {
28846
- name: "high",
28847
- type: "core::integer::u128"
28848
- }
28849
- ]
28850
- },
28851
- {
28852
- type: "enum",
28853
- name: "core::bool",
28854
- variants: [
28855
- {
28856
- name: "False",
28857
- type: "()"
28858
- },
28859
- {
28860
- name: "True",
28861
- type: "()"
28862
- }
28863
- ]
28864
- },
28865
- {
28866
- type: "struct",
28867
- name: "core::byte_array::ByteArray",
28868
- members: [
28869
- {
28870
- name: "data",
28871
- type: "core::array::Array::<core::bytes_31::bytes31>"
28872
- },
28873
- {
28874
- name: "pending_word",
28875
- type: "core::felt252"
28876
- },
28877
- {
28878
- name: "pending_word_len",
28879
- type: "core::integer::u32"
28880
- }
28881
- ]
28882
- },
28883
- {
28884
- type: "interface",
28885
- name: "openzeppelin_token::erc20::interface::IERC20Mixin",
28886
- items: [
28887
- {
28888
- type: "function",
28889
- name: "total_supply",
28890
- inputs: [],
28891
- outputs: [
28892
- {
28893
- type: "core::integer::u256"
28894
- }
28895
- ],
28896
- state_mutability: "view"
28897
- },
28898
- {
28899
- type: "function",
28900
- name: "balance_of",
28901
- inputs: [
28902
- {
28903
- name: "account",
28904
- type: "core::starknet::contract_address::ContractAddress"
28905
- }
28906
- ],
28907
- outputs: [
28908
- {
28909
- type: "core::integer::u256"
28910
- }
28911
- ],
28912
- state_mutability: "view"
28913
- },
28914
- {
28915
- type: "function",
28916
- name: "allowance",
28917
- inputs: [
28918
- {
28919
- name: "owner",
28920
- type: "core::starknet::contract_address::ContractAddress"
28921
- },
28922
- {
28923
- name: "spender",
28924
- type: "core::starknet::contract_address::ContractAddress"
28925
- }
28926
- ],
28927
- outputs: [
28928
- {
28929
- type: "core::integer::u256"
28930
- }
28931
- ],
28932
- state_mutability: "view"
28933
- },
28934
- {
28935
- type: "function",
28936
- name: "transfer",
28937
- inputs: [
28938
- {
28939
- name: "recipient",
28940
- type: "core::starknet::contract_address::ContractAddress"
28941
- },
28942
- {
28943
- name: "amount",
28944
- type: "core::integer::u256"
28945
- }
28946
- ],
28947
- outputs: [
28948
- {
28949
- type: "core::bool"
28950
- }
28951
- ],
28952
- state_mutability: "external"
28953
- },
28954
- {
28955
- type: "function",
28956
- name: "transfer_from",
28957
- inputs: [
28958
- {
28959
- name: "sender",
28960
- type: "core::starknet::contract_address::ContractAddress"
28961
- },
28962
- {
28963
- name: "recipient",
28964
- type: "core::starknet::contract_address::ContractAddress"
28965
- },
28966
- {
28967
- name: "amount",
28968
- type: "core::integer::u256"
28969
- }
28970
- ],
28971
- outputs: [
28972
- {
28973
- type: "core::bool"
28974
- }
28975
- ],
28976
- state_mutability: "external"
28977
- },
28978
- {
28979
- type: "function",
28980
- name: "approve",
28981
- inputs: [
28982
- {
28983
- name: "spender",
28984
- type: "core::starknet::contract_address::ContractAddress"
28985
- },
28986
- {
28987
- name: "amount",
28988
- type: "core::integer::u256"
28989
- }
28990
- ],
28991
- outputs: [
28992
- {
28993
- type: "core::bool"
28994
- }
28995
- ],
28996
- state_mutability: "external"
28997
- },
28998
- {
28999
- type: "function",
29000
- name: "name",
29001
- inputs: [],
29002
- outputs: [
29003
- {
29004
- type: "core::byte_array::ByteArray"
29005
- }
29006
- ],
29007
- state_mutability: "view"
29008
- },
29009
- {
29010
- type: "function",
29011
- name: "symbol",
29012
- inputs: [],
29013
- outputs: [
29014
- {
29015
- type: "core::byte_array::ByteArray"
29016
- }
29017
- ],
29018
- state_mutability: "view"
29019
- },
29020
- {
29021
- type: "function",
29022
- name: "decimals",
29023
- inputs: [],
29024
- outputs: [
29025
- {
29026
- type: "core::integer::u8"
29027
- }
29028
- ],
29029
- state_mutability: "view"
29030
- },
29031
- {
29032
- type: "function",
29033
- name: "totalSupply",
29034
- inputs: [],
29035
- outputs: [
29036
- {
29037
- type: "core::integer::u256"
29038
- }
29039
- ],
29040
- state_mutability: "view"
29041
- },
29042
- {
29043
- type: "function",
29044
- name: "balanceOf",
29045
- inputs: [
29046
- {
29047
- name: "account",
29048
- type: "core::starknet::contract_address::ContractAddress"
29049
- }
29050
- ],
29051
- outputs: [
29052
- {
29053
- type: "core::integer::u256"
29054
- }
29055
- ],
29056
- state_mutability: "view"
29057
- },
29058
- {
29059
- type: "function",
29060
- name: "transferFrom",
29061
- inputs: [
29062
- {
29063
- name: "sender",
29064
- type: "core::starknet::contract_address::ContractAddress"
29065
- },
29066
- {
29067
- name: "recipient",
29068
- type: "core::starknet::contract_address::ContractAddress"
29069
- },
29070
- {
29071
- name: "amount",
29072
- type: "core::integer::u256"
29073
- }
29074
- ],
29075
- outputs: [
29076
- {
29077
- type: "core::bool"
29078
- }
29079
- ],
29080
- state_mutability: "external"
29081
- }
29082
- ]
29083
- },
29084
- {
29085
- type: "impl",
29086
- name: "YoloVaultImpl",
29087
- interface_name: "contracts_private::strategies::yolo_vault::interface::IYoloVault"
29088
- },
29089
- {
29090
- type: "struct",
29091
- name: "strkfarm_contracts::components::swap::Route",
29092
- members: [
29093
- {
29094
- name: "token_from",
29095
- type: "core::starknet::contract_address::ContractAddress"
29096
- },
29097
- {
29098
- name: "token_to",
29099
- type: "core::starknet::contract_address::ContractAddress"
29100
- },
29101
- {
29102
- name: "exchange_address",
29103
- type: "core::starknet::contract_address::ContractAddress"
29104
- },
29105
- {
29106
- name: "percent",
29107
- type: "core::integer::u128"
29108
- },
29109
- {
29110
- name: "additional_swap_params",
29111
- type: "core::array::Array::<core::felt252>"
29112
- }
29113
- ]
29114
- },
29115
- {
29116
- type: "struct",
29117
- name: "strkfarm_contracts::components::swap::AvnuMultiRouteSwap",
29118
- members: [
29119
- {
29120
- name: "token_from_address",
29121
- type: "core::starknet::contract_address::ContractAddress"
29122
- },
29123
- {
29124
- name: "token_from_amount",
29125
- type: "core::integer::u256"
29126
- },
29127
- {
29128
- name: "token_to_address",
29129
- type: "core::starknet::contract_address::ContractAddress"
29130
- },
29131
- {
29132
- name: "token_to_amount",
29133
- type: "core::integer::u256"
29134
- },
29135
- {
29136
- name: "token_to_min_amount",
29137
- type: "core::integer::u256"
29138
- },
29139
- {
29140
- name: "beneficiary",
29141
- type: "core::starknet::contract_address::ContractAddress"
29142
- },
29143
- {
29144
- name: "integrator_fee_amount_bps",
29145
- type: "core::integer::u128"
29146
- },
29147
- {
29148
- name: "integrator_fee_recipient",
29149
- type: "core::starknet::contract_address::ContractAddress"
29150
- },
29151
- {
29152
- name: "routes",
29153
- type: "core::array::Array::<strkfarm_contracts::components::swap::Route>"
29154
- }
29155
- ]
29156
- },
29157
- {
29158
- type: "struct",
29159
- name: "contracts_private::strategies::yolo_vault::interface::YoloFeeSettings",
29160
- members: [
29161
- {
29162
- name: "swap_fee_bps",
29163
- type: "core::integer::u256"
29164
- },
29165
- {
29166
- name: "performance_fee_bps",
29167
- type: "core::integer::u256"
29168
- },
29169
- {
29170
- name: "fee_receiver",
29171
- type: "core::starknet::contract_address::ContractAddress"
29172
- }
29173
- ]
29174
- },
29175
- {
29176
- type: "struct",
29177
- name: "contracts_private::strategies::yolo_vault::interface::YoloVaultStatus",
29178
- members: [
29179
- {
29180
- name: "current_epoch",
29181
- type: "core::integer::u256"
29182
- },
29183
- {
29184
- name: "total_epochs",
29185
- type: "core::integer::u256"
29186
- },
29187
- {
29188
- name: "remaining_base",
29189
- type: "core::integer::u256"
29190
- },
29191
- {
29192
- name: "total_second_tokens",
29193
- type: "core::integer::u256"
29194
- },
29195
- {
29196
- name: "global_second_token_index",
29197
- type: "core::integer::u256"
29198
- },
29199
- {
29200
- name: "cumulative_spend_index",
29201
- type: "core::integer::u256"
29202
- },
29203
- {
29204
- name: "total_shares",
29205
- type: "core::integer::u256"
29206
- },
29207
- {
29208
- name: "base_token_assets_per_share",
29209
- type: "core::integer::u256"
29210
- }
29211
- ]
29212
- },
29213
- {
29214
- type: "struct",
29215
- name: "contracts_private::strategies::yolo_vault::interface::UserYoloInfo",
29216
- members: [
29217
- {
29218
- name: "shares",
29219
- type: "core::integer::u256"
29220
- },
29221
- {
29222
- name: "claimable_second_tokens",
29223
- type: "core::integer::u256"
29224
- },
29225
- {
29226
- name: "base_token_balance",
29227
- type: "core::integer::u256"
29228
- },
29229
- {
29230
- name: "base_token_consumed",
29231
- type: "core::integer::u256"
29232
- },
29233
- {
29234
- name: "base_consumed_last_index",
29235
- type: "core::integer::u256"
29236
- },
29237
- {
29238
- name: "second_token_last_index",
29239
- type: "core::integer::u256"
29240
- },
29241
- {
29242
- name: "second_token_balance",
29243
- type: "core::integer::u256"
29244
- }
29245
- ]
29246
- },
29247
- {
29248
- type: "struct",
29249
- name: "contracts_private::strategies::yolo_vault::interface::YoloSettings",
29250
- members: [
29251
- {
29252
- name: "base_token",
29253
- type: "core::starknet::contract_address::ContractAddress"
29254
- },
29255
- {
29256
- name: "second_token",
29257
- type: "core::starknet::contract_address::ContractAddress"
29258
- },
29259
- {
29260
- name: "total_epochs",
29261
- type: "core::integer::u256"
29262
- },
29263
- {
29264
- name: "min_time_per_epoch",
29265
- type: "core::integer::u64"
29266
- },
29267
- {
29268
- name: "max_spend_units_per_epoch",
29269
- type: "core::integer::u256"
29270
- },
29271
- {
29272
- name: "base_token_assets_per_share",
29273
- type: "core::integer::u256"
29274
- },
29275
- {
29276
- name: "oracle",
29277
- type: "core::starknet::contract_address::ContractAddress"
29278
- }
29279
- ]
29280
- },
29281
- {
29282
- type: "interface",
29283
- name: "contracts_private::strategies::yolo_vault::interface::IYoloVault",
29284
- items: [
29285
- {
29286
- type: "function",
29287
- name: "deposit",
29288
- inputs: [
29289
- {
29290
- name: "base_token_amount",
29291
- type: "core::integer::u256"
29292
- },
29293
- {
29294
- name: "receiver",
29295
- type: "core::starknet::contract_address::ContractAddress"
29296
- }
29297
- ],
29298
- outputs: [],
29299
- state_mutability: "external"
29300
- },
29301
- {
29302
- type: "function",
29303
- name: "redeem",
29304
- inputs: [
29305
- {
29306
- name: "shares",
29307
- type: "core::integer::u256"
29308
- },
29309
- {
29310
- name: "receiver",
29311
- type: "core::starknet::contract_address::ContractAddress"
29312
- }
29313
- ],
29314
- outputs: [],
29315
- state_mutability: "external"
29316
- },
29317
- {
29318
- type: "function",
29319
- name: "deposit_combined",
29320
- inputs: [
29321
- {
29322
- name: "underlying_amount",
29323
- type: "core::integer::u256"
29324
- },
29325
- {
29326
- name: "receiver",
29327
- type: "core::starknet::contract_address::ContractAddress"
29328
- }
29329
- ],
29330
- outputs: [],
29331
- state_mutability: "external"
29332
- },
29333
- {
29334
- type: "function",
29335
- name: "redeem_combined",
29336
- inputs: [
29337
- {
29338
- name: "shares",
29339
- type: "core::integer::u256"
29340
- },
29341
- {
29342
- name: "receiver",
29343
- type: "core::starknet::contract_address::ContractAddress"
29344
- }
29345
- ],
29346
- outputs: [],
29347
- state_mutability: "external"
29348
- },
29349
- {
29350
- type: "function",
29351
- name: "execute_swap",
29352
- inputs: [
29353
- {
29354
- name: "spend_units",
29355
- type: "core::integer::u256"
29356
- },
29357
- {
29358
- name: "swap_params",
29359
- type: "strkfarm_contracts::components::swap::AvnuMultiRouteSwap"
29360
- }
29361
- ],
29362
- outputs: [],
29363
- state_mutability: "external"
29364
- },
29365
- {
29366
- type: "function",
29367
- name: "update_fee_settings",
29368
- inputs: [
29369
- {
29370
- name: "new_settings",
29371
- type: "contracts_private::strategies::yolo_vault::interface::YoloFeeSettings"
29372
- }
29373
- ],
29374
- outputs: [],
29375
- state_mutability: "external"
29376
- },
29377
- {
29378
- type: "function",
29379
- name: "update_max_spend_units",
29380
- inputs: [
29381
- {
29382
- name: "new_max",
29383
- type: "core::integer::u256"
29384
- }
29385
- ],
29386
- outputs: [],
29387
- state_mutability: "external"
29388
- },
29389
- {
29390
- type: "function",
29391
- name: "get_swap_amounts",
29392
- inputs: [
29393
- {
29394
- name: "spend_units",
29395
- type: "core::integer::u256"
29396
- }
29397
- ],
29398
- outputs: [
29399
- {
29400
- type: "(core::integer::u256, core::integer::u256, core::bool)"
29401
- }
29402
- ],
29403
- state_mutability: "view"
29404
- },
29405
- {
29406
- type: "function",
29407
- name: "get_user_claimable_second_tokens",
29408
- inputs: [
29409
- {
29410
- name: "user",
29411
- type: "core::starknet::contract_address::ContractAddress"
29412
- }
29413
- ],
29414
- outputs: [
29415
- {
29416
- type: "core::integer::u256"
29417
- }
29418
- ],
29419
- state_mutability: "view"
29420
- },
29421
- {
29422
- type: "function",
29423
- name: "get_user_base_token_consumed",
29424
- inputs: [
29425
- {
29426
- name: "user",
29427
- type: "core::starknet::contract_address::ContractAddress"
29428
- }
29429
- ],
29430
- outputs: [
29431
- {
29432
- type: "core::integer::u256"
29433
- }
29434
- ],
29435
- state_mutability: "view"
29436
- },
29437
- {
29438
- type: "function",
29439
- name: "get_user_base_token_balance",
29440
- inputs: [
29441
- {
29442
- name: "user",
29443
- type: "core::starknet::contract_address::ContractAddress"
29444
- }
29445
- ],
29446
- outputs: [
29447
- {
29448
- type: "core::integer::u256"
29449
- }
29450
- ],
29451
- state_mutability: "view"
29452
- },
29453
- {
29454
- type: "function",
29455
- name: "get_vault_status",
29456
- inputs: [],
29457
- outputs: [
29458
- {
29459
- type: "contracts_private::strategies::yolo_vault::interface::YoloVaultStatus"
29460
- }
29461
- ],
29462
- state_mutability: "view"
29463
- },
29464
- {
29465
- type: "function",
29466
- name: "get_user_info",
29467
- inputs: [
29468
- {
29469
- name: "user",
29470
- type: "core::starknet::contract_address::ContractAddress"
29471
- }
29472
- ],
29473
- outputs: [
29474
- {
29475
- type: "contracts_private::strategies::yolo_vault::interface::UserYoloInfo"
29476
- }
29477
- ],
29478
- state_mutability: "view"
29479
- },
29480
- {
29481
- type: "function",
29482
- name: "get_settings",
29483
- inputs: [],
29484
- outputs: [
29485
- {
29486
- type: "contracts_private::strategies::yolo_vault::interface::YoloSettings"
29487
- }
29488
- ],
29489
- state_mutability: "view"
29490
- },
29491
- {
29492
- type: "function",
29493
- name: "get_fee_settings",
29494
- inputs: [],
29495
- outputs: [
29496
- {
29497
- type: "contracts_private::strategies::yolo_vault::interface::YoloFeeSettings"
29498
- }
29499
- ],
29500
- state_mutability: "view"
29501
- },
29502
- {
29503
- type: "function",
29504
- name: "get_shares_on_deposit",
29505
- inputs: [
29506
- {
29507
- name: "base_token_amount",
29508
- type: "core::integer::u256"
29509
- }
29510
- ],
29511
- outputs: [
29512
- {
29513
- type: "core::integer::u256"
29514
- }
29515
- ],
29516
- state_mutability: "view"
29517
- }
29518
- ]
29519
- },
29520
- {
29521
- type: "impl",
29522
- name: "CommonCompImpl",
29523
- interface_name: "strkfarm_contracts::interfaces::common::ICommon"
29524
- },
29525
- {
29526
- type: "interface",
29527
- name: "strkfarm_contracts::interfaces::common::ICommon",
29528
- items: [
29529
- {
29530
- type: "function",
29531
- name: "upgrade",
29532
- inputs: [
29533
- {
29534
- name: "new_class",
29535
- type: "core::starknet::class_hash::ClassHash"
29536
- }
29537
- ],
29538
- outputs: [],
29539
- state_mutability: "external"
29540
- },
29541
- {
29542
- type: "function",
29543
- name: "pause",
29544
- inputs: [],
29545
- outputs: [],
29546
- state_mutability: "external"
29547
- },
29548
- {
29549
- type: "function",
29550
- name: "unpause",
29551
- inputs: [],
29552
- outputs: [],
29553
- state_mutability: "external"
29554
- },
29555
- {
29556
- type: "function",
29557
- name: "is_paused",
29558
- inputs: [],
29559
- outputs: [
29560
- {
29561
- type: "core::bool"
29562
- }
29563
- ],
29564
- state_mutability: "view"
29565
- },
29566
- {
29567
- type: "function",
29568
- name: "access_control",
29569
- inputs: [],
29570
- outputs: [
29571
- {
29572
- type: "core::starknet::contract_address::ContractAddress"
29573
- }
29574
- ],
29575
- state_mutability: "view"
29576
- }
29577
- ]
29578
- },
29579
- {
29580
- type: "constructor",
29581
- name: "constructor",
29582
- inputs: [
29583
- {
29584
- name: "name",
29585
- type: "core::byte_array::ByteArray"
29586
- },
29587
- {
29588
- name: "symbol",
29589
- type: "core::byte_array::ByteArray"
29590
- },
29591
- {
29592
- name: "access_control",
29593
- type: "core::starknet::contract_address::ContractAddress"
29594
- },
29595
- {
29596
- name: "base_token",
29597
- type: "core::starknet::contract_address::ContractAddress"
29598
- },
29599
- {
29600
- name: "second_token",
29601
- type: "core::starknet::contract_address::ContractAddress"
29602
- },
29603
- {
29604
- name: "total_epochs",
29605
- type: "core::integer::u256"
29606
- },
29607
- {
29608
- name: "min_time_per_epoch",
29609
- type: "core::integer::u64"
29610
- },
29611
- {
29612
- name: "max_spend_units_per_epoch",
29613
- type: "core::integer::u256"
29614
- },
29615
- {
29616
- name: "base_token_assets_per_share",
29617
- type: "core::integer::u256"
29618
- },
29619
- {
29620
- name: "oracle",
29621
- type: "core::starknet::contract_address::ContractAddress"
29622
- },
29623
- {
29624
- name: "swap_fee_bps",
29625
- type: "core::integer::u256"
29626
- },
29627
- {
29628
- name: "performance_fee_bps",
29629
- type: "core::integer::u256"
29630
- },
29631
- {
29632
- name: "fee_receiver",
29633
- type: "core::starknet::contract_address::ContractAddress"
29634
- }
29635
- ]
29636
- },
29637
- {
29638
- type: "event",
29639
- name: "openzeppelin_security::reentrancyguard::ReentrancyGuardComponent::Event",
29640
- kind: "enum",
29641
- variants: []
29642
- },
29643
- {
29644
- type: "event",
29645
- name: "openzeppelin_token::erc20::erc20::ERC20Component::Transfer",
29646
- kind: "struct",
29647
- members: [
29648
- {
29649
- name: "from",
29650
- type: "core::starknet::contract_address::ContractAddress",
29651
- kind: "key"
29652
- },
29653
- {
29654
- name: "to",
29655
- type: "core::starknet::contract_address::ContractAddress",
29656
- kind: "key"
29657
- },
29658
- {
29659
- name: "value",
29660
- type: "core::integer::u256",
29661
- kind: "data"
29662
- }
29663
- ]
29664
- },
29665
- {
29666
- type: "event",
29667
- name: "openzeppelin_token::erc20::erc20::ERC20Component::Approval",
29668
- kind: "struct",
29669
- members: [
29670
- {
29671
- name: "owner",
29672
- type: "core::starknet::contract_address::ContractAddress",
29673
- kind: "key"
29674
- },
29675
- {
29676
- name: "spender",
29677
- type: "core::starknet::contract_address::ContractAddress",
29678
- kind: "key"
29679
- },
29680
- {
29681
- name: "value",
29682
- type: "core::integer::u256",
29683
- kind: "data"
29684
- }
29685
- ]
29686
- },
29687
- {
29688
- type: "event",
29689
- name: "openzeppelin_token::erc20::erc20::ERC20Component::Event",
29690
- kind: "enum",
29691
- variants: [
29692
- {
29693
- name: "Transfer",
29694
- type: "openzeppelin_token::erc20::erc20::ERC20Component::Transfer",
29695
- kind: "nested"
29696
- },
29697
- {
29698
- name: "Approval",
29699
- type: "openzeppelin_token::erc20::erc20::ERC20Component::Approval",
29700
- kind: "nested"
29701
- }
29702
- ]
29703
- },
29704
- {
29705
- type: "event",
29706
- name: "openzeppelin_introspection::src5::SRC5Component::Event",
29707
- kind: "enum",
29708
- variants: []
29709
- },
29710
- {
29711
- type: "event",
29712
- name: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
29713
- kind: "struct",
29714
- members: [
29715
- {
29716
- name: "class_hash",
29717
- type: "core::starknet::class_hash::ClassHash",
29718
- kind: "data"
29719
- }
29720
- ]
29721
- },
29722
- {
29723
- type: "event",
29724
- name: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
29725
- kind: "enum",
29726
- variants: [
29727
- {
29728
- name: "Upgraded",
29729
- type: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
29730
- kind: "nested"
29731
- }
29732
- ]
29733
- },
29734
- {
29735
- type: "event",
29736
- name: "openzeppelin_security::pausable::PausableComponent::Paused",
29737
- kind: "struct",
29738
- members: [
29739
- {
29740
- name: "account",
29741
- type: "core::starknet::contract_address::ContractAddress",
29742
- kind: "data"
29743
- }
29744
- ]
29745
- },
29746
- {
29747
- type: "event",
29748
- name: "openzeppelin_security::pausable::PausableComponent::Unpaused",
29749
- kind: "struct",
29750
- members: [
29751
- {
29752
- name: "account",
29753
- type: "core::starknet::contract_address::ContractAddress",
29754
- kind: "data"
29755
- }
29756
- ]
29757
- },
29758
- {
29759
- type: "event",
29760
- name: "openzeppelin_security::pausable::PausableComponent::Event",
29761
- kind: "enum",
29762
- variants: [
29763
- {
29764
- name: "Paused",
29765
- type: "openzeppelin_security::pausable::PausableComponent::Paused",
29766
- kind: "nested"
29767
- },
29768
- {
29769
- name: "Unpaused",
29770
- type: "openzeppelin_security::pausable::PausableComponent::Unpaused",
29771
- kind: "nested"
29772
- }
29773
- ]
29774
- },
29775
- {
29776
- type: "event",
29777
- name: "strkfarm_contracts::components::common::CommonComp::Event",
29778
- kind: "enum",
29779
- variants: []
29780
- },
29781
- {
29782
- type: "event",
29783
- name: "contracts_private::strategies::yolo_vault::interface::Deposit",
29784
- kind: "struct",
29785
- members: [
29786
- {
29787
- name: "user",
29788
- type: "core::starknet::contract_address::ContractAddress",
29789
- kind: "key"
29790
- },
29791
- {
29792
- name: "receiver",
29793
- type: "core::starknet::contract_address::ContractAddress",
29794
- kind: "data"
29795
- },
29796
- {
29797
- name: "base_amount",
29798
- type: "core::integer::u256",
29799
- kind: "data"
29800
- },
29801
- {
29802
- name: "shares",
29803
- type: "core::integer::u256",
29804
- kind: "data"
29805
- }
29806
- ]
29807
- },
29808
- {
29809
- type: "event",
29810
- name: "contracts_private::strategies::yolo_vault::interface::Redeem",
29811
- kind: "struct",
29812
- members: [
29813
- {
29814
- name: "user",
29815
- type: "core::starknet::contract_address::ContractAddress",
29816
- kind: "key"
29817
- },
29818
- {
29819
- name: "receiver",
29820
- type: "core::starknet::contract_address::ContractAddress",
29821
- kind: "data"
29822
- },
29823
- {
29824
- name: "shares",
29825
- type: "core::integer::u256",
29826
- kind: "data"
29827
- },
29828
- {
29829
- name: "base_out",
29830
- type: "core::integer::u256",
29831
- kind: "data"
29832
- },
29833
- {
29834
- name: "second_out",
29835
- type: "core::integer::u256",
29836
- kind: "data"
29837
- },
29838
- {
29839
- name: "performance_fee",
29840
- type: "core::integer::u256",
29841
- kind: "data"
29842
- }
29843
- ]
29844
- },
29845
- {
29846
- type: "event",
29847
- name: "contracts_private::strategies::yolo_vault::interface::SwapExecuted",
29848
- kind: "struct",
29849
- members: [
29850
- {
29851
- name: "epoch",
29852
- type: "core::integer::u256",
29853
- kind: "data"
29854
- },
29855
- {
29856
- name: "spend_units",
29857
- type: "core::integer::u256",
29858
- kind: "data"
29859
- },
29860
- {
29861
- name: "gross_spend",
29862
- type: "core::integer::u256",
29863
- kind: "data"
29864
- },
29865
- {
29866
- name: "swap_fee",
29867
- type: "core::integer::u256",
29868
- kind: "data"
29869
- },
29870
- {
29871
- name: "net_spend",
29872
- type: "core::integer::u256",
29873
- kind: "data"
29874
- },
29875
- {
29876
- name: "second_tokens_acquired",
29877
- type: "core::integer::u256",
29878
- kind: "data"
29879
- },
29880
- {
29881
- name: "new_global_index",
29882
- type: "core::integer::u256",
29883
- kind: "data"
29884
- },
29885
- {
29886
- name: "cumulative_spend_index",
29887
- type: "core::integer::u256",
29888
- kind: "data"
29889
- }
29890
- ]
29891
- },
29892
- {
29893
- type: "event",
29894
- name: "contracts_private::strategies::yolo_vault::interface::FeeSettingsUpdated",
29895
- kind: "struct",
29896
- members: [
29897
- {
29898
- name: "swap_fee_bps",
29899
- type: "core::integer::u256",
29900
- kind: "data"
29901
- },
29902
- {
29903
- name: "performance_fee_bps",
29904
- type: "core::integer::u256",
29905
- kind: "data"
29906
- },
29907
- {
29908
- name: "fee_receiver",
29909
- type: "core::starknet::contract_address::ContractAddress",
29910
- kind: "data"
29911
- }
29912
- ]
29913
- },
29914
- {
29915
- type: "event",
29916
- name: "contracts_private::strategies::yolo_vault::yolo_vault::YoloVault::Event",
29917
- kind: "enum",
29918
- variants: [
29919
- {
29920
- name: "ReentrancyGuardEvent",
29921
- type: "openzeppelin_security::reentrancyguard::ReentrancyGuardComponent::Event",
29922
- kind: "flat"
29923
- },
29924
- {
29925
- name: "ERC20Event",
29926
- type: "openzeppelin_token::erc20::erc20::ERC20Component::Event",
29927
- kind: "flat"
29928
- },
29929
- {
29930
- name: "SRC5Event",
29931
- type: "openzeppelin_introspection::src5::SRC5Component::Event",
29932
- kind: "flat"
29933
- },
29934
- {
29935
- name: "UpgradeableEvent",
29936
- type: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
29937
- kind: "flat"
29938
- },
29939
- {
29940
- name: "PausableEvent",
29941
- type: "openzeppelin_security::pausable::PausableComponent::Event",
29942
- kind: "flat"
29943
- },
29944
- {
29945
- name: "CommonCompEvent",
29946
- type: "strkfarm_contracts::components::common::CommonComp::Event",
29947
- kind: "flat"
29948
- },
29949
- {
29950
- name: "Deposit",
29951
- type: "contracts_private::strategies::yolo_vault::interface::Deposit",
29952
- kind: "nested"
29953
- },
29954
- {
29955
- name: "Redeem",
29956
- type: "contracts_private::strategies::yolo_vault::interface::Redeem",
29957
- kind: "nested"
29958
- },
29959
- {
29960
- name: "SwapExecuted",
29961
- type: "contracts_private::strategies::yolo_vault::interface::SwapExecuted",
29962
- kind: "nested"
29963
- },
29964
- {
29965
- name: "FeeSettingsUpdated",
29966
- type: "contracts_private::strategies::yolo_vault::interface::FeeSettingsUpdated",
29967
- kind: "nested"
29968
- }
29969
- ]
29970
- }
29971
- ];
29972
-
29973
- // src/strategies/yoloVault.ts
29974
28829
  var import_react = require("react");
29975
28830
  var YoLoVault = class extends BaseStrategy {
29976
28831
  constructor(config, pricer, metadata) {
@@ -29979,17 +28834,19 @@ var YoLoVault = class extends BaseStrategy {
29979
28834
  withdrawInputMode: "dual"
29980
28835
  });
29981
28836
  this.getSettings = async () => {
29982
- const settings = await this.contract.call("get_settings", []);
28837
+ const settings = await (await this.contract).call("get_settings", []);
29983
28838
  return settings;
29984
28839
  };
29985
28840
  this.address = metadata.address;
29986
28841
  this.pricer = pricer;
29987
28842
  this.metadata = metadata;
29988
- this.contract = new import_starknet21.Contract({
29989
- abi: yoloVault_abi_default,
29990
- address: this.address.address,
29991
- providerOrAccount: this.config.provider
29992
- });
28843
+ this.contract = this.config.provider.getClassAt(this.address.address).then(
28844
+ (cls) => new import_starknet21.Contract({
28845
+ abi: cls.abi,
28846
+ address: this.address.address,
28847
+ providerOrAccount: this.config.provider
28848
+ })
28849
+ );
29993
28850
  if (metadata.depositTokens.length < 1) {
29994
28851
  throw new Error("Deposit tokens are not fully defined in metadata");
29995
28852
  }
@@ -30003,9 +28860,11 @@ var YoLoVault = class extends BaseStrategy {
30003
28860
  secondUnderlying: ai.secondUnderlying
30004
28861
  };
30005
28862
  }
28863
+ /** Underlying (or base token) used for pricing / swap sell leg when base is ERC-4626. */
30006
28864
  tokenForPrimaryPricing() {
30007
28865
  return this.erc4626.isBaseERC4626 && this.erc4626.baseUnderlying ? this.erc4626.baseUnderlying : this.primaryToken;
30008
28866
  }
28867
+ /** Underlying (or second token) for price ratios when second leg is ERC-4626 (e.g. STRK for xSTRK). */
30009
28868
  tokenForSecondaryPricing() {
30010
28869
  return this.erc4626.isSecondERC4626 && this.erc4626.secondUnderlying ? this.erc4626.secondUnderlying : this.secondaryToken;
30011
28870
  }
@@ -30033,7 +28892,7 @@ var YoLoVault = class extends BaseStrategy {
30033
28892
  // return formattedAmount;
30034
28893
  // }
30035
28894
  async getNormalizedUserInfo(user, blockIdentifier = "latest") {
30036
- const userInfo = await this.contract.call("get_user_info", [user.address], {
28895
+ const userInfo = await (await this.contract).call("get_user_info", [user.address], {
30037
28896
  blockIdentifier
30038
28897
  });
30039
28898
  const {
@@ -30275,6 +29134,7 @@ var YoLoVault = class extends BaseStrategy {
30275
29134
  }
30276
29135
  async depositCall(amountInfo, receiver) {
30277
29136
  try {
29137
+ const vault = await this.contract;
30278
29138
  if (this.erc4626.isBaseERC4626) {
30279
29139
  if (!this.erc4626.baseUnderlying) {
30280
29140
  throw new Error("baseUnderlying missing for ERC-4626 base YOLO vault");
@@ -30284,7 +29144,7 @@ var YoLoVault = class extends BaseStrategy {
30284
29144
  this.address.address,
30285
29145
  amountInfo.amount
30286
29146
  );
30287
- const depositCall2 = this.contract.populate("deposit_combined", [
29147
+ const depositCall2 = vault.populate("deposit_combined", [
30288
29148
  import_starknet20.uint256.bnToUint256(amountInfo.amount.toWei()),
30289
29149
  receiver.address
30290
29150
  ]);
@@ -30292,7 +29152,7 @@ var YoLoVault = class extends BaseStrategy {
30292
29152
  }
30293
29153
  const primaryToken = amountInfo.tokenInfo;
30294
29154
  const approvalCall = new ERC20(this.config).approve(primaryToken.address.address, this.address.address, amountInfo.amount);
30295
- const depositCall = this.contract.populate("deposit", [
29155
+ const depositCall = vault.populate("deposit", [
30296
29156
  import_starknet20.uint256.bnToUint256(amountInfo.amount.toWei()),
30297
29157
  receiver.address
30298
29158
  ]);
@@ -30303,7 +29163,7 @@ var YoLoVault = class extends BaseStrategy {
30303
29163
  }
30304
29164
  }
30305
29165
  async getVaultStatus() {
30306
- const vaultStatus = await this.contract.call("get_vault_status", []);
29166
+ const vaultStatus = await (await this.contract).call("get_vault_status", []);
30307
29167
  return vaultStatus;
30308
29168
  }
30309
29169
  async matchInputAmounts(amountInfo, user) {
@@ -30367,7 +29227,8 @@ var YoLoVault = class extends BaseStrategy {
30367
29227
  }
30368
29228
  const requiredShares = userShares.multipliedBy(withdrawRequest.sharesUsedFactor).floor();
30369
29229
  const redeemFn = this.erc4626.isBaseERC4626 ? "redeem_combined" : "redeem";
30370
- let withdrawCall = this.contract.populate(redeemFn, [
29230
+ const vault = await this.contract;
29231
+ let withdrawCall = vault.populate(redeemFn, [
30371
29232
  import_starknet20.uint256.bnToUint256(requiredShares.toString()),
30372
29233
  receiver.address
30373
29234
  ]);
@@ -30381,7 +29242,7 @@ var YoLoVault = class extends BaseStrategy {
30381
29242
  return "\u{1F919}YOLO";
30382
29243
  }
30383
29244
  async getSwapAmounts(spendUnits) {
30384
- const swapAmounts = await this.contract.call("get_swap_amounts", [spendUnits.toUint256()]);
29245
+ const swapAmounts = await (await this.contract).call("get_swap_amounts", [spendUnits.toUint256()]);
30385
29246
  console.log("swapAmounts", swapAmounts);
30386
29247
  return {
30387
29248
  grossSpend: Web3Number.fromWei(swapAmounts[0].toString(), this.primaryToken.decimals),