@flaunch/sdk 0.8.2 → 0.8.3-beta.0

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.
Files changed (41) hide show
  1. package/dist/abi/FlaunchZap.d.ts +106 -102
  2. package/dist/abi/FlaunchZap.d.ts.map +1 -1
  3. package/dist/abi/TreasuryManager.d.ts +106 -0
  4. package/dist/abi/TreasuryManager.d.ts.map +1 -0
  5. package/dist/abi/TreasuryManagerFactory.d.ts +268 -242
  6. package/dist/abi/TreasuryManagerFactory.d.ts.map +1 -1
  7. package/dist/abi/index.cjs +476 -322
  8. package/dist/abi/index.cjs.map +1 -1
  9. package/dist/abi/index.js +476 -322
  10. package/dist/abi/index.js.map +1 -1
  11. package/dist/addresses/index.cjs +23 -6
  12. package/dist/addresses/index.cjs.map +1 -1
  13. package/dist/addresses/index.js +21 -7
  14. package/dist/addresses/index.js.map +1 -1
  15. package/dist/addresses.d.ts +6 -1
  16. package/dist/addresses.d.ts.map +1 -1
  17. package/dist/clients/FlaunchZapClient.d.ts +8 -1
  18. package/dist/clients/FlaunchZapClient.d.ts.map +1 -1
  19. package/dist/clients/TreasuryManagerClient.d.ts +60 -0
  20. package/dist/clients/TreasuryManagerClient.d.ts.map +1 -0
  21. package/dist/clients/TreasuryManagerFactoryClient.d.ts +34 -7
  22. package/dist/clients/TreasuryManagerFactoryClient.d.ts.map +1 -1
  23. package/dist/helpers/index.cjs +61 -0
  24. package/dist/helpers/index.cjs.map +1 -1
  25. package/dist/helpers/index.d.ts +1 -0
  26. package/dist/helpers/index.d.ts.map +1 -1
  27. package/dist/helpers/index.js +62 -2
  28. package/dist/helpers/index.js.map +1 -1
  29. package/dist/helpers/permissions.d.ts +10 -0
  30. package/dist/helpers/permissions.d.ts.map +1 -0
  31. package/dist/index.cjs.js +935 -381
  32. package/dist/index.cjs.js.map +1 -1
  33. package/dist/index.esm.js +933 -383
  34. package/dist/index.esm.js.map +1 -1
  35. package/dist/index.umd.js +1 -1
  36. package/dist/index.umd.js.map +1 -1
  37. package/dist/sdk/FlaunchSDK.d.ts +71 -6
  38. package/dist/sdk/FlaunchSDK.d.ts.map +1 -1
  39. package/dist/types.d.ts +8 -0
  40. package/dist/types.d.ts.map +1 -1
  41. package/package.json +1 -1
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { createDrift as createDrift$1 } from '@delvtech/drift';
2
- import { zeroAddress, parseEther, encodeAbiParameters, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, parseUnits, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, zeroHash, formatUnits as formatUnits$1, concat, toHex as toHex$1, createPublicClient, http } from 'viem';
2
+ import { zeroAddress, parseEther, encodeAbiParameters, maxUint256 as maxUint256$1, encodeFunctionData, maxUint160, maxUint48, parseUnits, hexToBigInt as hexToBigInt$1, pad as pad$1, keccak256 as keccak256$1, encodePacked, stringToHex as stringToHex$1, zeroHash, formatUnits as formatUnits$1, createPublicClient, http, concat, toHex as toHex$1, erc721Abi } from 'viem';
3
3
  import axios from 'axios';
4
4
  import { TickMath } from '@uniswap/v3-sdk';
5
5
  import { viemAdapter } from '@delvtech/drift-viem';
@@ -5307,7 +5307,7 @@ const sourceId = 5; // goerli
5307
5307
  testnet: true,
5308
5308
  });
5309
5309
 
5310
- // doesn't use FeeEscrow
5310
+ // only old V1.0: doesn't use FeeEscrow
5311
5311
  const FlaunchPositionManagerAddress = {
5312
5312
  [base.id]: "0x51Bba15255406Cfe7099a42183302640ba7dAFDC",
5313
5313
  [baseSepolia.id]: "0x9A7059cA00dA92843906Cb4bCa1D005cE848AFdC",
@@ -5346,6 +5346,16 @@ const ZoraVerifierAddress = {
5346
5346
  [baseSepolia.id]: "0x05a5763e9199b88bb591c6b112d0424b2cd7a99e",
5347
5347
  };
5348
5348
  /** ======== */
5349
+ /** Permissions */
5350
+ const ClosedPermissionsAddress = {
5351
+ [base.id]: "0x0000000000000000000000000000000000000000", // TODO: add mainnet address
5352
+ [baseSepolia.id]: "0x551aeD820CAfaca2f9cD1C637AAc076D05a03AC2",
5353
+ };
5354
+ const WhitelistedPermissionsAddress = {
5355
+ [base.id]: "0x0000000000000000000000000000000000000000", // TODO: add mainnet address
5356
+ [baseSepolia.id]: "0xe8691E8f576A98c41EBB5E984207d4F51386621f",
5357
+ };
5358
+ /** =========== */
5349
5359
  const FeeEscrowAddress = {
5350
5360
  [base.id]: "0x72e6f7948b1B1A343B477F39aAbd2E35E6D27dde",
5351
5361
  [baseSepolia.id]: "0x73E27908b7d35A9251a54799A8ef4C17e4ED9FF9",
@@ -5402,8 +5412,12 @@ const FastFlaunchZapAddress = {
5402
5412
  [baseSepolia.id]: "0x821d9f6075e7971cc71c379081de9d532f5f9957",
5403
5413
  };
5404
5414
  const FlaunchZapAddress = {
5405
- [base.id]: "0xfa9e8528ee95eb109bffd1a2d59cb95b300a672a",
5406
- [baseSepolia.id]: "0xb2f5d987de90e026b61805e60b6002d367461474",
5415
+ [base.id]: "0xfa9e8528ee95eb109bffd1a2d59cb95b300a672a", // TODO: update mainnet address with permissions param
5416
+ [baseSepolia.id]: "0x9AE92E5ad16822F9723be29E58B6019B7fA765c5",
5417
+ };
5418
+ const TreasuryManagerFactoryAddress = {
5419
+ [base.id]: "0x48af8b28DDC5e5A86c4906212fc35Fa808CA8763", // TODO: update mainnet address with permissions param
5420
+ [baseSepolia.id]: "0xb22779fcDB2a1199E6592e0D4BE29A0C8c626246",
5407
5421
  };
5408
5422
  const RevenueManagerAddress = {
5409
5423
  [base.id]: "0x712fa8ddc7347b4b6b029aa21710f365cd02d898",
@@ -5413,9 +5427,9 @@ const AddressFeeSplitManagerAddress = {
5413
5427
  [base.id]: "0x6baa4ec493a9698dc7388c0f290e29ea3d149f99",
5414
5428
  [baseSepolia.id]: "0xf72dcdee692c188de6b14c6213e849982e04069b",
5415
5429
  };
5416
- const TreasuryManagerFactoryAddress = {
5417
- [base.id]: "0x48af8b28DDC5e5A86c4906212fc35Fa808CA8763",
5418
- [baseSepolia.id]: "0xd2f3c6185e06925dcbe794c6574315b2202e9ccd",
5430
+ const StakingManagerAddress = {
5431
+ [base.id]: "0x0000000000000000000000000000000000000000", // TODO: update mainnet address
5432
+ [baseSepolia.id]: "0x4a59dBAd29981A39BE597081f7f5071843552158",
5419
5433
  };
5420
5434
  const PoolManagerAddress = {
5421
5435
  [base.id]: "0x498581fF718922c3f8e6A244956aF099B2652b2b",
@@ -10803,237 +10817,387 @@ class AnyBidWall {
10803
10817
 
10804
10818
  const FlaunchZapAbi = [
10805
10819
  {
10820
+ type: "constructor",
10806
10821
  inputs: [
10807
10822
  {
10808
- internalType: "contract PositionManager",
10809
10823
  name: "_positionManager",
10810
10824
  type: "address",
10825
+ internalType: "contract PositionManager",
10811
10826
  },
10812
10827
  {
10813
- internalType: "contract Flaunch",
10814
10828
  name: "_flaunchContract",
10815
10829
  type: "address",
10830
+ internalType: "contract Flaunch",
10831
+ },
10832
+ {
10833
+ name: "_flETH",
10834
+ type: "address",
10835
+ internalType: "contract IFLETH",
10836
+ },
10837
+ {
10838
+ name: "_poolSwap",
10839
+ type: "address",
10840
+ internalType: "contract PoolSwap",
10816
10841
  },
10817
- { internalType: "contract IFLETH", name: "_flETH", type: "address" },
10818
- { internalType: "contract PoolSwap", name: "_poolSwap", type: "address" },
10819
10842
  {
10820
- internalType: "contract ITreasuryManagerFactory",
10821
10843
  name: "_treasuryManagerFactory",
10822
10844
  type: "address",
10845
+ internalType: "contract ITreasuryManagerFactory",
10823
10846
  },
10824
10847
  {
10825
- internalType: "contract IMerkleAirdrop",
10826
10848
  name: "_merkleAirdrop",
10827
10849
  type: "address",
10850
+ internalType: "contract IMerkleAirdrop",
10828
10851
  },
10829
10852
  {
10830
- internalType: "contract WhitelistFairLaunch",
10831
10853
  name: "_whitelistFairLaunch",
10832
10854
  type: "address",
10855
+ internalType: "contract WhitelistFairLaunch",
10833
10856
  },
10834
10857
  ],
10835
10858
  stateMutability: "nonpayable",
10836
- type: "constructor",
10837
10859
  },
10838
- { inputs: [], name: "CreatorCannotBeZero", type: "error" },
10839
- { inputs: [], name: "InsufficientMemecoinsForAirdrop", type: "error" },
10860
+ { type: "receive", stateMutability: "payable" },
10840
10861
  {
10862
+ type: "function",
10863
+ name: "calculateFee",
10841
10864
  inputs: [
10842
- { internalType: "uint256", name: "_premineAmount", type: "uint256" },
10843
- { internalType: "uint256", name: "_slippage", type: "uint256" },
10844
- { internalType: "bytes", name: "_initialPriceParams", type: "bytes" },
10865
+ {
10866
+ name: "_premineAmount",
10867
+ type: "uint256",
10868
+ internalType: "uint256",
10869
+ },
10870
+ { name: "_slippage", type: "uint256", internalType: "uint256" },
10871
+ {
10872
+ name: "_initialPriceParams",
10873
+ type: "bytes",
10874
+ internalType: "bytes",
10875
+ },
10845
10876
  ],
10846
- name: "calculateFee",
10847
10877
  outputs: [
10848
- { internalType: "uint256", name: "ethRequired_", type: "uint256" },
10878
+ { name: "ethRequired_", type: "uint256", internalType: "uint256" },
10849
10879
  ],
10850
10880
  stateMutability: "view",
10851
- type: "function",
10852
10881
  },
10853
10882
  {
10854
- inputs: [],
10883
+ type: "function",
10855
10884
  name: "flETH",
10856
- outputs: [{ internalType: "contract IFLETH", name: "", type: "address" }],
10885
+ inputs: [],
10886
+ outputs: [{ name: "", type: "address", internalType: "contract IFLETH" }],
10857
10887
  stateMutability: "view",
10858
- type: "function",
10859
10888
  },
10860
10889
  {
10890
+ type: "function",
10891
+ name: "flaunch",
10861
10892
  inputs: [
10862
10893
  {
10894
+ name: "_flaunchParams",
10895
+ type: "tuple",
10896
+ internalType: "struct PositionManager.FlaunchParams",
10863
10897
  components: [
10864
- { internalType: "string", name: "name", type: "string" },
10865
- { internalType: "string", name: "symbol", type: "string" },
10866
- { internalType: "string", name: "tokenUri", type: "string" },
10898
+ { name: "name", type: "string", internalType: "string" },
10899
+ { name: "symbol", type: "string", internalType: "string" },
10900
+ { name: "tokenUri", type: "string", internalType: "string" },
10867
10901
  {
10868
- internalType: "uint256",
10869
10902
  name: "initialTokenFairLaunch",
10870
10903
  type: "uint256",
10904
+ internalType: "uint256",
10871
10905
  },
10872
10906
  {
10873
- internalType: "uint256",
10874
10907
  name: "fairLaunchDuration",
10875
10908
  type: "uint256",
10909
+ internalType: "uint256",
10876
10910
  },
10877
- { internalType: "uint256", name: "premineAmount", type: "uint256" },
10878
- { internalType: "address", name: "creator", type: "address" },
10879
10911
  {
10880
- internalType: "uint24",
10912
+ name: "premineAmount",
10913
+ type: "uint256",
10914
+ internalType: "uint256",
10915
+ },
10916
+ { name: "creator", type: "address", internalType: "address" },
10917
+ {
10881
10918
  name: "creatorFeeAllocation",
10882
10919
  type: "uint24",
10920
+ internalType: "uint24",
10921
+ },
10922
+ {
10923
+ name: "flaunchAt",
10924
+ type: "uint256",
10925
+ internalType: "uint256",
10926
+ },
10927
+ {
10928
+ name: "initialPriceParams",
10929
+ type: "bytes",
10930
+ internalType: "bytes",
10931
+ },
10932
+ {
10933
+ name: "feeCalculatorParams",
10934
+ type: "bytes",
10935
+ internalType: "bytes",
10883
10936
  },
10884
- { internalType: "uint256", name: "flaunchAt", type: "uint256" },
10885
- { internalType: "bytes", name: "initialPriceParams", type: "bytes" },
10886
- { internalType: "bytes", name: "feeCalculatorParams", type: "bytes" },
10887
10937
  ],
10888
- internalType: "struct PositionManager.FlaunchParams",
10889
- name: "_flaunchParams",
10890
- type: "tuple",
10891
10938
  },
10892
10939
  ],
10893
- name: "flaunch",
10894
10940
  outputs: [
10895
- { internalType: "address", name: "memecoin_", type: "address" },
10896
- { internalType: "uint256", name: "ethSpent_", type: "uint256" },
10897
- { internalType: "address", name: "", type: "address" },
10941
+ { name: "memecoin_", type: "address", internalType: "address" },
10942
+ { name: "ethSpent_", type: "uint256", internalType: "uint256" },
10943
+ { name: "", type: "address", internalType: "address" },
10898
10944
  ],
10899
10945
  stateMutability: "payable",
10900
- type: "function",
10901
10946
  },
10902
10947
  {
10948
+ type: "function",
10949
+ name: "flaunch",
10903
10950
  inputs: [
10904
10951
  {
10952
+ name: "_flaunchParams",
10953
+ type: "tuple",
10954
+ internalType: "struct PositionManager.FlaunchParams",
10905
10955
  components: [
10906
- { internalType: "string", name: "name", type: "string" },
10907
- { internalType: "string", name: "symbol", type: "string" },
10908
- { internalType: "string", name: "tokenUri", type: "string" },
10956
+ { name: "name", type: "string", internalType: "string" },
10957
+ { name: "symbol", type: "string", internalType: "string" },
10958
+ { name: "tokenUri", type: "string", internalType: "string" },
10909
10959
  {
10910
- internalType: "uint256",
10911
10960
  name: "initialTokenFairLaunch",
10912
10961
  type: "uint256",
10962
+ internalType: "uint256",
10913
10963
  },
10914
10964
  {
10915
- internalType: "uint256",
10916
10965
  name: "fairLaunchDuration",
10917
10966
  type: "uint256",
10967
+ internalType: "uint256",
10918
10968
  },
10919
- { internalType: "uint256", name: "premineAmount", type: "uint256" },
10920
- { internalType: "address", name: "creator", type: "address" },
10921
10969
  {
10922
- internalType: "uint24",
10970
+ name: "premineAmount",
10971
+ type: "uint256",
10972
+ internalType: "uint256",
10973
+ },
10974
+ { name: "creator", type: "address", internalType: "address" },
10975
+ {
10923
10976
  name: "creatorFeeAllocation",
10924
10977
  type: "uint24",
10978
+ internalType: "uint24",
10979
+ },
10980
+ {
10981
+ name: "flaunchAt",
10982
+ type: "uint256",
10983
+ internalType: "uint256",
10984
+ },
10985
+ {
10986
+ name: "initialPriceParams",
10987
+ type: "bytes",
10988
+ internalType: "bytes",
10989
+ },
10990
+ {
10991
+ name: "feeCalculatorParams",
10992
+ type: "bytes",
10993
+ internalType: "bytes",
10925
10994
  },
10926
- { internalType: "uint256", name: "flaunchAt", type: "uint256" },
10927
- { internalType: "bytes", name: "initialPriceParams", type: "bytes" },
10928
- { internalType: "bytes", name: "feeCalculatorParams", type: "bytes" },
10929
10995
  ],
10930
- internalType: "struct PositionManager.FlaunchParams",
10931
- name: "_flaunchParams",
10932
- type: "tuple",
10933
10996
  },
10934
10997
  {
10935
- components: [
10936
- { internalType: "bytes32", name: "merkleRoot", type: "bytes32" },
10937
- { internalType: "string", name: "merkleIPFSHash", type: "string" },
10938
- { internalType: "uint256", name: "maxTokens", type: "uint256" },
10939
- ],
10940
- internalType: "struct FlaunchZap.WhitelistParams",
10941
10998
  name: "_whitelistParams",
10942
10999
  type: "tuple",
10943
- },
10944
- {
11000
+ internalType: "struct FlaunchZap.WhitelistParams",
10945
11001
  components: [
10946
- { internalType: "uint256", name: "airdropIndex", type: "uint256" },
10947
- { internalType: "uint256", name: "airdropAmount", type: "uint256" },
10948
- { internalType: "uint256", name: "airdropEndTime", type: "uint256" },
10949
- { internalType: "bytes32", name: "merkleRoot", type: "bytes32" },
10950
- { internalType: "string", name: "merkleIPFSHash", type: "string" },
11002
+ {
11003
+ name: "merkleRoot",
11004
+ type: "bytes32",
11005
+ internalType: "bytes32",
11006
+ },
11007
+ {
11008
+ name: "merkleIPFSHash",
11009
+ type: "string",
11010
+ internalType: "string",
11011
+ },
11012
+ {
11013
+ name: "maxTokens",
11014
+ type: "uint256",
11015
+ internalType: "uint256",
11016
+ },
10951
11017
  ],
10952
- internalType: "struct FlaunchZap.AirdropParams",
10953
- name: "_airdropParams",
10954
- type: "tuple",
10955
11018
  },
10956
11019
  {
11020
+ name: "_airdropParams",
11021
+ type: "tuple",
11022
+ internalType: "struct FlaunchZap.AirdropParams",
10957
11023
  components: [
10958
- { internalType: "address", name: "manager", type: "address" },
10959
- { internalType: "bytes", name: "initializeData", type: "bytes" },
10960
- { internalType: "bytes", name: "depositData", type: "bytes" },
11024
+ {
11025
+ name: "airdropIndex",
11026
+ type: "uint256",
11027
+ internalType: "uint256",
11028
+ },
11029
+ {
11030
+ name: "airdropAmount",
11031
+ type: "uint256",
11032
+ internalType: "uint256",
11033
+ },
11034
+ {
11035
+ name: "airdropEndTime",
11036
+ type: "uint256",
11037
+ internalType: "uint256",
11038
+ },
11039
+ {
11040
+ name: "merkleRoot",
11041
+ type: "bytes32",
11042
+ internalType: "bytes32",
11043
+ },
11044
+ {
11045
+ name: "merkleIPFSHash",
11046
+ type: "string",
11047
+ internalType: "string",
11048
+ },
10961
11049
  ],
10962
- internalType: "struct FlaunchZap.TreasuryManagerParams",
11050
+ },
11051
+ {
10963
11052
  name: "_treasuryManagerParams",
10964
11053
  type: "tuple",
11054
+ internalType: "struct FlaunchZap.TreasuryManagerParams",
11055
+ components: [
11056
+ { name: "manager", type: "address", internalType: "address" },
11057
+ {
11058
+ name: "permissions",
11059
+ type: "address",
11060
+ internalType: "address",
11061
+ },
11062
+ {
11063
+ name: "initializeData",
11064
+ type: "bytes",
11065
+ internalType: "bytes",
11066
+ },
11067
+ { name: "depositData", type: "bytes", internalType: "bytes" },
11068
+ ],
10965
11069
  },
10966
11070
  ],
10967
- name: "flaunch",
10968
11071
  outputs: [
10969
- { internalType: "address", name: "memecoin_", type: "address" },
10970
- { internalType: "uint256", name: "ethSpent_", type: "uint256" },
10971
- { internalType: "address", name: "deployedManager_", type: "address" },
11072
+ { name: "memecoin_", type: "address", internalType: "address" },
11073
+ { name: "ethSpent_", type: "uint256", internalType: "uint256" },
11074
+ {
11075
+ name: "deployedManager_",
11076
+ type: "address",
11077
+ internalType: "address",
11078
+ },
10972
11079
  ],
10973
11080
  stateMutability: "payable",
10974
- type: "function",
10975
11081
  },
10976
11082
  {
10977
- inputs: [],
11083
+ type: "function",
10978
11084
  name: "flaunchContract",
10979
- outputs: [{ internalType: "contract Flaunch", name: "", type: "address" }],
11085
+ inputs: [],
11086
+ outputs: [{ name: "", type: "address", internalType: "contract Flaunch" }],
10980
11087
  stateMutability: "view",
10981
- type: "function",
10982
11088
  },
10983
11089
  {
10984
- inputs: [],
11090
+ type: "function",
10985
11091
  name: "merkleAirdrop",
11092
+ inputs: [],
10986
11093
  outputs: [
10987
- { internalType: "contract IMerkleAirdrop", name: "", type: "address" },
11094
+ {
11095
+ name: "",
11096
+ type: "address",
11097
+ internalType: "contract IMerkleAirdrop",
11098
+ },
10988
11099
  ],
10989
11100
  stateMutability: "view",
10990
- type: "function",
10991
11101
  },
10992
11102
  {
10993
- inputs: [],
11103
+ type: "function",
10994
11104
  name: "poolSwap",
10995
- outputs: [{ internalType: "contract PoolSwap", name: "", type: "address" }],
11105
+ inputs: [],
11106
+ outputs: [{ name: "", type: "address", internalType: "contract PoolSwap" }],
10996
11107
  stateMutability: "view",
10997
- type: "function",
10998
11108
  },
10999
11109
  {
11000
- inputs: [],
11110
+ type: "function",
11001
11111
  name: "positionManager",
11112
+ inputs: [],
11002
11113
  outputs: [
11003
- { internalType: "contract PositionManager", name: "", type: "address" },
11114
+ {
11115
+ name: "",
11116
+ type: "address",
11117
+ internalType: "contract PositionManager",
11118
+ },
11004
11119
  ],
11005
11120
  stateMutability: "view",
11006
- type: "function",
11007
11121
  },
11008
11122
  {
11009
- inputs: [],
11123
+ type: "function",
11010
11124
  name: "treasuryManagerFactory",
11125
+ inputs: [],
11011
11126
  outputs: [
11012
11127
  {
11013
- internalType: "contract ITreasuryManagerFactory",
11014
11128
  name: "",
11015
11129
  type: "address",
11130
+ internalType: "contract ITreasuryManagerFactory",
11016
11131
  },
11017
11132
  ],
11018
11133
  stateMutability: "view",
11019
- type: "function",
11020
11134
  },
11021
11135
  {
11022
- inputs: [],
11136
+ type: "function",
11023
11137
  name: "whitelistFairLaunch",
11138
+ inputs: [],
11024
11139
  outputs: [
11025
11140
  {
11026
- internalType: "contract WhitelistFairLaunch",
11027
11141
  name: "",
11028
11142
  type: "address",
11143
+ internalType: "contract WhitelistFairLaunch",
11029
11144
  },
11030
11145
  ],
11031
11146
  stateMutability: "view",
11032
- type: "function",
11033
11147
  },
11034
- { stateMutability: "payable", type: "receive" },
11148
+ { type: "error", name: "CreatorCannotBeZero", inputs: [] },
11149
+ { type: "error", name: "InsufficientMemecoinsForAirdrop", inputs: [] },
11035
11150
  ];
11036
11151
 
11152
+ /**
11153
+ * Enumeration of Flaunch contract versions
11154
+ */
11155
+ var FlaunchVersion;
11156
+ (function (FlaunchVersion) {
11157
+ FlaunchVersion["V1"] = "V1";
11158
+ FlaunchVersion["V1_1"] = "V1_1";
11159
+ FlaunchVersion["V1_1_1"] = "V1_1_1";
11160
+ FlaunchVersion["ANY"] = "ANY";
11161
+ })(FlaunchVersion || (FlaunchVersion = {}));
11162
+ /**
11163
+ * Enumeration of Verifiers for TokenImporter
11164
+ */
11165
+ var Verifier;
11166
+ (function (Verifier) {
11167
+ Verifier["CLANKER"] = "clanker";
11168
+ Verifier["DOPPLER"] = "doppler";
11169
+ Verifier["VIRTUALS"] = "virtuals";
11170
+ Verifier["WHITELIST"] = "whitelist";
11171
+ Verifier["ZORA"] = "zora";
11172
+ })(Verifier || (Verifier = {}));
11173
+ /**
11174
+ * Enumeration of Permissions for TreasuryManagers. Defaults to OPEN.
11175
+ */
11176
+ var Permissions;
11177
+ (function (Permissions) {
11178
+ Permissions["OPEN"] = "open";
11179
+ Permissions["CLOSED"] = "closed";
11180
+ Permissions["WHITELISTED"] = "whitelisted";
11181
+ })(Permissions || (Permissions = {}));
11182
+
11183
+ /**
11184
+ * Maps a Permissions enum value to its corresponding contract address
11185
+ * @param permissions - The permissions enum value
11186
+ * @param chainId - The chain ID to get the address for
11187
+ * @returns The corresponding permissions contract address
11188
+ */
11189
+ function getPermissionsAddress(permissions, chainId) {
11190
+ switch (permissions) {
11191
+ case Permissions.CLOSED:
11192
+ return ClosedPermissionsAddress[chainId];
11193
+ case Permissions.WHITELISTED:
11194
+ return WhitelistedPermissionsAddress[chainId];
11195
+ case Permissions.OPEN:
11196
+ default:
11197
+ return zeroAddress;
11198
+ }
11199
+ }
11200
+
11037
11201
  const FlaunchPositionManagerV1_1Abi = [
11038
11202
  {
11039
11203
  inputs: [
@@ -12957,11 +13121,13 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
12957
13121
  const _treasuryManagerParams = params.treasuryManagerParams
12958
13122
  ? {
12959
13123
  manager: params.treasuryManagerParams.manager ?? zeroAddress,
13124
+ permissions: params.treasuryManagerParams.permissions ?? Permissions.OPEN,
12960
13125
  initializeData: params.treasuryManagerParams.initializeData ?? "0x",
12961
13126
  depositData: params.treasuryManagerParams.depositData ?? "0x",
12962
13127
  }
12963
13128
  : {
12964
13129
  manager: zeroAddress,
13130
+ permissions: Permissions.OPEN,
12965
13131
  initializeData: "0x",
12966
13132
  depositData: "0x",
12967
13133
  };
@@ -12979,7 +13145,10 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
12979
13145
  initialPriceParams,
12980
13146
  feeCalculatorParams: "0x",
12981
13147
  },
12982
- _treasuryManagerParams,
13148
+ _treasuryManagerParams: {
13149
+ ..._treasuryManagerParams,
13150
+ permissions: getPermissionsAddress(_treasuryManagerParams.permissions, this.chainId),
13151
+ },
12983
13152
  _whitelistParams: {
12984
13153
  merkleRoot: zeroHash,
12985
13154
  merkleIPFSHash: "",
@@ -13053,6 +13222,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
13053
13222
  },
13054
13223
  _treasuryManagerParams: {
13055
13224
  manager: params.revenueManagerInstanceAddress,
13225
+ permissions: getPermissionsAddress(params.treasuryManagerParams?.permissions ?? Permissions.OPEN, this.chainId),
13056
13226
  initializeData: "0x",
13057
13227
  depositData: "0x",
13058
13228
  },
@@ -13170,6 +13340,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
13170
13340
  },
13171
13341
  _treasuryManagerParams: {
13172
13342
  manager: AddressFeeSplitManagerAddress[this.chainId],
13343
+ permissions: getPermissionsAddress(params.treasuryManagerParams?.permissions ?? Permissions.OPEN, this.chainId),
13173
13344
  initializeData,
13174
13345
  depositData: "0x",
13175
13346
  },
@@ -17415,30 +17586,8 @@ const TokenImporterAbi = [
17415
17586
  ];
17416
17587
 
17417
17588
  /**
17418
- * Enumeration of Flaunch contract versions
17419
- */
17420
- var FlaunchVersion;
17421
- (function (FlaunchVersion) {
17422
- FlaunchVersion["V1"] = "V1";
17423
- FlaunchVersion["V1_1"] = "V1_1";
17424
- FlaunchVersion["V1_1_1"] = "V1_1_1";
17425
- FlaunchVersion["ANY"] = "ANY";
17426
- })(FlaunchVersion || (FlaunchVersion = {}));
17427
- /**
17428
- * Enumeration of Verifiers for TokenImporter
17429
- */
17430
- var Verifier;
17431
- (function (Verifier) {
17432
- Verifier["CLANKER"] = "clanker";
17433
- Verifier["DOPPLER"] = "doppler";
17434
- Verifier["VIRTUALS"] = "virtuals";
17435
- Verifier["WHITELIST"] = "whitelist";
17436
- Verifier["ZORA"] = "zora";
17437
- })(Verifier || (Verifier = {}));
17438
-
17439
- /**
17440
- * Base client for interacting with the TokenImporter contract in read-only mode
17441
- * Provides basic contract initialization
17589
+ * Base client for interacting with the TokenImporter contract in read-only mode
17590
+ * Provides basic contract initialization
17442
17591
  */
17443
17592
  class ReadTokenImporter {
17444
17593
  constructor(chainId, address, drift = createDrift$1()) {
@@ -19848,388 +19997,446 @@ class ReadFlaunchV1_1 {
19848
19997
 
19849
19998
  const TreasuryManagerFactoryAbi = [
19850
19999
  {
19851
- inputs: [
19852
- { internalType: "address", name: "_protocolOwner", type: "address" },
19853
- { internalType: "address", name: "_feeEscrow", type: "address" },
19854
- ],
19855
- stateMutability: "nonpayable",
19856
20000
  type: "constructor",
19857
- },
19858
- { inputs: [], name: "AccessControlBadConfirmation", type: "error" },
19859
- {
19860
- inputs: [
19861
- { internalType: "address", name: "account", type: "address" },
19862
- { internalType: "bytes32", name: "neededRole", type: "bytes32" },
19863
- ],
19864
- name: "AccessControlUnauthorizedAccount",
19865
- type: "error",
19866
- },
19867
- { inputs: [], name: "AlreadyInitialized", type: "error" },
19868
- { inputs: [], name: "NewOwnerIsZeroAddress", type: "error" },
19869
- { inputs: [], name: "NoHandoverRequest", type: "error" },
19870
- { inputs: [], name: "Unauthorized", type: "error" },
19871
- { inputs: [], name: "UnknownManagerImplemention", type: "error" },
19872
- {
19873
- anonymous: false,
19874
20001
  inputs: [
19875
20002
  {
19876
- indexed: true,
19877
- internalType: "address",
19878
- name: "_manager",
20003
+ name: "_protocolOwner",
19879
20004
  type: "address",
19880
- },
19881
- {
19882
- indexed: true,
19883
20005
  internalType: "address",
19884
- name: "_managerImplementation",
19885
- type: "address",
19886
20006
  },
20007
+ { name: "_feeEscrow", type: "address", internalType: "address" },
19887
20008
  ],
19888
- name: "ManagerDeployed",
19889
- type: "event",
20009
+ stateMutability: "nonpayable",
19890
20010
  },
19891
20011
  {
19892
- anonymous: false,
20012
+ type: "function",
20013
+ name: "DEFAULT_ADMIN_ROLE",
20014
+ inputs: [],
20015
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
20016
+ stateMutability: "view",
20017
+ },
20018
+ {
20019
+ type: "function",
20020
+ name: "approveManager",
19893
20021
  inputs: [
19894
20022
  {
19895
- indexed: true,
19896
- internalType: "address",
19897
20023
  name: "_managerImplementation",
19898
20024
  type: "address",
20025
+ internalType: "address",
19899
20026
  },
19900
20027
  ],
19901
- name: "ManagerImplementationApproved",
19902
- type: "event",
20028
+ outputs: [],
20029
+ stateMutability: "nonpayable",
19903
20030
  },
19904
20031
  {
19905
- anonymous: false,
20032
+ type: "function",
20033
+ name: "approvedManagerImplementation",
19906
20034
  inputs: [
19907
20035
  {
19908
- indexed: true,
19909
- internalType: "address",
19910
20036
  name: "_managerImplementation",
19911
20037
  type: "address",
20038
+ internalType: "address",
19912
20039
  },
19913
20040
  ],
19914
- name: "ManagerImplementationUnapproved",
19915
- type: "event",
20041
+ outputs: [{ name: "_approved", type: "bool", internalType: "bool" }],
20042
+ stateMutability: "view",
19916
20043
  },
19917
20044
  {
19918
- anonymous: false,
19919
- inputs: [
19920
- {
19921
- indexed: true,
19922
- internalType: "address",
19923
- name: "pendingOwner",
19924
- type: "address",
19925
- },
19926
- ],
19927
- name: "OwnershipHandoverCanceled",
19928
- type: "event",
20045
+ type: "function",
20046
+ name: "cancelOwnershipHandover",
20047
+ inputs: [],
20048
+ outputs: [],
20049
+ stateMutability: "payable",
19929
20050
  },
19930
20051
  {
19931
- anonymous: false,
20052
+ type: "function",
20053
+ name: "completeOwnershipHandover",
19932
20054
  inputs: [
19933
- {
19934
- indexed: true,
19935
- internalType: "address",
19936
- name: "pendingOwner",
19937
- type: "address",
19938
- },
20055
+ { name: "pendingOwner", type: "address", internalType: "address" },
19939
20056
  ],
19940
- name: "OwnershipHandoverRequested",
19941
- type: "event",
20057
+ outputs: [],
20058
+ stateMutability: "payable",
19942
20059
  },
19943
20060
  {
19944
- anonymous: false,
20061
+ type: "function",
20062
+ name: "deployAndInitializeManager",
19945
20063
  inputs: [
19946
20064
  {
19947
- indexed: true,
19948
- internalType: "address",
19949
- name: "oldOwner",
20065
+ name: "_managerImplementation",
19950
20066
  type: "address",
19951
- },
19952
- {
19953
- indexed: true,
19954
20067
  internalType: "address",
19955
- name: "newOwner",
19956
- type: "address",
19957
20068
  },
20069
+ { name: "_owner", type: "address", internalType: "address" },
20070
+ { name: "_data", type: "bytes", internalType: "bytes" },
19958
20071
  ],
19959
- name: "OwnershipTransferred",
19960
- type: "event",
19961
- },
19962
- {
19963
- anonymous: false,
19964
- inputs: [
19965
- { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
19966
- {
19967
- indexed: true,
19968
- internalType: "bytes32",
19969
- name: "previousAdminRole",
19970
- type: "bytes32",
19971
- },
20072
+ outputs: [
19972
20073
  {
19973
- indexed: true,
19974
- internalType: "bytes32",
19975
- name: "newAdminRole",
19976
- type: "bytes32",
20074
+ name: "manager_",
20075
+ type: "address",
20076
+ internalType: "address payable",
19977
20077
  },
19978
20078
  ],
19979
- name: "RoleAdminChanged",
19980
- type: "event",
20079
+ stateMutability: "nonpayable",
19981
20080
  },
19982
20081
  {
19983
- anonymous: false,
20082
+ type: "function",
20083
+ name: "deployAndInitializeManager",
19984
20084
  inputs: [
19985
- { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
19986
20085
  {
19987
- indexed: true,
19988
- internalType: "address",
19989
- name: "account",
20086
+ name: "_managerImplementation",
19990
20087
  type: "address",
20088
+ internalType: "address",
19991
20089
  },
20090
+ { name: "_owner", type: "address", internalType: "address" },
20091
+ { name: "_data", type: "bytes", internalType: "bytes" },
20092
+ { name: "_permissions", type: "address", internalType: "address" },
20093
+ ],
20094
+ outputs: [
19992
20095
  {
19993
- indexed: true,
19994
- internalType: "address",
19995
- name: "sender",
20096
+ name: "manager_",
19996
20097
  type: "address",
20098
+ internalType: "address payable",
19997
20099
  },
19998
20100
  ],
19999
- name: "RoleGranted",
20000
- type: "event",
20101
+ stateMutability: "nonpayable",
20001
20102
  },
20002
20103
  {
20003
- anonymous: false,
20104
+ type: "function",
20105
+ name: "deployManager",
20004
20106
  inputs: [
20005
- { indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
20006
20107
  {
20007
- indexed: true,
20008
- internalType: "address",
20009
- name: "account",
20108
+ name: "_managerImplementation",
20010
20109
  type: "address",
20110
+ internalType: "address",
20011
20111
  },
20112
+ ],
20113
+ outputs: [
20012
20114
  {
20013
- indexed: true,
20014
- internalType: "address",
20015
- name: "sender",
20115
+ name: "manager_",
20016
20116
  type: "address",
20117
+ internalType: "address payable",
20017
20118
  },
20018
20119
  ],
20019
- name: "RoleRevoked",
20020
- type: "event",
20120
+ stateMutability: "nonpayable",
20021
20121
  },
20022
20122
  {
20123
+ type: "function",
20124
+ name: "feeEscrow",
20023
20125
  inputs: [],
20024
- name: "DEFAULT_ADMIN_ROLE",
20025
- outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
20126
+ outputs: [
20127
+ { name: "", type: "address", internalType: "contract IFeeEscrow" },
20128
+ ],
20026
20129
  stateMutability: "view",
20130
+ },
20131
+ {
20027
20132
  type: "function",
20133
+ name: "getRoleAdmin",
20134
+ inputs: [{ name: "role", type: "bytes32", internalType: "bytes32" }],
20135
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
20136
+ stateMutability: "view",
20028
20137
  },
20029
20138
  {
20139
+ type: "function",
20140
+ name: "grantRole",
20030
20141
  inputs: [
20031
- {
20032
- internalType: "address",
20033
- name: "_managerImplementation",
20034
- type: "address",
20035
- },
20142
+ { name: "role", type: "bytes32", internalType: "bytes32" },
20143
+ { name: "account", type: "address", internalType: "address" },
20036
20144
  ],
20037
- name: "approveManager",
20038
20145
  outputs: [],
20039
20146
  stateMutability: "nonpayable",
20040
- type: "function",
20041
20147
  },
20042
20148
  {
20149
+ type: "function",
20150
+ name: "hasRole",
20043
20151
  inputs: [
20152
+ { name: "role", type: "bytes32", internalType: "bytes32" },
20153
+ { name: "account", type: "address", internalType: "address" },
20154
+ ],
20155
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
20156
+ stateMutability: "view",
20157
+ },
20158
+ {
20159
+ type: "function",
20160
+ name: "managerImplementation",
20161
+ inputs: [{ name: "_manager", type: "address", internalType: "address" }],
20162
+ outputs: [
20044
20163
  {
20045
- internalType: "address",
20046
20164
  name: "_managerImplementation",
20047
20165
  type: "address",
20166
+ internalType: "address",
20048
20167
  },
20049
20168
  ],
20050
- name: "approvedManagerImplementation",
20051
- outputs: [{ internalType: "bool", name: "_approved", type: "bool" }],
20052
20169
  stateMutability: "view",
20053
- type: "function",
20054
20170
  },
20055
20171
  {
20056
- inputs: [],
20057
- name: "cancelOwnershipHandover",
20058
- outputs: [],
20059
- stateMutability: "payable",
20060
20172
  type: "function",
20173
+ name: "owner",
20174
+ inputs: [],
20175
+ outputs: [{ name: "result", type: "address", internalType: "address" }],
20176
+ stateMutability: "view",
20061
20177
  },
20062
20178
  {
20179
+ type: "function",
20180
+ name: "ownershipHandoverExpiresAt",
20063
20181
  inputs: [
20064
- { internalType: "address", name: "pendingOwner", type: "address" },
20182
+ { name: "pendingOwner", type: "address", internalType: "address" },
20065
20183
  ],
20066
- name: "completeOwnershipHandover",
20184
+ outputs: [{ name: "result", type: "uint256", internalType: "uint256" }],
20185
+ stateMutability: "view",
20186
+ },
20187
+ {
20188
+ type: "function",
20189
+ name: "renounceOwnership",
20190
+ inputs: [],
20067
20191
  outputs: [],
20068
20192
  stateMutability: "payable",
20069
- type: "function",
20070
20193
  },
20071
20194
  {
20195
+ type: "function",
20196
+ name: "renounceRole",
20072
20197
  inputs: [
20198
+ { name: "role", type: "bytes32", internalType: "bytes32" },
20073
20199
  {
20074
- internalType: "address",
20075
- name: "_managerImplementation",
20200
+ name: "callerConfirmation",
20076
20201
  type: "address",
20202
+ internalType: "address",
20077
20203
  },
20078
- { internalType: "address", name: "_owner", type: "address" },
20079
- { internalType: "bytes", name: "_data", type: "bytes" },
20080
- ],
20081
- name: "deployAndInitializeManager",
20082
- outputs: [
20083
- { internalType: "address payable", name: "manager_", type: "address" },
20084
20204
  ],
20205
+ outputs: [],
20085
20206
  stateMutability: "nonpayable",
20207
+ },
20208
+ {
20086
20209
  type: "function",
20210
+ name: "requestOwnershipHandover",
20211
+ inputs: [],
20212
+ outputs: [],
20213
+ stateMutability: "payable",
20087
20214
  },
20088
20215
  {
20216
+ type: "function",
20217
+ name: "revokeRole",
20089
20218
  inputs: [
20090
- {
20091
- internalType: "address",
20092
- name: "_managerImplementation",
20093
- type: "address",
20094
- },
20095
- ],
20096
- name: "deployManager",
20097
- outputs: [
20098
- { internalType: "address payable", name: "manager_", type: "address" },
20219
+ { name: "role", type: "bytes32", internalType: "bytes32" },
20220
+ { name: "account", type: "address", internalType: "address" },
20099
20221
  ],
20222
+ outputs: [],
20100
20223
  stateMutability: "nonpayable",
20101
- type: "function",
20102
20224
  },
20103
20225
  {
20104
- inputs: [],
20105
- name: "feeEscrow",
20106
- outputs: [
20107
- { internalType: "contract IFeeEscrow", name: "", type: "address" },
20108
- ],
20109
- stateMutability: "view",
20110
20226
  type: "function",
20227
+ name: "supportsInterface",
20228
+ inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }],
20229
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
20230
+ stateMutability: "view",
20111
20231
  },
20112
20232
  {
20113
- inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
20114
- name: "getRoleAdmin",
20115
- outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
20116
- stateMutability: "view",
20117
20233
  type: "function",
20234
+ name: "transferOwnership",
20235
+ inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
20236
+ outputs: [],
20237
+ stateMutability: "payable",
20118
20238
  },
20119
20239
  {
20240
+ type: "function",
20241
+ name: "unapproveManager",
20120
20242
  inputs: [
20121
- { internalType: "bytes32", name: "role", type: "bytes32" },
20122
- { internalType: "address", name: "account", type: "address" },
20243
+ {
20244
+ name: "_managerImplementation",
20245
+ type: "address",
20246
+ internalType: "address",
20247
+ },
20123
20248
  ],
20124
- name: "grantRole",
20125
20249
  outputs: [],
20126
20250
  stateMutability: "nonpayable",
20127
- type: "function",
20128
20251
  },
20129
20252
  {
20253
+ type: "event",
20254
+ name: "ManagerDeployed",
20130
20255
  inputs: [
20131
- { internalType: "bytes32", name: "role", type: "bytes32" },
20132
- { internalType: "address", name: "account", type: "address" },
20133
- ],
20134
- name: "hasRole",
20135
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
20136
- stateMutability: "view",
20137
- type: "function",
20138
- },
20139
- {
20140
- inputs: [{ internalType: "address", name: "_manager", type: "address" }],
20141
- name: "managerImplementation",
20142
- outputs: [
20143
20256
  {
20257
+ name: "_manager",
20258
+ type: "address",
20259
+ indexed: true,
20144
20260
  internalType: "address",
20261
+ },
20262
+ {
20145
20263
  name: "_managerImplementation",
20146
20264
  type: "address",
20265
+ indexed: true,
20266
+ internalType: "address",
20147
20267
  },
20148
20268
  ],
20149
- stateMutability: "view",
20150
- type: "function",
20151
- },
20152
- {
20153
- inputs: [],
20154
- name: "owner",
20155
- outputs: [{ internalType: "address", name: "result", type: "address" }],
20156
- stateMutability: "view",
20157
- type: "function",
20269
+ anonymous: false,
20158
20270
  },
20159
20271
  {
20272
+ type: "event",
20273
+ name: "ManagerImplementationApproved",
20160
20274
  inputs: [
20161
- { internalType: "address", name: "pendingOwner", type: "address" },
20275
+ {
20276
+ name: "_managerImplementation",
20277
+ type: "address",
20278
+ indexed: true,
20279
+ internalType: "address",
20280
+ },
20162
20281
  ],
20163
- name: "ownershipHandoverExpiresAt",
20164
- outputs: [{ internalType: "uint256", name: "result", type: "uint256" }],
20165
- stateMutability: "view",
20166
- type: "function",
20282
+ anonymous: false,
20167
20283
  },
20168
20284
  {
20169
- inputs: [],
20170
- name: "renounceOwnership",
20171
- outputs: [],
20172
- stateMutability: "payable",
20173
- type: "function",
20285
+ type: "event",
20286
+ name: "ManagerImplementationUnapproved",
20287
+ inputs: [
20288
+ {
20289
+ name: "_managerImplementation",
20290
+ type: "address",
20291
+ indexed: true,
20292
+ internalType: "address",
20293
+ },
20294
+ ],
20295
+ anonymous: false,
20174
20296
  },
20175
20297
  {
20298
+ type: "event",
20299
+ name: "OwnershipHandoverCanceled",
20176
20300
  inputs: [
20177
- { internalType: "bytes32", name: "role", type: "bytes32" },
20178
- { internalType: "address", name: "callerConfirmation", type: "address" },
20301
+ {
20302
+ name: "pendingOwner",
20303
+ type: "address",
20304
+ indexed: true,
20305
+ internalType: "address",
20306
+ },
20179
20307
  ],
20180
- name: "renounceRole",
20181
- outputs: [],
20182
- stateMutability: "nonpayable",
20183
- type: "function",
20308
+ anonymous: false,
20184
20309
  },
20185
20310
  {
20186
- inputs: [],
20187
- name: "requestOwnershipHandover",
20188
- outputs: [],
20189
- stateMutability: "payable",
20190
- type: "function",
20311
+ type: "event",
20312
+ name: "OwnershipHandoverRequested",
20313
+ inputs: [
20314
+ {
20315
+ name: "pendingOwner",
20316
+ type: "address",
20317
+ indexed: true,
20318
+ internalType: "address",
20319
+ },
20320
+ ],
20321
+ anonymous: false,
20191
20322
  },
20192
20323
  {
20324
+ type: "event",
20325
+ name: "OwnershipTransferred",
20193
20326
  inputs: [
20194
- { internalType: "bytes32", name: "role", type: "bytes32" },
20195
- { internalType: "address", name: "account", type: "address" },
20327
+ {
20328
+ name: "oldOwner",
20329
+ type: "address",
20330
+ indexed: true,
20331
+ internalType: "address",
20332
+ },
20333
+ {
20334
+ name: "newOwner",
20335
+ type: "address",
20336
+ indexed: true,
20337
+ internalType: "address",
20338
+ },
20196
20339
  ],
20197
- name: "revokeRole",
20198
- outputs: [],
20199
- stateMutability: "nonpayable",
20200
- type: "function",
20340
+ anonymous: false,
20201
20341
  },
20202
20342
  {
20203
- inputs: [{ internalType: "bytes4", name: "interfaceId", type: "bytes4" }],
20204
- name: "supportsInterface",
20205
- outputs: [{ internalType: "bool", name: "", type: "bool" }],
20206
- stateMutability: "view",
20207
- type: "function",
20343
+ type: "event",
20344
+ name: "RoleAdminChanged",
20345
+ inputs: [
20346
+ {
20347
+ name: "role",
20348
+ type: "bytes32",
20349
+ indexed: true,
20350
+ internalType: "bytes32",
20351
+ },
20352
+ {
20353
+ name: "previousAdminRole",
20354
+ type: "bytes32",
20355
+ indexed: true,
20356
+ internalType: "bytes32",
20357
+ },
20358
+ {
20359
+ name: "newAdminRole",
20360
+ type: "bytes32",
20361
+ indexed: true,
20362
+ internalType: "bytes32",
20363
+ },
20364
+ ],
20365
+ anonymous: false,
20208
20366
  },
20209
20367
  {
20210
- inputs: [{ internalType: "address", name: "newOwner", type: "address" }],
20211
- name: "transferOwnership",
20212
- outputs: [],
20213
- stateMutability: "payable",
20214
- type: "function",
20368
+ type: "event",
20369
+ name: "RoleGranted",
20370
+ inputs: [
20371
+ {
20372
+ name: "role",
20373
+ type: "bytes32",
20374
+ indexed: true,
20375
+ internalType: "bytes32",
20376
+ },
20377
+ {
20378
+ name: "account",
20379
+ type: "address",
20380
+ indexed: true,
20381
+ internalType: "address",
20382
+ },
20383
+ {
20384
+ name: "sender",
20385
+ type: "address",
20386
+ indexed: true,
20387
+ internalType: "address",
20388
+ },
20389
+ ],
20390
+ anonymous: false,
20215
20391
  },
20216
20392
  {
20393
+ type: "event",
20394
+ name: "RoleRevoked",
20217
20395
  inputs: [
20218
20396
  {
20397
+ name: "role",
20398
+ type: "bytes32",
20399
+ indexed: true,
20400
+ internalType: "bytes32",
20401
+ },
20402
+ {
20403
+ name: "account",
20404
+ type: "address",
20405
+ indexed: true,
20219
20406
  internalType: "address",
20220
- name: "_managerImplementation",
20407
+ },
20408
+ {
20409
+ name: "sender",
20221
20410
  type: "address",
20411
+ indexed: true,
20412
+ internalType: "address",
20222
20413
  },
20223
20414
  ],
20224
- name: "unapproveManager",
20225
- outputs: [],
20226
- stateMutability: "nonpayable",
20227
- type: "function",
20415
+ anonymous: false,
20228
20416
  },
20417
+ { type: "error", name: "AccessControlBadConfirmation", inputs: [] },
20418
+ {
20419
+ type: "error",
20420
+ name: "AccessControlUnauthorizedAccount",
20421
+ inputs: [
20422
+ { name: "account", type: "address", internalType: "address" },
20423
+ { name: "neededRole", type: "bytes32", internalType: "bytes32" },
20424
+ ],
20425
+ },
20426
+ { type: "error", name: "AlreadyInitialized", inputs: [] },
20427
+ { type: "error", name: "NewOwnerIsZeroAddress", inputs: [] },
20428
+ { type: "error", name: "NoHandoverRequest", inputs: [] },
20429
+ { type: "error", name: "Unauthorized", inputs: [] },
20430
+ { type: "error", name: "UnknownManagerImplemention", inputs: [] },
20229
20431
  ];
20230
20432
 
20433
+ const chainIdToChain = {
20434
+ [base.id]: base,
20435
+ [baseSepolia.id]: baseSepolia,
20436
+ };
20437
+
20231
20438
  class ReadTreasuryManagerFactory {
20232
- constructor(address, drift = createDrift$1()) {
20439
+ constructor(chainId, address, drift = createDrift$1()) {
20233
20440
  if (!address) {
20234
20441
  throw new Error("Address is required");
20235
20442
  }
@@ -20237,21 +20444,46 @@ class ReadTreasuryManagerFactory {
20237
20444
  abi: TreasuryManagerFactoryAbi,
20238
20445
  address,
20239
20446
  });
20447
+ this.chainId = chainId;
20448
+ }
20449
+ async getManagerDeployedAddressFromTx(hash) {
20450
+ // Create a public client to get the transaction receipt with logs
20451
+ const publicClient = createPublicClient({
20452
+ chain: chainIdToChain[this.chainId],
20453
+ transport: http(),
20454
+ });
20455
+ // Wait for transaction receipt
20456
+ const receipt = await publicClient.waitForTransactionReceipt({ hash });
20457
+ // Get the logs from the receipt and find the ManagerDeployed event
20458
+ const events = await publicClient.getContractEvents({
20459
+ address: this.contract.address,
20460
+ abi: TreasuryManagerFactoryAbi,
20461
+ eventName: "ManagerDeployed",
20462
+ fromBlock: receipt.blockNumber,
20463
+ toBlock: receipt.blockNumber,
20464
+ });
20465
+ // Find the event from our transaction
20466
+ const event = events.find((e) => e.transactionHash === hash);
20467
+ if (!event) {
20468
+ throw new Error("ManagerDeployed event not found in transaction logs");
20469
+ }
20470
+ return event.args._manager;
20240
20471
  }
20241
20472
  }
20242
20473
  class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
20243
20474
  constructor(chainId, address, drift = createDrift$1()) {
20244
- super(address, drift);
20245
- this.chainId = chainId;
20475
+ super(chainId, address, drift);
20246
20476
  }
20247
20477
  /**
20248
20478
  * Deploys a new revenue manager
20249
20479
  * @param params - Parameters for deploying the revenue manager
20250
20480
  * @param params.protocolRecipient - The address of the protocol recipient
20251
20481
  * @param params.protocolFeePercent - The percentage of the protocol fee
20482
+ * @param params.permissions - The permissions for the revenue manager
20252
20483
  * @returns Transaction response
20253
20484
  */
20254
20485
  deployRevenueManager(params) {
20486
+ const permissionsAddress = getPermissionsAddress(params.permissions ?? Permissions.OPEN, this.chainId);
20255
20487
  return this.contract.write("deployAndInitializeManager", {
20256
20488
  _managerImplementation: RevenueManagerAddress[this.chainId],
20257
20489
  _owner: params.protocolRecipient,
@@ -20269,6 +20501,48 @@ class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
20269
20501
  protocolFee: BigInt(params.protocolFeePercent * 100), // Convert percentage to basis points
20270
20502
  },
20271
20503
  ]),
20504
+ _permissions: permissionsAddress,
20505
+ });
20506
+ }
20507
+ /**
20508
+ * Deploys a new staking manager
20509
+ * @param params - Parameters for deploying the staking manager
20510
+ * @param params.managerOwner - The address of the manager owner
20511
+ * @param params.stakingToken - The address of the token to be staked
20512
+ * @param params.minEscrowDuration - The minimum duration (in seconds) that the creator's NFT is locked for
20513
+ * @param params.minStakeDuration - The minimum duration (in seconds) that the user's tokens are locked for
20514
+ * @param params.creatorSharePercent - The % share that a creator will earn from their token
20515
+ * @param params.ownerSharePercent - The % share that the manager owner will earn from their token
20516
+ * @param params.permissions - The permissions for the staking manager
20517
+ * @returns Transaction response
20518
+ */
20519
+ deployStakingManager(params) {
20520
+ const permissionsAddress = getPermissionsAddress(params.permissions ?? Permissions.OPEN, this.chainId);
20521
+ const VALID_SHARE_TOTAL = 10000000n; // 5 decimals as BigInt
20522
+ return this.contract.write("deployAndInitializeManager", {
20523
+ _managerImplementation: StakingManagerAddress[this.chainId],
20524
+ _owner: params.managerOwner,
20525
+ _data: encodeAbiParameters([
20526
+ {
20527
+ type: "tuple",
20528
+ components: [
20529
+ { type: "address", name: "stakingToken" },
20530
+ { type: "uint256", name: "minEscrowDuration" },
20531
+ { type: "uint256", name: "minStakeDuration" },
20532
+ { type: "uint256", name: "creatorShare" },
20533
+ { type: "uint256", name: "ownerShare" },
20534
+ ],
20535
+ },
20536
+ ], [
20537
+ {
20538
+ stakingToken: params.stakingToken,
20539
+ minEscrowDuration: params.minEscrowDuration,
20540
+ minStakeDuration: params.minStakeDuration,
20541
+ creatorShare: (BigInt(params.creatorSharePercent) * VALID_SHARE_TOTAL) / 100n,
20542
+ ownerShare: (BigInt(params.ownerSharePercent) * VALID_SHARE_TOTAL) / 100n,
20543
+ },
20544
+ ]),
20545
+ _permissions: permissionsAddress,
20272
20546
  });
20273
20547
  }
20274
20548
  }
@@ -21406,6 +21680,185 @@ class ReadWriteRevenueManager extends ReadRevenueManager {
21406
21680
  }
21407
21681
  }
21408
21682
 
21683
+ const TreasuryManagerAbi = [
21684
+ {
21685
+ type: "function",
21686
+ name: "deposit",
21687
+ inputs: [
21688
+ {
21689
+ name: "_flaunchToken",
21690
+ type: "tuple",
21691
+ internalType: "struct ITreasuryManager.FlaunchToken",
21692
+ components: [
21693
+ {
21694
+ name: "flaunch",
21695
+ type: "address",
21696
+ internalType: "contract Flaunch",
21697
+ },
21698
+ { name: "tokenId", type: "uint256", internalType: "uint256" },
21699
+ ],
21700
+ },
21701
+ { name: "_creator", type: "address", internalType: "address" },
21702
+ { name: "_data", type: "bytes", internalType: "bytes" },
21703
+ ],
21704
+ outputs: [],
21705
+ stateMutability: "nonpayable",
21706
+ },
21707
+ {
21708
+ type: "function",
21709
+ name: "initialize",
21710
+ inputs: [
21711
+ { name: "_owner", type: "address", internalType: "address" },
21712
+ { name: "_data", type: "bytes", internalType: "bytes" },
21713
+ ],
21714
+ outputs: [],
21715
+ stateMutability: "nonpayable",
21716
+ },
21717
+ {
21718
+ type: "function",
21719
+ name: "managerOwner",
21720
+ inputs: [],
21721
+ outputs: [{ name: "", type: "address", internalType: "address" }],
21722
+ stateMutability: "view",
21723
+ },
21724
+ {
21725
+ type: "function",
21726
+ name: "permissions",
21727
+ inputs: [],
21728
+ outputs: [
21729
+ {
21730
+ name: "",
21731
+ type: "address",
21732
+ internalType: "contract IManagerPermissions",
21733
+ },
21734
+ ],
21735
+ stateMutability: "view",
21736
+ },
21737
+ {
21738
+ type: "function",
21739
+ name: "rescue",
21740
+ inputs: [
21741
+ {
21742
+ name: "_flaunchToken",
21743
+ type: "tuple",
21744
+ internalType: "struct ITreasuryManager.FlaunchToken",
21745
+ components: [
21746
+ {
21747
+ name: "flaunch",
21748
+ type: "address",
21749
+ internalType: "contract Flaunch",
21750
+ },
21751
+ { name: "tokenId", type: "uint256", internalType: "uint256" },
21752
+ ],
21753
+ },
21754
+ { name: "_recipient", type: "address", internalType: "address" },
21755
+ ],
21756
+ outputs: [],
21757
+ stateMutability: "nonpayable",
21758
+ },
21759
+ {
21760
+ type: "function",
21761
+ name: "setPermissions",
21762
+ inputs: [
21763
+ { name: "_permissions", type: "address", internalType: "address" },
21764
+ ],
21765
+ outputs: [],
21766
+ stateMutability: "nonpayable",
21767
+ },
21768
+ {
21769
+ type: "function",
21770
+ name: "transferManagerOwnership",
21771
+ inputs: [
21772
+ {
21773
+ name: "_newManagerOwner",
21774
+ type: "address",
21775
+ internalType: "address",
21776
+ },
21777
+ ],
21778
+ outputs: [],
21779
+ stateMutability: "nonpayable",
21780
+ },
21781
+ ];
21782
+
21783
+ /**
21784
+ * Client for interacting with the TreasuryManager contract in read-only mode
21785
+ * Provides methods to query permissions and manager owner
21786
+ */
21787
+ class ReadTreasuryManager {
21788
+ /**
21789
+ * Creates a new ReadTreasuryManager instance
21790
+ * @param address - The address of the TreasuryManager contract
21791
+ * @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
21792
+ * @throws Error if address is not provided
21793
+ */
21794
+ constructor(address, drift = createDrift$1()) {
21795
+ if (!address) {
21796
+ throw new Error("Address is required");
21797
+ }
21798
+ this.contract = drift.contract({
21799
+ abi: TreasuryManagerAbi,
21800
+ address,
21801
+ });
21802
+ }
21803
+ /**
21804
+ * Gets the permissions contract address
21805
+ * @returns Promise<Address> - The address of the permissions contract
21806
+ */
21807
+ permissions() {
21808
+ return this.contract.read("permissions");
21809
+ }
21810
+ /**
21811
+ * Gets the manager owner address
21812
+ * @returns Promise<Address> - The address of the manager owner
21813
+ */
21814
+ managerOwner() {
21815
+ return this.contract.read("managerOwner");
21816
+ }
21817
+ }
21818
+ /**
21819
+ * Extended client for interacting with the TreasuryManager contract with write capabilities
21820
+ * Provides methods to deposit tokens, set permissions, and transfer ownership
21821
+ */
21822
+ class ReadWriteTreasuryManager extends ReadTreasuryManager {
21823
+ constructor(address, drift = createDrift$1()) {
21824
+ super(address, drift);
21825
+ }
21826
+ /**
21827
+ * Deposits a flaunch token to the treasury
21828
+ * @param flaunchToken - The flaunch token to deposit
21829
+ * @param creator - The address of the creator
21830
+ * @param data - Additional data for the deposit
21831
+ * @returns Promise<void>
21832
+ */
21833
+ deposit(flaunchToken, creator, data) {
21834
+ return this.contract.write("deposit", {
21835
+ _flaunchToken: flaunchToken,
21836
+ _creator: creator,
21837
+ _data: data,
21838
+ });
21839
+ }
21840
+ /**
21841
+ * Sets the permissions contract address
21842
+ * @param permissions - The address of the new permissions contract
21843
+ * @returns Promise<void>
21844
+ */
21845
+ setPermissions(permissions) {
21846
+ return this.contract.write("setPermissions", {
21847
+ _permissions: permissions,
21848
+ });
21849
+ }
21850
+ /**
21851
+ * Transfers the manager ownership to a new address
21852
+ * @param newManagerOwner - The address of the new manager owner
21853
+ * @returns Promise<void>
21854
+ */
21855
+ transferManagerOwnership(newManagerOwner) {
21856
+ return this.contract.write("transferManagerOwnership", {
21857
+ _newManagerOwner: newManagerOwner,
21858
+ });
21859
+ }
21860
+ }
21861
+
21409
21862
  // our min/max tick range that is valid for the tick spacing (60)
21410
21863
  const TickFinder = {
21411
21864
  MIN_TICK: -887220,
@@ -21497,11 +21950,6 @@ const calculateUnderlyingTokenBalances = (liquidity, tickLower, tickUpper, tickC
21497
21950
  return { amount0, amount1 };
21498
21951
  };
21499
21952
 
21500
- const chainIdToChain = {
21501
- [base.id]: base,
21502
- [baseSepolia.id]: baseSepolia,
21503
- };
21504
-
21505
21953
  const FastFlaunchZapAbi = [
21506
21954
  {
21507
21955
  inputs: [
@@ -21669,6 +22117,22 @@ class ReadFlaunchSDK {
21669
22117
  return this.readBidWallV1_1;
21670
22118
  }
21671
22119
  }
22120
+ /**
22121
+ * Gets the flaunch contract address for a given version
22122
+ * @param version - The version to get the flaunch contract address for
22123
+ */
22124
+ getFlaunchAddress(version) {
22125
+ switch (version) {
22126
+ case FlaunchVersion.V1:
22127
+ return this.readFlaunch.contract.address;
22128
+ case FlaunchVersion.V1_1:
22129
+ return this.readFlaunchV1_1.contract.address;
22130
+ case FlaunchVersion.ANY:
22131
+ return this.readFlaunchV1_1.contract.address;
22132
+ default:
22133
+ return this.readFlaunchV1_1.contract.address;
22134
+ }
22135
+ }
21672
22136
  getPositionManagerAddress(version) {
21673
22137
  return this.getPositionManager(version).contract.address;
21674
22138
  }
@@ -22188,6 +22652,22 @@ class ReadFlaunchSDK {
22188
22652
  const readRevenueManager = new ReadRevenueManager(params.revenueManagerAddress, this.drift);
22189
22653
  return readRevenueManager.allTokensInManager(params.sortByDesc);
22190
22654
  }
22655
+ /**
22656
+ * Gets treasury manager information including owner and permissions
22657
+ * @param treasuryManagerAddress - The address of the treasury manager
22658
+ * @returns Promise<{managerOwner: Address, permissions: Address}> - Treasury manager owner and permissions contract addresses
22659
+ */
22660
+ async treasuryManagerInfo(treasuryManagerAddress) {
22661
+ const readTreasuryManager = new ReadTreasuryManager(treasuryManagerAddress, this.drift);
22662
+ const [managerOwner, permissions] = await Promise.all([
22663
+ readTreasuryManager.managerOwner(),
22664
+ readTreasuryManager.permissions(),
22665
+ ]);
22666
+ return {
22667
+ managerOwner,
22668
+ permissions,
22669
+ };
22670
+ }
22191
22671
  /**
22192
22672
  * Gets the pool ID for a given coin
22193
22673
  * @param coinAddress - The address of the coin
@@ -22323,6 +22803,22 @@ class ReadFlaunchSDK {
22323
22803
  tokenImporterVerifyMemecoin(memecoin) {
22324
22804
  return this.readTokenImporter.verifyMemecoin(memecoin);
22325
22805
  }
22806
+ /**
22807
+ * Checks if an operator is approved for all flaunch tokens of an owner
22808
+ * @param version - The flaunch version to determine the correct contract address
22809
+ * @param owner - The owner address to check
22810
+ * @param operator - The operator address to check
22811
+ * @returns Promise<boolean> - True if operator is approved for all tokens
22812
+ */
22813
+ async isFlaunchTokenApprovedForAll(version, owner, operator) {
22814
+ const flaunchAddress = this.getFlaunchAddress(version);
22815
+ return this.drift.read({
22816
+ abi: erc721Abi,
22817
+ address: flaunchAddress,
22818
+ fn: "isApprovedForAll",
22819
+ args: { owner, operator },
22820
+ });
22821
+ }
22326
22822
  }
22327
22823
  class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
22328
22824
  constructor(chainId, drift = createDrift$1()) {
@@ -22342,31 +22838,28 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
22342
22838
  * @param params - Parameters for deploying the revenue manager
22343
22839
  * @param params.protocolRecipient - The address of the protocol recipient
22344
22840
  * @param params.protocolFeePercent - The percentage of the protocol fee
22841
+ * @param params.permissions - The permissions for the revenue manager
22345
22842
  * @returns Address of the deployed revenue manager
22346
22843
  */
22347
22844
  async deployRevenueManager(params) {
22348
22845
  const hash = await this.readWriteTreasuryManagerFactory.deployRevenueManager(params);
22349
- // Create a public client to get the transaction receipt with logs
22350
- const publicClient = createPublicClient({
22351
- chain: chainIdToChain[this.chainId],
22352
- transport: http(),
22353
- });
22354
- // Wait for transaction receipt
22355
- const receipt = await publicClient.waitForTransactionReceipt({ hash });
22356
- // Get the logs from the receipt and find the ManagerDeployed event
22357
- const events = await publicClient.getContractEvents({
22358
- address: this.readWriteTreasuryManagerFactory.contract.address,
22359
- abi: TreasuryManagerFactoryAbi,
22360
- eventName: "ManagerDeployed",
22361
- fromBlock: receipt.blockNumber,
22362
- toBlock: receipt.blockNumber,
22363
- });
22364
- // Find the event from our transaction
22365
- const event = events.find((e) => e.transactionHash === hash);
22366
- if (!event) {
22367
- throw new Error("ManagerDeployed event not found in transaction logs");
22368
- }
22369
- return event.args._manager;
22846
+ return await this.readWriteTreasuryManagerFactory.getManagerDeployedAddressFromTx(hash);
22847
+ }
22848
+ /**
22849
+ * Deploys a new staking manager
22850
+ * @param params - Parameters for deploying the staking manager
22851
+ * @param params.managerOwner - The address of the manager owner
22852
+ * @param params.stakingToken - The address of the token to be staked
22853
+ * @param params.minEscrowDuration - The minimum duration (in seconds) that the creator's NFT is locked for
22854
+ * @param params.minStakeDuration - The minimum duration (in seconds) that the user's tokens are locked for
22855
+ * @param params.creatorSharePercent - The % share that a creator will earn from their token
22856
+ * @param params.ownerSharePercent - The % share that the manager owner will earn from their token
22857
+ * @param params.permissions - The permissions for the staking manager
22858
+ * @returns Address of the deployed staking manager
22859
+ */
22860
+ async deployStakingManager(params) {
22861
+ const hash = await this.readWriteTreasuryManagerFactory.deployStakingManager(params);
22862
+ return await this.readWriteTreasuryManagerFactory.getManagerDeployedAddressFromTx(hash);
22370
22863
  }
22371
22864
  /**
22372
22865
  * Creates a new Flaunch on the specified version
@@ -22621,6 +23114,63 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
22621
23114
  const readWriteRevenueManager = new ReadWriteRevenueManager(params.revenueManagerAddress, this.drift);
22622
23115
  return readWriteRevenueManager.creatorClaimForTokens(params.flaunchTokens);
22623
23116
  }
23117
+ /**
23118
+ * Sets the permissions contract address for a treasury manager
23119
+ * @param treasuryManagerAddress - The address of the treasury manager
23120
+ * @param permissions - The permissions enum value to set
23121
+ * @returns Transaction response
23122
+ */
23123
+ treasuryManagerSetPermissions(treasuryManagerAddress, permissions) {
23124
+ const readWriteTreasuryManager = new ReadWriteTreasuryManager(treasuryManagerAddress, this.drift);
23125
+ const permissionsAddress = getPermissionsAddress(permissions, this.chainId);
23126
+ return readWriteTreasuryManager.setPermissions(permissionsAddress);
23127
+ }
23128
+ /**
23129
+ * Transfers the ownership of a treasury manager to a new address
23130
+ * @param treasuryManagerAddress - The address of the treasury manager
23131
+ * @param newManagerOwner - The address of the new manager owner
23132
+ * @returns Transaction response
23133
+ */
23134
+ treasuryManagerTransferOwnership(treasuryManagerAddress, newManagerOwner) {
23135
+ const readWriteTreasuryManager = new ReadWriteTreasuryManager(treasuryManagerAddress, this.drift);
23136
+ return readWriteTreasuryManager.transferManagerOwnership(newManagerOwner);
23137
+ }
23138
+ /**
23139
+ * Sets approval for all flaunch tokens to an operator
23140
+ * @param version - The flaunch version to determine the correct contract address
23141
+ * @param operator - The operator address to approve/revoke
23142
+ * @param approved - Whether to approve or revoke approval
23143
+ * @returns Transaction response
23144
+ */
23145
+ async setFlaunchTokenApprovalForAll(version, operator, approved) {
23146
+ const flaunchAddress = this.getFlaunchAddress(version);
23147
+ return this.drift.write({
23148
+ abi: erc721Abi,
23149
+ address: flaunchAddress,
23150
+ fn: "setApprovalForAll",
23151
+ args: { operator, approved },
23152
+ });
23153
+ }
23154
+ /**
23155
+ * Adds an existing flaunch token to a treasury manager. NFT approval must be given prior to calling this function.
23156
+ * @param treasuryManagerAddress - The address of the treasury manager
23157
+ * @param version - The flaunch version to determine the correct contract address
23158
+ * @param tokenId - The token ID to deposit
23159
+ * @param creator - Optional creator address. If not provided, uses the connected wallet address
23160
+ * @param data - Optional additional data for the deposit (defaults to empty bytes)
23161
+ * @returns Transaction response
23162
+ */
23163
+ async addToTreasuryManager(treasuryManagerAddress, version, tokenId, creator, data = "0x") {
23164
+ const readWriteTreasuryManager = new ReadWriteTreasuryManager(treasuryManagerAddress, this.drift);
23165
+ // Get the flaunch contract address based on version
23166
+ const flaunchAddress = this.getFlaunchAddress(version);
23167
+ const flaunchToken = {
23168
+ flaunch: flaunchAddress,
23169
+ tokenId,
23170
+ };
23171
+ const creatorAddress = creator ?? (await this.drift.getSignerAddress());
23172
+ return readWriteTreasuryManager.deposit(flaunchToken, creatorAddress, data);
23173
+ }
22624
23174
  /**
22625
23175
  * Imports a memecoin into the TokenImporter
22626
23176
  * @param params.memecoin - The address of the memecoin to import
@@ -22677,5 +23227,5 @@ const FlaunchSDK = {
22677
23227
  ReadWriteFlaunchSDK,
22678
23228
  };
22679
23229
 
22680
- export { AddressFeeSplitManagerAddress, AnyBidWallAddress, AnyFlaunchAddress, AnyPositionManagerAbi, AnyPositionManagerAddress, BidWallAddress, BidWallV1_1Abi, BidWallV1_1Address, BidwallAbi, ClankerWorldVerifierAddress, DopplerVerifierAddress, FLETHAddress, FLETHHooksAddress, FairLaunchAbi, FairLaunchAddress, FairLaunchV1_1Abi, FairLaunchV1_1Address, FastFlaunchZapAbi, FastFlaunchZapAddress, FeeEscrowAbi, FeeEscrowAddress, FlaunchAbi, FlaunchAddress, FlaunchPositionManagerAbi, FlaunchPositionManagerAddress, FlaunchPositionManagerV1_1Abi, FlaunchPositionManagerV1_1Address, FlaunchSDK, FlaunchV1_1Abi, FlaunchV1_1Address, FlaunchVersion, FlaunchZapAbi, FlaunchZapAddress, InitialPriceAbi, MemecoinAbi, MulticallAbi, PERMIT_DETAILS, PERMIT_TYPES, Permit2Abi, Permit2Address, PoolManagerAbi, PoolManagerAddress, QuoterAbi, QuoterAddress, ReadFlaunchSDK, ReadWriteFlaunchSDK, ReferralEscrowAbi, ReferralEscrowAddress, RevenueManagerAbi, RevenueManagerAddress, StateViewAbi, StateViewAddress, TICK_SPACING, TickFinder, TokenImporterAddress, TreasuryManagerFactoryAbi, TreasuryManagerFactoryAddress, USDCETHPoolKeys, UniversalRouterAbi, UniversalRouterAddress, Verifier, VirtualsVerifierAddress, WhitelistVerifierAddress, ZoraVerifierAddress, bytes32ToUint256, calculateUnderlyingTokenBalances, chainIdToChain, createDrift, createFlaunch, ethToMemecoin, generateTokenUri, getAmountWithSlippage, getPermit2TypedData, getPoolId, getSqrtPriceX96FromTick, getValidTick, memecoinToEthWithPermit2, orderPoolKey, parseSwapData, resolveIPFS, uint256ToBytes32, uploadFileToIPFS, uploadImageToIPFS, uploadJsonToIPFS };
23230
+ export { AddressFeeSplitManagerAddress, AnyBidWallAddress, AnyFlaunchAddress, AnyPositionManagerAbi, AnyPositionManagerAddress, BidWallAddress, BidWallV1_1Abi, BidWallV1_1Address, BidwallAbi, ClankerWorldVerifierAddress, ClosedPermissionsAddress, DopplerVerifierAddress, FLETHAddress, FLETHHooksAddress, FairLaunchAbi, FairLaunchAddress, FairLaunchV1_1Abi, FairLaunchV1_1Address, FastFlaunchZapAbi, FastFlaunchZapAddress, FeeEscrowAbi, FeeEscrowAddress, FlaunchAbi, FlaunchAddress, FlaunchPositionManagerAbi, FlaunchPositionManagerAddress, FlaunchPositionManagerV1_1Abi, FlaunchPositionManagerV1_1Address, FlaunchSDK, FlaunchV1_1Abi, FlaunchV1_1Address, FlaunchVersion, FlaunchZapAbi, FlaunchZapAddress, InitialPriceAbi, MemecoinAbi, MulticallAbi, PERMIT_DETAILS, PERMIT_TYPES, Permissions, Permit2Abi, Permit2Address, PoolManagerAbi, PoolManagerAddress, QuoterAbi, QuoterAddress, ReadFlaunchSDK, ReadWriteFlaunchSDK, ReferralEscrowAbi, ReferralEscrowAddress, RevenueManagerAbi, RevenueManagerAddress, StakingManagerAddress, StateViewAbi, StateViewAddress, TICK_SPACING, TickFinder, TokenImporterAddress, TreasuryManagerFactoryAbi, TreasuryManagerFactoryAddress, USDCETHPoolKeys, UniversalRouterAbi, UniversalRouterAddress, Verifier, VirtualsVerifierAddress, WhitelistVerifierAddress, WhitelistedPermissionsAddress, ZoraVerifierAddress, bytes32ToUint256, calculateUnderlyingTokenBalances, chainIdToChain, createDrift, createFlaunch, ethToMemecoin, generateTokenUri, getAmountWithSlippage, getPermissionsAddress, getPermit2TypedData, getPoolId, getSqrtPriceX96FromTick, getValidTick, memecoinToEthWithPermit2, orderPoolKey, parseSwapData, resolveIPFS, uint256ToBytes32, uploadFileToIPFS, uploadImageToIPFS, uploadJsonToIPFS };
22681
23231
  //# sourceMappingURL=index.esm.js.map