@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.
@@ -28686,1151 +28686,6 @@ var SenseiStrategies = [
28686
28686
  // src/strategies/yoloVault.ts
28687
28687
  import { uint256 as uint25610 } from "starknet";
28688
28688
  import { Contract as Contract10 } from "starknet";
28689
-
28690
- // src/data/yoloVault.abi.json
28691
- var yoloVault_abi_default = [
28692
- {
28693
- type: "impl",
28694
- name: "YoloERC20Impl",
28695
- interface_name: "openzeppelin_token::erc20::interface::IERC20Mixin"
28696
- },
28697
- {
28698
- type: "struct",
28699
- name: "core::integer::u256",
28700
- members: [
28701
- {
28702
- name: "low",
28703
- type: "core::integer::u128"
28704
- },
28705
- {
28706
- name: "high",
28707
- type: "core::integer::u128"
28708
- }
28709
- ]
28710
- },
28711
- {
28712
- type: "enum",
28713
- name: "core::bool",
28714
- variants: [
28715
- {
28716
- name: "False",
28717
- type: "()"
28718
- },
28719
- {
28720
- name: "True",
28721
- type: "()"
28722
- }
28723
- ]
28724
- },
28725
- {
28726
- type: "struct",
28727
- name: "core::byte_array::ByteArray",
28728
- members: [
28729
- {
28730
- name: "data",
28731
- type: "core::array::Array::<core::bytes_31::bytes31>"
28732
- },
28733
- {
28734
- name: "pending_word",
28735
- type: "core::felt252"
28736
- },
28737
- {
28738
- name: "pending_word_len",
28739
- type: "core::integer::u32"
28740
- }
28741
- ]
28742
- },
28743
- {
28744
- type: "interface",
28745
- name: "openzeppelin_token::erc20::interface::IERC20Mixin",
28746
- items: [
28747
- {
28748
- type: "function",
28749
- name: "total_supply",
28750
- inputs: [],
28751
- outputs: [
28752
- {
28753
- type: "core::integer::u256"
28754
- }
28755
- ],
28756
- state_mutability: "view"
28757
- },
28758
- {
28759
- type: "function",
28760
- name: "balance_of",
28761
- inputs: [
28762
- {
28763
- name: "account",
28764
- type: "core::starknet::contract_address::ContractAddress"
28765
- }
28766
- ],
28767
- outputs: [
28768
- {
28769
- type: "core::integer::u256"
28770
- }
28771
- ],
28772
- state_mutability: "view"
28773
- },
28774
- {
28775
- type: "function",
28776
- name: "allowance",
28777
- inputs: [
28778
- {
28779
- name: "owner",
28780
- type: "core::starknet::contract_address::ContractAddress"
28781
- },
28782
- {
28783
- name: "spender",
28784
- type: "core::starknet::contract_address::ContractAddress"
28785
- }
28786
- ],
28787
- outputs: [
28788
- {
28789
- type: "core::integer::u256"
28790
- }
28791
- ],
28792
- state_mutability: "view"
28793
- },
28794
- {
28795
- type: "function",
28796
- name: "transfer",
28797
- inputs: [
28798
- {
28799
- name: "recipient",
28800
- type: "core::starknet::contract_address::ContractAddress"
28801
- },
28802
- {
28803
- name: "amount",
28804
- type: "core::integer::u256"
28805
- }
28806
- ],
28807
- outputs: [
28808
- {
28809
- type: "core::bool"
28810
- }
28811
- ],
28812
- state_mutability: "external"
28813
- },
28814
- {
28815
- type: "function",
28816
- name: "transfer_from",
28817
- inputs: [
28818
- {
28819
- name: "sender",
28820
- type: "core::starknet::contract_address::ContractAddress"
28821
- },
28822
- {
28823
- name: "recipient",
28824
- type: "core::starknet::contract_address::ContractAddress"
28825
- },
28826
- {
28827
- name: "amount",
28828
- type: "core::integer::u256"
28829
- }
28830
- ],
28831
- outputs: [
28832
- {
28833
- type: "core::bool"
28834
- }
28835
- ],
28836
- state_mutability: "external"
28837
- },
28838
- {
28839
- type: "function",
28840
- name: "approve",
28841
- inputs: [
28842
- {
28843
- name: "spender",
28844
- type: "core::starknet::contract_address::ContractAddress"
28845
- },
28846
- {
28847
- name: "amount",
28848
- type: "core::integer::u256"
28849
- }
28850
- ],
28851
- outputs: [
28852
- {
28853
- type: "core::bool"
28854
- }
28855
- ],
28856
- state_mutability: "external"
28857
- },
28858
- {
28859
- type: "function",
28860
- name: "name",
28861
- inputs: [],
28862
- outputs: [
28863
- {
28864
- type: "core::byte_array::ByteArray"
28865
- }
28866
- ],
28867
- state_mutability: "view"
28868
- },
28869
- {
28870
- type: "function",
28871
- name: "symbol",
28872
- inputs: [],
28873
- outputs: [
28874
- {
28875
- type: "core::byte_array::ByteArray"
28876
- }
28877
- ],
28878
- state_mutability: "view"
28879
- },
28880
- {
28881
- type: "function",
28882
- name: "decimals",
28883
- inputs: [],
28884
- outputs: [
28885
- {
28886
- type: "core::integer::u8"
28887
- }
28888
- ],
28889
- state_mutability: "view"
28890
- },
28891
- {
28892
- type: "function",
28893
- name: "totalSupply",
28894
- inputs: [],
28895
- outputs: [
28896
- {
28897
- type: "core::integer::u256"
28898
- }
28899
- ],
28900
- state_mutability: "view"
28901
- },
28902
- {
28903
- type: "function",
28904
- name: "balanceOf",
28905
- inputs: [
28906
- {
28907
- name: "account",
28908
- type: "core::starknet::contract_address::ContractAddress"
28909
- }
28910
- ],
28911
- outputs: [
28912
- {
28913
- type: "core::integer::u256"
28914
- }
28915
- ],
28916
- state_mutability: "view"
28917
- },
28918
- {
28919
- type: "function",
28920
- name: "transferFrom",
28921
- inputs: [
28922
- {
28923
- name: "sender",
28924
- type: "core::starknet::contract_address::ContractAddress"
28925
- },
28926
- {
28927
- name: "recipient",
28928
- type: "core::starknet::contract_address::ContractAddress"
28929
- },
28930
- {
28931
- name: "amount",
28932
- type: "core::integer::u256"
28933
- }
28934
- ],
28935
- outputs: [
28936
- {
28937
- type: "core::bool"
28938
- }
28939
- ],
28940
- state_mutability: "external"
28941
- }
28942
- ]
28943
- },
28944
- {
28945
- type: "impl",
28946
- name: "YoloVaultImpl",
28947
- interface_name: "contracts_private::strategies::yolo_vault::interface::IYoloVault"
28948
- },
28949
- {
28950
- type: "struct",
28951
- name: "strkfarm_contracts::components::swap::Route",
28952
- members: [
28953
- {
28954
- name: "token_from",
28955
- type: "core::starknet::contract_address::ContractAddress"
28956
- },
28957
- {
28958
- name: "token_to",
28959
- type: "core::starknet::contract_address::ContractAddress"
28960
- },
28961
- {
28962
- name: "exchange_address",
28963
- type: "core::starknet::contract_address::ContractAddress"
28964
- },
28965
- {
28966
- name: "percent",
28967
- type: "core::integer::u128"
28968
- },
28969
- {
28970
- name: "additional_swap_params",
28971
- type: "core::array::Array::<core::felt252>"
28972
- }
28973
- ]
28974
- },
28975
- {
28976
- type: "struct",
28977
- name: "strkfarm_contracts::components::swap::AvnuMultiRouteSwap",
28978
- members: [
28979
- {
28980
- name: "token_from_address",
28981
- type: "core::starknet::contract_address::ContractAddress"
28982
- },
28983
- {
28984
- name: "token_from_amount",
28985
- type: "core::integer::u256"
28986
- },
28987
- {
28988
- name: "token_to_address",
28989
- type: "core::starknet::contract_address::ContractAddress"
28990
- },
28991
- {
28992
- name: "token_to_amount",
28993
- type: "core::integer::u256"
28994
- },
28995
- {
28996
- name: "token_to_min_amount",
28997
- type: "core::integer::u256"
28998
- },
28999
- {
29000
- name: "beneficiary",
29001
- type: "core::starknet::contract_address::ContractAddress"
29002
- },
29003
- {
29004
- name: "integrator_fee_amount_bps",
29005
- type: "core::integer::u128"
29006
- },
29007
- {
29008
- name: "integrator_fee_recipient",
29009
- type: "core::starknet::contract_address::ContractAddress"
29010
- },
29011
- {
29012
- name: "routes",
29013
- type: "core::array::Array::<strkfarm_contracts::components::swap::Route>"
29014
- }
29015
- ]
29016
- },
29017
- {
29018
- type: "struct",
29019
- name: "contracts_private::strategies::yolo_vault::interface::YoloFeeSettings",
29020
- members: [
29021
- {
29022
- name: "swap_fee_bps",
29023
- type: "core::integer::u256"
29024
- },
29025
- {
29026
- name: "performance_fee_bps",
29027
- type: "core::integer::u256"
29028
- },
29029
- {
29030
- name: "fee_receiver",
29031
- type: "core::starknet::contract_address::ContractAddress"
29032
- }
29033
- ]
29034
- },
29035
- {
29036
- type: "struct",
29037
- name: "contracts_private::strategies::yolo_vault::interface::YoloVaultStatus",
29038
- members: [
29039
- {
29040
- name: "current_epoch",
29041
- type: "core::integer::u256"
29042
- },
29043
- {
29044
- name: "total_epochs",
29045
- type: "core::integer::u256"
29046
- },
29047
- {
29048
- name: "remaining_base",
29049
- type: "core::integer::u256"
29050
- },
29051
- {
29052
- name: "total_second_tokens",
29053
- type: "core::integer::u256"
29054
- },
29055
- {
29056
- name: "global_second_token_index",
29057
- type: "core::integer::u256"
29058
- },
29059
- {
29060
- name: "cumulative_spend_index",
29061
- type: "core::integer::u256"
29062
- },
29063
- {
29064
- name: "total_shares",
29065
- type: "core::integer::u256"
29066
- },
29067
- {
29068
- name: "base_token_assets_per_share",
29069
- type: "core::integer::u256"
29070
- }
29071
- ]
29072
- },
29073
- {
29074
- type: "struct",
29075
- name: "contracts_private::strategies::yolo_vault::interface::UserYoloInfo",
29076
- members: [
29077
- {
29078
- name: "shares",
29079
- type: "core::integer::u256"
29080
- },
29081
- {
29082
- name: "claimable_second_tokens",
29083
- type: "core::integer::u256"
29084
- },
29085
- {
29086
- name: "base_token_balance",
29087
- type: "core::integer::u256"
29088
- },
29089
- {
29090
- name: "base_token_consumed",
29091
- type: "core::integer::u256"
29092
- },
29093
- {
29094
- name: "base_consumed_last_index",
29095
- type: "core::integer::u256"
29096
- },
29097
- {
29098
- name: "second_token_last_index",
29099
- type: "core::integer::u256"
29100
- },
29101
- {
29102
- name: "second_token_balance",
29103
- type: "core::integer::u256"
29104
- }
29105
- ]
29106
- },
29107
- {
29108
- type: "struct",
29109
- name: "contracts_private::strategies::yolo_vault::interface::YoloSettings",
29110
- members: [
29111
- {
29112
- name: "base_token",
29113
- type: "core::starknet::contract_address::ContractAddress"
29114
- },
29115
- {
29116
- name: "second_token",
29117
- type: "core::starknet::contract_address::ContractAddress"
29118
- },
29119
- {
29120
- name: "total_epochs",
29121
- type: "core::integer::u256"
29122
- },
29123
- {
29124
- name: "min_time_per_epoch",
29125
- type: "core::integer::u64"
29126
- },
29127
- {
29128
- name: "max_spend_units_per_epoch",
29129
- type: "core::integer::u256"
29130
- },
29131
- {
29132
- name: "base_token_assets_per_share",
29133
- type: "core::integer::u256"
29134
- },
29135
- {
29136
- name: "oracle",
29137
- type: "core::starknet::contract_address::ContractAddress"
29138
- }
29139
- ]
29140
- },
29141
- {
29142
- type: "interface",
29143
- name: "contracts_private::strategies::yolo_vault::interface::IYoloVault",
29144
- items: [
29145
- {
29146
- type: "function",
29147
- name: "deposit",
29148
- inputs: [
29149
- {
29150
- name: "base_token_amount",
29151
- type: "core::integer::u256"
29152
- },
29153
- {
29154
- name: "receiver",
29155
- type: "core::starknet::contract_address::ContractAddress"
29156
- }
29157
- ],
29158
- outputs: [],
29159
- state_mutability: "external"
29160
- },
29161
- {
29162
- type: "function",
29163
- name: "redeem",
29164
- inputs: [
29165
- {
29166
- name: "shares",
29167
- type: "core::integer::u256"
29168
- },
29169
- {
29170
- name: "receiver",
29171
- type: "core::starknet::contract_address::ContractAddress"
29172
- }
29173
- ],
29174
- outputs: [],
29175
- state_mutability: "external"
29176
- },
29177
- {
29178
- type: "function",
29179
- name: "deposit_combined",
29180
- inputs: [
29181
- {
29182
- name: "underlying_amount",
29183
- type: "core::integer::u256"
29184
- },
29185
- {
29186
- name: "receiver",
29187
- type: "core::starknet::contract_address::ContractAddress"
29188
- }
29189
- ],
29190
- outputs: [],
29191
- state_mutability: "external"
29192
- },
29193
- {
29194
- type: "function",
29195
- name: "redeem_combined",
29196
- inputs: [
29197
- {
29198
- name: "shares",
29199
- type: "core::integer::u256"
29200
- },
29201
- {
29202
- name: "receiver",
29203
- type: "core::starknet::contract_address::ContractAddress"
29204
- }
29205
- ],
29206
- outputs: [],
29207
- state_mutability: "external"
29208
- },
29209
- {
29210
- type: "function",
29211
- name: "execute_swap",
29212
- inputs: [
29213
- {
29214
- name: "spend_units",
29215
- type: "core::integer::u256"
29216
- },
29217
- {
29218
- name: "swap_params",
29219
- type: "strkfarm_contracts::components::swap::AvnuMultiRouteSwap"
29220
- }
29221
- ],
29222
- outputs: [],
29223
- state_mutability: "external"
29224
- },
29225
- {
29226
- type: "function",
29227
- name: "update_fee_settings",
29228
- inputs: [
29229
- {
29230
- name: "new_settings",
29231
- type: "contracts_private::strategies::yolo_vault::interface::YoloFeeSettings"
29232
- }
29233
- ],
29234
- outputs: [],
29235
- state_mutability: "external"
29236
- },
29237
- {
29238
- type: "function",
29239
- name: "update_max_spend_units",
29240
- inputs: [
29241
- {
29242
- name: "new_max",
29243
- type: "core::integer::u256"
29244
- }
29245
- ],
29246
- outputs: [],
29247
- state_mutability: "external"
29248
- },
29249
- {
29250
- type: "function",
29251
- name: "get_swap_amounts",
29252
- inputs: [
29253
- {
29254
- name: "spend_units",
29255
- type: "core::integer::u256"
29256
- }
29257
- ],
29258
- outputs: [
29259
- {
29260
- type: "(core::integer::u256, core::integer::u256, core::bool)"
29261
- }
29262
- ],
29263
- state_mutability: "view"
29264
- },
29265
- {
29266
- type: "function",
29267
- name: "get_user_claimable_second_tokens",
29268
- inputs: [
29269
- {
29270
- name: "user",
29271
- type: "core::starknet::contract_address::ContractAddress"
29272
- }
29273
- ],
29274
- outputs: [
29275
- {
29276
- type: "core::integer::u256"
29277
- }
29278
- ],
29279
- state_mutability: "view"
29280
- },
29281
- {
29282
- type: "function",
29283
- name: "get_user_base_token_consumed",
29284
- inputs: [
29285
- {
29286
- name: "user",
29287
- type: "core::starknet::contract_address::ContractAddress"
29288
- }
29289
- ],
29290
- outputs: [
29291
- {
29292
- type: "core::integer::u256"
29293
- }
29294
- ],
29295
- state_mutability: "view"
29296
- },
29297
- {
29298
- type: "function",
29299
- name: "get_user_base_token_balance",
29300
- inputs: [
29301
- {
29302
- name: "user",
29303
- type: "core::starknet::contract_address::ContractAddress"
29304
- }
29305
- ],
29306
- outputs: [
29307
- {
29308
- type: "core::integer::u256"
29309
- }
29310
- ],
29311
- state_mutability: "view"
29312
- },
29313
- {
29314
- type: "function",
29315
- name: "get_vault_status",
29316
- inputs: [],
29317
- outputs: [
29318
- {
29319
- type: "contracts_private::strategies::yolo_vault::interface::YoloVaultStatus"
29320
- }
29321
- ],
29322
- state_mutability: "view"
29323
- },
29324
- {
29325
- type: "function",
29326
- name: "get_user_info",
29327
- inputs: [
29328
- {
29329
- name: "user",
29330
- type: "core::starknet::contract_address::ContractAddress"
29331
- }
29332
- ],
29333
- outputs: [
29334
- {
29335
- type: "contracts_private::strategies::yolo_vault::interface::UserYoloInfo"
29336
- }
29337
- ],
29338
- state_mutability: "view"
29339
- },
29340
- {
29341
- type: "function",
29342
- name: "get_settings",
29343
- inputs: [],
29344
- outputs: [
29345
- {
29346
- type: "contracts_private::strategies::yolo_vault::interface::YoloSettings"
29347
- }
29348
- ],
29349
- state_mutability: "view"
29350
- },
29351
- {
29352
- type: "function",
29353
- name: "get_fee_settings",
29354
- inputs: [],
29355
- outputs: [
29356
- {
29357
- type: "contracts_private::strategies::yolo_vault::interface::YoloFeeSettings"
29358
- }
29359
- ],
29360
- state_mutability: "view"
29361
- },
29362
- {
29363
- type: "function",
29364
- name: "get_shares_on_deposit",
29365
- inputs: [
29366
- {
29367
- name: "base_token_amount",
29368
- type: "core::integer::u256"
29369
- }
29370
- ],
29371
- outputs: [
29372
- {
29373
- type: "core::integer::u256"
29374
- }
29375
- ],
29376
- state_mutability: "view"
29377
- }
29378
- ]
29379
- },
29380
- {
29381
- type: "impl",
29382
- name: "CommonCompImpl",
29383
- interface_name: "strkfarm_contracts::interfaces::common::ICommon"
29384
- },
29385
- {
29386
- type: "interface",
29387
- name: "strkfarm_contracts::interfaces::common::ICommon",
29388
- items: [
29389
- {
29390
- type: "function",
29391
- name: "upgrade",
29392
- inputs: [
29393
- {
29394
- name: "new_class",
29395
- type: "core::starknet::class_hash::ClassHash"
29396
- }
29397
- ],
29398
- outputs: [],
29399
- state_mutability: "external"
29400
- },
29401
- {
29402
- type: "function",
29403
- name: "pause",
29404
- inputs: [],
29405
- outputs: [],
29406
- state_mutability: "external"
29407
- },
29408
- {
29409
- type: "function",
29410
- name: "unpause",
29411
- inputs: [],
29412
- outputs: [],
29413
- state_mutability: "external"
29414
- },
29415
- {
29416
- type: "function",
29417
- name: "is_paused",
29418
- inputs: [],
29419
- outputs: [
29420
- {
29421
- type: "core::bool"
29422
- }
29423
- ],
29424
- state_mutability: "view"
29425
- },
29426
- {
29427
- type: "function",
29428
- name: "access_control",
29429
- inputs: [],
29430
- outputs: [
29431
- {
29432
- type: "core::starknet::contract_address::ContractAddress"
29433
- }
29434
- ],
29435
- state_mutability: "view"
29436
- }
29437
- ]
29438
- },
29439
- {
29440
- type: "constructor",
29441
- name: "constructor",
29442
- inputs: [
29443
- {
29444
- name: "name",
29445
- type: "core::byte_array::ByteArray"
29446
- },
29447
- {
29448
- name: "symbol",
29449
- type: "core::byte_array::ByteArray"
29450
- },
29451
- {
29452
- name: "access_control",
29453
- type: "core::starknet::contract_address::ContractAddress"
29454
- },
29455
- {
29456
- name: "base_token",
29457
- type: "core::starknet::contract_address::ContractAddress"
29458
- },
29459
- {
29460
- name: "second_token",
29461
- type: "core::starknet::contract_address::ContractAddress"
29462
- },
29463
- {
29464
- name: "total_epochs",
29465
- type: "core::integer::u256"
29466
- },
29467
- {
29468
- name: "min_time_per_epoch",
29469
- type: "core::integer::u64"
29470
- },
29471
- {
29472
- name: "max_spend_units_per_epoch",
29473
- type: "core::integer::u256"
29474
- },
29475
- {
29476
- name: "base_token_assets_per_share",
29477
- type: "core::integer::u256"
29478
- },
29479
- {
29480
- name: "oracle",
29481
- type: "core::starknet::contract_address::ContractAddress"
29482
- },
29483
- {
29484
- name: "swap_fee_bps",
29485
- type: "core::integer::u256"
29486
- },
29487
- {
29488
- name: "performance_fee_bps",
29489
- type: "core::integer::u256"
29490
- },
29491
- {
29492
- name: "fee_receiver",
29493
- type: "core::starknet::contract_address::ContractAddress"
29494
- }
29495
- ]
29496
- },
29497
- {
29498
- type: "event",
29499
- name: "openzeppelin_security::reentrancyguard::ReentrancyGuardComponent::Event",
29500
- kind: "enum",
29501
- variants: []
29502
- },
29503
- {
29504
- type: "event",
29505
- name: "openzeppelin_token::erc20::erc20::ERC20Component::Transfer",
29506
- kind: "struct",
29507
- members: [
29508
- {
29509
- name: "from",
29510
- type: "core::starknet::contract_address::ContractAddress",
29511
- kind: "key"
29512
- },
29513
- {
29514
- name: "to",
29515
- type: "core::starknet::contract_address::ContractAddress",
29516
- kind: "key"
29517
- },
29518
- {
29519
- name: "value",
29520
- type: "core::integer::u256",
29521
- kind: "data"
29522
- }
29523
- ]
29524
- },
29525
- {
29526
- type: "event",
29527
- name: "openzeppelin_token::erc20::erc20::ERC20Component::Approval",
29528
- kind: "struct",
29529
- members: [
29530
- {
29531
- name: "owner",
29532
- type: "core::starknet::contract_address::ContractAddress",
29533
- kind: "key"
29534
- },
29535
- {
29536
- name: "spender",
29537
- type: "core::starknet::contract_address::ContractAddress",
29538
- kind: "key"
29539
- },
29540
- {
29541
- name: "value",
29542
- type: "core::integer::u256",
29543
- kind: "data"
29544
- }
29545
- ]
29546
- },
29547
- {
29548
- type: "event",
29549
- name: "openzeppelin_token::erc20::erc20::ERC20Component::Event",
29550
- kind: "enum",
29551
- variants: [
29552
- {
29553
- name: "Transfer",
29554
- type: "openzeppelin_token::erc20::erc20::ERC20Component::Transfer",
29555
- kind: "nested"
29556
- },
29557
- {
29558
- name: "Approval",
29559
- type: "openzeppelin_token::erc20::erc20::ERC20Component::Approval",
29560
- kind: "nested"
29561
- }
29562
- ]
29563
- },
29564
- {
29565
- type: "event",
29566
- name: "openzeppelin_introspection::src5::SRC5Component::Event",
29567
- kind: "enum",
29568
- variants: []
29569
- },
29570
- {
29571
- type: "event",
29572
- name: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
29573
- kind: "struct",
29574
- members: [
29575
- {
29576
- name: "class_hash",
29577
- type: "core::starknet::class_hash::ClassHash",
29578
- kind: "data"
29579
- }
29580
- ]
29581
- },
29582
- {
29583
- type: "event",
29584
- name: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
29585
- kind: "enum",
29586
- variants: [
29587
- {
29588
- name: "Upgraded",
29589
- type: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
29590
- kind: "nested"
29591
- }
29592
- ]
29593
- },
29594
- {
29595
- type: "event",
29596
- name: "openzeppelin_security::pausable::PausableComponent::Paused",
29597
- kind: "struct",
29598
- members: [
29599
- {
29600
- name: "account",
29601
- type: "core::starknet::contract_address::ContractAddress",
29602
- kind: "data"
29603
- }
29604
- ]
29605
- },
29606
- {
29607
- type: "event",
29608
- name: "openzeppelin_security::pausable::PausableComponent::Unpaused",
29609
- kind: "struct",
29610
- members: [
29611
- {
29612
- name: "account",
29613
- type: "core::starknet::contract_address::ContractAddress",
29614
- kind: "data"
29615
- }
29616
- ]
29617
- },
29618
- {
29619
- type: "event",
29620
- name: "openzeppelin_security::pausable::PausableComponent::Event",
29621
- kind: "enum",
29622
- variants: [
29623
- {
29624
- name: "Paused",
29625
- type: "openzeppelin_security::pausable::PausableComponent::Paused",
29626
- kind: "nested"
29627
- },
29628
- {
29629
- name: "Unpaused",
29630
- type: "openzeppelin_security::pausable::PausableComponent::Unpaused",
29631
- kind: "nested"
29632
- }
29633
- ]
29634
- },
29635
- {
29636
- type: "event",
29637
- name: "strkfarm_contracts::components::common::CommonComp::Event",
29638
- kind: "enum",
29639
- variants: []
29640
- },
29641
- {
29642
- type: "event",
29643
- name: "contracts_private::strategies::yolo_vault::interface::Deposit",
29644
- kind: "struct",
29645
- members: [
29646
- {
29647
- name: "user",
29648
- type: "core::starknet::contract_address::ContractAddress",
29649
- kind: "key"
29650
- },
29651
- {
29652
- name: "receiver",
29653
- type: "core::starknet::contract_address::ContractAddress",
29654
- kind: "data"
29655
- },
29656
- {
29657
- name: "base_amount",
29658
- type: "core::integer::u256",
29659
- kind: "data"
29660
- },
29661
- {
29662
- name: "shares",
29663
- type: "core::integer::u256",
29664
- kind: "data"
29665
- }
29666
- ]
29667
- },
29668
- {
29669
- type: "event",
29670
- name: "contracts_private::strategies::yolo_vault::interface::Redeem",
29671
- kind: "struct",
29672
- members: [
29673
- {
29674
- name: "user",
29675
- type: "core::starknet::contract_address::ContractAddress",
29676
- kind: "key"
29677
- },
29678
- {
29679
- name: "receiver",
29680
- type: "core::starknet::contract_address::ContractAddress",
29681
- kind: "data"
29682
- },
29683
- {
29684
- name: "shares",
29685
- type: "core::integer::u256",
29686
- kind: "data"
29687
- },
29688
- {
29689
- name: "base_out",
29690
- type: "core::integer::u256",
29691
- kind: "data"
29692
- },
29693
- {
29694
- name: "second_out",
29695
- type: "core::integer::u256",
29696
- kind: "data"
29697
- },
29698
- {
29699
- name: "performance_fee",
29700
- type: "core::integer::u256",
29701
- kind: "data"
29702
- }
29703
- ]
29704
- },
29705
- {
29706
- type: "event",
29707
- name: "contracts_private::strategies::yolo_vault::interface::SwapExecuted",
29708
- kind: "struct",
29709
- members: [
29710
- {
29711
- name: "epoch",
29712
- type: "core::integer::u256",
29713
- kind: "data"
29714
- },
29715
- {
29716
- name: "spend_units",
29717
- type: "core::integer::u256",
29718
- kind: "data"
29719
- },
29720
- {
29721
- name: "gross_spend",
29722
- type: "core::integer::u256",
29723
- kind: "data"
29724
- },
29725
- {
29726
- name: "swap_fee",
29727
- type: "core::integer::u256",
29728
- kind: "data"
29729
- },
29730
- {
29731
- name: "net_spend",
29732
- type: "core::integer::u256",
29733
- kind: "data"
29734
- },
29735
- {
29736
- name: "second_tokens_acquired",
29737
- type: "core::integer::u256",
29738
- kind: "data"
29739
- },
29740
- {
29741
- name: "new_global_index",
29742
- type: "core::integer::u256",
29743
- kind: "data"
29744
- },
29745
- {
29746
- name: "cumulative_spend_index",
29747
- type: "core::integer::u256",
29748
- kind: "data"
29749
- }
29750
- ]
29751
- },
29752
- {
29753
- type: "event",
29754
- name: "contracts_private::strategies::yolo_vault::interface::FeeSettingsUpdated",
29755
- kind: "struct",
29756
- members: [
29757
- {
29758
- name: "swap_fee_bps",
29759
- type: "core::integer::u256",
29760
- kind: "data"
29761
- },
29762
- {
29763
- name: "performance_fee_bps",
29764
- type: "core::integer::u256",
29765
- kind: "data"
29766
- },
29767
- {
29768
- name: "fee_receiver",
29769
- type: "core::starknet::contract_address::ContractAddress",
29770
- kind: "data"
29771
- }
29772
- ]
29773
- },
29774
- {
29775
- type: "event",
29776
- name: "contracts_private::strategies::yolo_vault::yolo_vault::YoloVault::Event",
29777
- kind: "enum",
29778
- variants: [
29779
- {
29780
- name: "ReentrancyGuardEvent",
29781
- type: "openzeppelin_security::reentrancyguard::ReentrancyGuardComponent::Event",
29782
- kind: "flat"
29783
- },
29784
- {
29785
- name: "ERC20Event",
29786
- type: "openzeppelin_token::erc20::erc20::ERC20Component::Event",
29787
- kind: "flat"
29788
- },
29789
- {
29790
- name: "SRC5Event",
29791
- type: "openzeppelin_introspection::src5::SRC5Component::Event",
29792
- kind: "flat"
29793
- },
29794
- {
29795
- name: "UpgradeableEvent",
29796
- type: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
29797
- kind: "flat"
29798
- },
29799
- {
29800
- name: "PausableEvent",
29801
- type: "openzeppelin_security::pausable::PausableComponent::Event",
29802
- kind: "flat"
29803
- },
29804
- {
29805
- name: "CommonCompEvent",
29806
- type: "strkfarm_contracts::components::common::CommonComp::Event",
29807
- kind: "flat"
29808
- },
29809
- {
29810
- name: "Deposit",
29811
- type: "contracts_private::strategies::yolo_vault::interface::Deposit",
29812
- kind: "nested"
29813
- },
29814
- {
29815
- name: "Redeem",
29816
- type: "contracts_private::strategies::yolo_vault::interface::Redeem",
29817
- kind: "nested"
29818
- },
29819
- {
29820
- name: "SwapExecuted",
29821
- type: "contracts_private::strategies::yolo_vault::interface::SwapExecuted",
29822
- kind: "nested"
29823
- },
29824
- {
29825
- name: "FeeSettingsUpdated",
29826
- type: "contracts_private::strategies::yolo_vault::interface::FeeSettingsUpdated",
29827
- kind: "nested"
29828
- }
29829
- ]
29830
- }
29831
- ];
29832
-
29833
- // src/strategies/yoloVault.ts
29834
28689
  import { createElement } from "react";
29835
28690
  var YoLoVault = class extends BaseStrategy {
29836
28691
  constructor(config, pricer, metadata) {
@@ -29839,17 +28694,19 @@ var YoLoVault = class extends BaseStrategy {
29839
28694
  withdrawInputMode: "dual"
29840
28695
  });
29841
28696
  this.getSettings = async () => {
29842
- const settings = await this.contract.call("get_settings", []);
28697
+ const settings = await (await this.contract).call("get_settings", []);
29843
28698
  return settings;
29844
28699
  };
29845
28700
  this.address = metadata.address;
29846
28701
  this.pricer = pricer;
29847
28702
  this.metadata = metadata;
29848
- this.contract = new Contract10({
29849
- abi: yoloVault_abi_default,
29850
- address: this.address.address,
29851
- providerOrAccount: this.config.provider
29852
- });
28703
+ this.contract = this.config.provider.getClassAt(this.address.address).then(
28704
+ (cls) => new Contract10({
28705
+ abi: cls.abi,
28706
+ address: this.address.address,
28707
+ providerOrAccount: this.config.provider
28708
+ })
28709
+ );
29853
28710
  if (metadata.depositTokens.length < 1) {
29854
28711
  throw new Error("Deposit tokens are not fully defined in metadata");
29855
28712
  }
@@ -29863,9 +28720,11 @@ var YoLoVault = class extends BaseStrategy {
29863
28720
  secondUnderlying: ai.secondUnderlying
29864
28721
  };
29865
28722
  }
28723
+ /** Underlying (or base token) used for pricing / swap sell leg when base is ERC-4626. */
29866
28724
  tokenForPrimaryPricing() {
29867
28725
  return this.erc4626.isBaseERC4626 && this.erc4626.baseUnderlying ? this.erc4626.baseUnderlying : this.primaryToken;
29868
28726
  }
28727
+ /** Underlying (or second token) for price ratios when second leg is ERC-4626 (e.g. STRK for xSTRK). */
29869
28728
  tokenForSecondaryPricing() {
29870
28729
  return this.erc4626.isSecondERC4626 && this.erc4626.secondUnderlying ? this.erc4626.secondUnderlying : this.secondaryToken;
29871
28730
  }
@@ -29893,7 +28752,7 @@ var YoLoVault = class extends BaseStrategy {
29893
28752
  // return formattedAmount;
29894
28753
  // }
29895
28754
  async getNormalizedUserInfo(user, blockIdentifier = "latest") {
29896
- const userInfo = await this.contract.call("get_user_info", [user.address], {
28755
+ const userInfo = await (await this.contract).call("get_user_info", [user.address], {
29897
28756
  blockIdentifier
29898
28757
  });
29899
28758
  const {
@@ -30135,6 +28994,7 @@ var YoLoVault = class extends BaseStrategy {
30135
28994
  }
30136
28995
  async depositCall(amountInfo, receiver) {
30137
28996
  try {
28997
+ const vault = await this.contract;
30138
28998
  if (this.erc4626.isBaseERC4626) {
30139
28999
  if (!this.erc4626.baseUnderlying) {
30140
29000
  throw new Error("baseUnderlying missing for ERC-4626 base YOLO vault");
@@ -30144,7 +29004,7 @@ var YoLoVault = class extends BaseStrategy {
30144
29004
  this.address.address,
30145
29005
  amountInfo.amount
30146
29006
  );
30147
- const depositCall2 = this.contract.populate("deposit_combined", [
29007
+ const depositCall2 = vault.populate("deposit_combined", [
30148
29008
  uint25610.bnToUint256(amountInfo.amount.toWei()),
30149
29009
  receiver.address
30150
29010
  ]);
@@ -30152,7 +29012,7 @@ var YoLoVault = class extends BaseStrategy {
30152
29012
  }
30153
29013
  const primaryToken = amountInfo.tokenInfo;
30154
29014
  const approvalCall = new ERC20(this.config).approve(primaryToken.address.address, this.address.address, amountInfo.amount);
30155
- const depositCall = this.contract.populate("deposit", [
29015
+ const depositCall = vault.populate("deposit", [
30156
29016
  uint25610.bnToUint256(amountInfo.amount.toWei()),
30157
29017
  receiver.address
30158
29018
  ]);
@@ -30163,7 +29023,7 @@ var YoLoVault = class extends BaseStrategy {
30163
29023
  }
30164
29024
  }
30165
29025
  async getVaultStatus() {
30166
- const vaultStatus = await this.contract.call("get_vault_status", []);
29026
+ const vaultStatus = await (await this.contract).call("get_vault_status", []);
30167
29027
  return vaultStatus;
30168
29028
  }
30169
29029
  async matchInputAmounts(amountInfo, user) {
@@ -30227,7 +29087,8 @@ var YoLoVault = class extends BaseStrategy {
30227
29087
  }
30228
29088
  const requiredShares = userShares.multipliedBy(withdrawRequest.sharesUsedFactor).floor();
30229
29089
  const redeemFn = this.erc4626.isBaseERC4626 ? "redeem_combined" : "redeem";
30230
- let withdrawCall = this.contract.populate(redeemFn, [
29090
+ const vault = await this.contract;
29091
+ let withdrawCall = vault.populate(redeemFn, [
30231
29092
  uint25610.bnToUint256(requiredShares.toString()),
30232
29093
  receiver.address
30233
29094
  ]);
@@ -30241,7 +29102,7 @@ var YoLoVault = class extends BaseStrategy {
30241
29102
  return "\u{1F919}YOLO";
30242
29103
  }
30243
29104
  async getSwapAmounts(spendUnits) {
30244
- const swapAmounts = await this.contract.call("get_swap_amounts", [spendUnits.toUint256()]);
29105
+ const swapAmounts = await (await this.contract).call("get_swap_amounts", [spendUnits.toUint256()]);
30245
29106
  console.log("swapAmounts", swapAmounts);
30246
29107
  return {
30247
29108
  grossSpend: Web3Number.fromWei(swapAmounts[0].toString(), this.primaryToken.decimals),