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