@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.
- package/dist/abi/FlaunchZap.d.ts +106 -102
- package/dist/abi/FlaunchZap.d.ts.map +1 -1
- package/dist/abi/TreasuryManager.d.ts +106 -0
- package/dist/abi/TreasuryManager.d.ts.map +1 -0
- package/dist/abi/TreasuryManagerFactory.d.ts +268 -242
- package/dist/abi/TreasuryManagerFactory.d.ts.map +1 -1
- package/dist/abi/index.cjs +476 -322
- package/dist/abi/index.cjs.map +1 -1
- package/dist/abi/index.js +476 -322
- package/dist/abi/index.js.map +1 -1
- package/dist/addresses/index.cjs +23 -6
- package/dist/addresses/index.cjs.map +1 -1
- package/dist/addresses/index.js +21 -7
- package/dist/addresses/index.js.map +1 -1
- package/dist/addresses.d.ts +6 -1
- package/dist/addresses.d.ts.map +1 -1
- package/dist/clients/FlaunchZapClient.d.ts +8 -1
- package/dist/clients/FlaunchZapClient.d.ts.map +1 -1
- package/dist/clients/TreasuryManagerClient.d.ts +60 -0
- package/dist/clients/TreasuryManagerClient.d.ts.map +1 -0
- package/dist/clients/TreasuryManagerFactoryClient.d.ts +34 -7
- package/dist/clients/TreasuryManagerFactoryClient.d.ts.map +1 -1
- package/dist/helpers/index.cjs +61 -0
- package/dist/helpers/index.cjs.map +1 -1
- package/dist/helpers/index.d.ts +1 -0
- package/dist/helpers/index.d.ts.map +1 -1
- package/dist/helpers/index.js +62 -2
- package/dist/helpers/index.js.map +1 -1
- package/dist/helpers/permissions.d.ts +10 -0
- package/dist/helpers/permissions.d.ts.map +1 -0
- package/dist/index.cjs.js +935 -381
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +933 -383
- package/dist/index.esm.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/sdk/FlaunchSDK.d.ts +71 -6
- package/dist/sdk/FlaunchSDK.d.ts.map +1 -1
- package/dist/types.d.ts +8 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -5315,7 +5315,7 @@ const sourceId = 5; // goerli
|
|
|
5315
5315
|
testnet: true,
|
|
5316
5316
|
});
|
|
5317
5317
|
|
|
5318
|
-
// doesn't use FeeEscrow
|
|
5318
|
+
// only old V1.0: doesn't use FeeEscrow
|
|
5319
5319
|
const FlaunchPositionManagerAddress = {
|
|
5320
5320
|
[base.id]: "0x51Bba15255406Cfe7099a42183302640ba7dAFDC",
|
|
5321
5321
|
[baseSepolia.id]: "0x9A7059cA00dA92843906Cb4bCa1D005cE848AFdC",
|
|
@@ -5354,6 +5354,16 @@ const ZoraVerifierAddress = {
|
|
|
5354
5354
|
[baseSepolia.id]: "0x05a5763e9199b88bb591c6b112d0424b2cd7a99e",
|
|
5355
5355
|
};
|
|
5356
5356
|
/** ======== */
|
|
5357
|
+
/** Permissions */
|
|
5358
|
+
const ClosedPermissionsAddress = {
|
|
5359
|
+
[base.id]: "0x0000000000000000000000000000000000000000", // TODO: add mainnet address
|
|
5360
|
+
[baseSepolia.id]: "0x551aeD820CAfaca2f9cD1C637AAc076D05a03AC2",
|
|
5361
|
+
};
|
|
5362
|
+
const WhitelistedPermissionsAddress = {
|
|
5363
|
+
[base.id]: "0x0000000000000000000000000000000000000000", // TODO: add mainnet address
|
|
5364
|
+
[baseSepolia.id]: "0xe8691E8f576A98c41EBB5E984207d4F51386621f",
|
|
5365
|
+
};
|
|
5366
|
+
/** =========== */
|
|
5357
5367
|
const FeeEscrowAddress = {
|
|
5358
5368
|
[base.id]: "0x72e6f7948b1B1A343B477F39aAbd2E35E6D27dde",
|
|
5359
5369
|
[baseSepolia.id]: "0x73E27908b7d35A9251a54799A8ef4C17e4ED9FF9",
|
|
@@ -5410,8 +5420,12 @@ const FastFlaunchZapAddress = {
|
|
|
5410
5420
|
[baseSepolia.id]: "0x821d9f6075e7971cc71c379081de9d532f5f9957",
|
|
5411
5421
|
};
|
|
5412
5422
|
const FlaunchZapAddress = {
|
|
5413
|
-
[base.id]: "0xfa9e8528ee95eb109bffd1a2d59cb95b300a672a",
|
|
5414
|
-
[baseSepolia.id]: "
|
|
5423
|
+
[base.id]: "0xfa9e8528ee95eb109bffd1a2d59cb95b300a672a", // TODO: update mainnet address with permissions param
|
|
5424
|
+
[baseSepolia.id]: "0x9AE92E5ad16822F9723be29E58B6019B7fA765c5",
|
|
5425
|
+
};
|
|
5426
|
+
const TreasuryManagerFactoryAddress = {
|
|
5427
|
+
[base.id]: "0x48af8b28DDC5e5A86c4906212fc35Fa808CA8763", // TODO: update mainnet address with permissions param
|
|
5428
|
+
[baseSepolia.id]: "0xb22779fcDB2a1199E6592e0D4BE29A0C8c626246",
|
|
5415
5429
|
};
|
|
5416
5430
|
const RevenueManagerAddress = {
|
|
5417
5431
|
[base.id]: "0x712fa8ddc7347b4b6b029aa21710f365cd02d898",
|
|
@@ -5421,9 +5435,9 @@ const AddressFeeSplitManagerAddress = {
|
|
|
5421
5435
|
[base.id]: "0x6baa4ec493a9698dc7388c0f290e29ea3d149f99",
|
|
5422
5436
|
[baseSepolia.id]: "0xf72dcdee692c188de6b14c6213e849982e04069b",
|
|
5423
5437
|
};
|
|
5424
|
-
const
|
|
5425
|
-
[base.id]: "
|
|
5426
|
-
[baseSepolia.id]: "
|
|
5438
|
+
const StakingManagerAddress = {
|
|
5439
|
+
[base.id]: "0x0000000000000000000000000000000000000000", // TODO: update mainnet address
|
|
5440
|
+
[baseSepolia.id]: "0x4a59dBAd29981A39BE597081f7f5071843552158",
|
|
5427
5441
|
};
|
|
5428
5442
|
const PoolManagerAddress = {
|
|
5429
5443
|
[base.id]: "0x498581fF718922c3f8e6A244956aF099B2652b2b",
|
|
@@ -10811,237 +10825,387 @@ class AnyBidWall {
|
|
|
10811
10825
|
|
|
10812
10826
|
const FlaunchZapAbi = [
|
|
10813
10827
|
{
|
|
10828
|
+
type: "constructor",
|
|
10814
10829
|
inputs: [
|
|
10815
10830
|
{
|
|
10816
|
-
internalType: "contract PositionManager",
|
|
10817
10831
|
name: "_positionManager",
|
|
10818
10832
|
type: "address",
|
|
10833
|
+
internalType: "contract PositionManager",
|
|
10819
10834
|
},
|
|
10820
10835
|
{
|
|
10821
|
-
internalType: "contract Flaunch",
|
|
10822
10836
|
name: "_flaunchContract",
|
|
10823
10837
|
type: "address",
|
|
10838
|
+
internalType: "contract Flaunch",
|
|
10839
|
+
},
|
|
10840
|
+
{
|
|
10841
|
+
name: "_flETH",
|
|
10842
|
+
type: "address",
|
|
10843
|
+
internalType: "contract IFLETH",
|
|
10844
|
+
},
|
|
10845
|
+
{
|
|
10846
|
+
name: "_poolSwap",
|
|
10847
|
+
type: "address",
|
|
10848
|
+
internalType: "contract PoolSwap",
|
|
10824
10849
|
},
|
|
10825
|
-
{ internalType: "contract IFLETH", name: "_flETH", type: "address" },
|
|
10826
|
-
{ internalType: "contract PoolSwap", name: "_poolSwap", type: "address" },
|
|
10827
10850
|
{
|
|
10828
|
-
internalType: "contract ITreasuryManagerFactory",
|
|
10829
10851
|
name: "_treasuryManagerFactory",
|
|
10830
10852
|
type: "address",
|
|
10853
|
+
internalType: "contract ITreasuryManagerFactory",
|
|
10831
10854
|
},
|
|
10832
10855
|
{
|
|
10833
|
-
internalType: "contract IMerkleAirdrop",
|
|
10834
10856
|
name: "_merkleAirdrop",
|
|
10835
10857
|
type: "address",
|
|
10858
|
+
internalType: "contract IMerkleAirdrop",
|
|
10836
10859
|
},
|
|
10837
10860
|
{
|
|
10838
|
-
internalType: "contract WhitelistFairLaunch",
|
|
10839
10861
|
name: "_whitelistFairLaunch",
|
|
10840
10862
|
type: "address",
|
|
10863
|
+
internalType: "contract WhitelistFairLaunch",
|
|
10841
10864
|
},
|
|
10842
10865
|
],
|
|
10843
10866
|
stateMutability: "nonpayable",
|
|
10844
|
-
type: "constructor",
|
|
10845
10867
|
},
|
|
10846
|
-
{
|
|
10847
|
-
{ inputs: [], name: "InsufficientMemecoinsForAirdrop", type: "error" },
|
|
10868
|
+
{ type: "receive", stateMutability: "payable" },
|
|
10848
10869
|
{
|
|
10870
|
+
type: "function",
|
|
10871
|
+
name: "calculateFee",
|
|
10849
10872
|
inputs: [
|
|
10850
|
-
{
|
|
10851
|
-
|
|
10852
|
-
|
|
10873
|
+
{
|
|
10874
|
+
name: "_premineAmount",
|
|
10875
|
+
type: "uint256",
|
|
10876
|
+
internalType: "uint256",
|
|
10877
|
+
},
|
|
10878
|
+
{ name: "_slippage", type: "uint256", internalType: "uint256" },
|
|
10879
|
+
{
|
|
10880
|
+
name: "_initialPriceParams",
|
|
10881
|
+
type: "bytes",
|
|
10882
|
+
internalType: "bytes",
|
|
10883
|
+
},
|
|
10853
10884
|
],
|
|
10854
|
-
name: "calculateFee",
|
|
10855
10885
|
outputs: [
|
|
10856
|
-
{
|
|
10886
|
+
{ name: "ethRequired_", type: "uint256", internalType: "uint256" },
|
|
10857
10887
|
],
|
|
10858
10888
|
stateMutability: "view",
|
|
10859
|
-
type: "function",
|
|
10860
10889
|
},
|
|
10861
10890
|
{
|
|
10862
|
-
|
|
10891
|
+
type: "function",
|
|
10863
10892
|
name: "flETH",
|
|
10864
|
-
|
|
10893
|
+
inputs: [],
|
|
10894
|
+
outputs: [{ name: "", type: "address", internalType: "contract IFLETH" }],
|
|
10865
10895
|
stateMutability: "view",
|
|
10866
|
-
type: "function",
|
|
10867
10896
|
},
|
|
10868
10897
|
{
|
|
10898
|
+
type: "function",
|
|
10899
|
+
name: "flaunch",
|
|
10869
10900
|
inputs: [
|
|
10870
10901
|
{
|
|
10902
|
+
name: "_flaunchParams",
|
|
10903
|
+
type: "tuple",
|
|
10904
|
+
internalType: "struct PositionManager.FlaunchParams",
|
|
10871
10905
|
components: [
|
|
10872
|
-
{
|
|
10873
|
-
{
|
|
10874
|
-
{
|
|
10906
|
+
{ name: "name", type: "string", internalType: "string" },
|
|
10907
|
+
{ name: "symbol", type: "string", internalType: "string" },
|
|
10908
|
+
{ name: "tokenUri", type: "string", internalType: "string" },
|
|
10875
10909
|
{
|
|
10876
|
-
internalType: "uint256",
|
|
10877
10910
|
name: "initialTokenFairLaunch",
|
|
10878
10911
|
type: "uint256",
|
|
10912
|
+
internalType: "uint256",
|
|
10879
10913
|
},
|
|
10880
10914
|
{
|
|
10881
|
-
internalType: "uint256",
|
|
10882
10915
|
name: "fairLaunchDuration",
|
|
10883
10916
|
type: "uint256",
|
|
10917
|
+
internalType: "uint256",
|
|
10884
10918
|
},
|
|
10885
|
-
{ internalType: "uint256", name: "premineAmount", type: "uint256" },
|
|
10886
|
-
{ internalType: "address", name: "creator", type: "address" },
|
|
10887
10919
|
{
|
|
10888
|
-
|
|
10920
|
+
name: "premineAmount",
|
|
10921
|
+
type: "uint256",
|
|
10922
|
+
internalType: "uint256",
|
|
10923
|
+
},
|
|
10924
|
+
{ name: "creator", type: "address", internalType: "address" },
|
|
10925
|
+
{
|
|
10889
10926
|
name: "creatorFeeAllocation",
|
|
10890
10927
|
type: "uint24",
|
|
10928
|
+
internalType: "uint24",
|
|
10929
|
+
},
|
|
10930
|
+
{
|
|
10931
|
+
name: "flaunchAt",
|
|
10932
|
+
type: "uint256",
|
|
10933
|
+
internalType: "uint256",
|
|
10934
|
+
},
|
|
10935
|
+
{
|
|
10936
|
+
name: "initialPriceParams",
|
|
10937
|
+
type: "bytes",
|
|
10938
|
+
internalType: "bytes",
|
|
10939
|
+
},
|
|
10940
|
+
{
|
|
10941
|
+
name: "feeCalculatorParams",
|
|
10942
|
+
type: "bytes",
|
|
10943
|
+
internalType: "bytes",
|
|
10891
10944
|
},
|
|
10892
|
-
{ internalType: "uint256", name: "flaunchAt", type: "uint256" },
|
|
10893
|
-
{ internalType: "bytes", name: "initialPriceParams", type: "bytes" },
|
|
10894
|
-
{ internalType: "bytes", name: "feeCalculatorParams", type: "bytes" },
|
|
10895
10945
|
],
|
|
10896
|
-
internalType: "struct PositionManager.FlaunchParams",
|
|
10897
|
-
name: "_flaunchParams",
|
|
10898
|
-
type: "tuple",
|
|
10899
10946
|
},
|
|
10900
10947
|
],
|
|
10901
|
-
name: "flaunch",
|
|
10902
10948
|
outputs: [
|
|
10903
|
-
{
|
|
10904
|
-
{
|
|
10905
|
-
{
|
|
10949
|
+
{ name: "memecoin_", type: "address", internalType: "address" },
|
|
10950
|
+
{ name: "ethSpent_", type: "uint256", internalType: "uint256" },
|
|
10951
|
+
{ name: "", type: "address", internalType: "address" },
|
|
10906
10952
|
],
|
|
10907
10953
|
stateMutability: "payable",
|
|
10908
|
-
type: "function",
|
|
10909
10954
|
},
|
|
10910
10955
|
{
|
|
10956
|
+
type: "function",
|
|
10957
|
+
name: "flaunch",
|
|
10911
10958
|
inputs: [
|
|
10912
10959
|
{
|
|
10960
|
+
name: "_flaunchParams",
|
|
10961
|
+
type: "tuple",
|
|
10962
|
+
internalType: "struct PositionManager.FlaunchParams",
|
|
10913
10963
|
components: [
|
|
10914
|
-
{
|
|
10915
|
-
{
|
|
10916
|
-
{
|
|
10964
|
+
{ name: "name", type: "string", internalType: "string" },
|
|
10965
|
+
{ name: "symbol", type: "string", internalType: "string" },
|
|
10966
|
+
{ name: "tokenUri", type: "string", internalType: "string" },
|
|
10917
10967
|
{
|
|
10918
|
-
internalType: "uint256",
|
|
10919
10968
|
name: "initialTokenFairLaunch",
|
|
10920
10969
|
type: "uint256",
|
|
10970
|
+
internalType: "uint256",
|
|
10921
10971
|
},
|
|
10922
10972
|
{
|
|
10923
|
-
internalType: "uint256",
|
|
10924
10973
|
name: "fairLaunchDuration",
|
|
10925
10974
|
type: "uint256",
|
|
10975
|
+
internalType: "uint256",
|
|
10926
10976
|
},
|
|
10927
|
-
{ internalType: "uint256", name: "premineAmount", type: "uint256" },
|
|
10928
|
-
{ internalType: "address", name: "creator", type: "address" },
|
|
10929
10977
|
{
|
|
10930
|
-
|
|
10978
|
+
name: "premineAmount",
|
|
10979
|
+
type: "uint256",
|
|
10980
|
+
internalType: "uint256",
|
|
10981
|
+
},
|
|
10982
|
+
{ name: "creator", type: "address", internalType: "address" },
|
|
10983
|
+
{
|
|
10931
10984
|
name: "creatorFeeAllocation",
|
|
10932
10985
|
type: "uint24",
|
|
10986
|
+
internalType: "uint24",
|
|
10987
|
+
},
|
|
10988
|
+
{
|
|
10989
|
+
name: "flaunchAt",
|
|
10990
|
+
type: "uint256",
|
|
10991
|
+
internalType: "uint256",
|
|
10992
|
+
},
|
|
10993
|
+
{
|
|
10994
|
+
name: "initialPriceParams",
|
|
10995
|
+
type: "bytes",
|
|
10996
|
+
internalType: "bytes",
|
|
10997
|
+
},
|
|
10998
|
+
{
|
|
10999
|
+
name: "feeCalculatorParams",
|
|
11000
|
+
type: "bytes",
|
|
11001
|
+
internalType: "bytes",
|
|
10933
11002
|
},
|
|
10934
|
-
{ internalType: "uint256", name: "flaunchAt", type: "uint256" },
|
|
10935
|
-
{ internalType: "bytes", name: "initialPriceParams", type: "bytes" },
|
|
10936
|
-
{ internalType: "bytes", name: "feeCalculatorParams", type: "bytes" },
|
|
10937
11003
|
],
|
|
10938
|
-
internalType: "struct PositionManager.FlaunchParams",
|
|
10939
|
-
name: "_flaunchParams",
|
|
10940
|
-
type: "tuple",
|
|
10941
11004
|
},
|
|
10942
11005
|
{
|
|
10943
|
-
components: [
|
|
10944
|
-
{ internalType: "bytes32", name: "merkleRoot", type: "bytes32" },
|
|
10945
|
-
{ internalType: "string", name: "merkleIPFSHash", type: "string" },
|
|
10946
|
-
{ internalType: "uint256", name: "maxTokens", type: "uint256" },
|
|
10947
|
-
],
|
|
10948
|
-
internalType: "struct FlaunchZap.WhitelistParams",
|
|
10949
11006
|
name: "_whitelistParams",
|
|
10950
11007
|
type: "tuple",
|
|
10951
|
-
|
|
10952
|
-
{
|
|
11008
|
+
internalType: "struct FlaunchZap.WhitelistParams",
|
|
10953
11009
|
components: [
|
|
10954
|
-
{
|
|
10955
|
-
|
|
10956
|
-
|
|
10957
|
-
|
|
10958
|
-
|
|
11010
|
+
{
|
|
11011
|
+
name: "merkleRoot",
|
|
11012
|
+
type: "bytes32",
|
|
11013
|
+
internalType: "bytes32",
|
|
11014
|
+
},
|
|
11015
|
+
{
|
|
11016
|
+
name: "merkleIPFSHash",
|
|
11017
|
+
type: "string",
|
|
11018
|
+
internalType: "string",
|
|
11019
|
+
},
|
|
11020
|
+
{
|
|
11021
|
+
name: "maxTokens",
|
|
11022
|
+
type: "uint256",
|
|
11023
|
+
internalType: "uint256",
|
|
11024
|
+
},
|
|
10959
11025
|
],
|
|
10960
|
-
internalType: "struct FlaunchZap.AirdropParams",
|
|
10961
|
-
name: "_airdropParams",
|
|
10962
|
-
type: "tuple",
|
|
10963
11026
|
},
|
|
10964
11027
|
{
|
|
11028
|
+
name: "_airdropParams",
|
|
11029
|
+
type: "tuple",
|
|
11030
|
+
internalType: "struct FlaunchZap.AirdropParams",
|
|
10965
11031
|
components: [
|
|
10966
|
-
{
|
|
10967
|
-
|
|
10968
|
-
|
|
11032
|
+
{
|
|
11033
|
+
name: "airdropIndex",
|
|
11034
|
+
type: "uint256",
|
|
11035
|
+
internalType: "uint256",
|
|
11036
|
+
},
|
|
11037
|
+
{
|
|
11038
|
+
name: "airdropAmount",
|
|
11039
|
+
type: "uint256",
|
|
11040
|
+
internalType: "uint256",
|
|
11041
|
+
},
|
|
11042
|
+
{
|
|
11043
|
+
name: "airdropEndTime",
|
|
11044
|
+
type: "uint256",
|
|
11045
|
+
internalType: "uint256",
|
|
11046
|
+
},
|
|
11047
|
+
{
|
|
11048
|
+
name: "merkleRoot",
|
|
11049
|
+
type: "bytes32",
|
|
11050
|
+
internalType: "bytes32",
|
|
11051
|
+
},
|
|
11052
|
+
{
|
|
11053
|
+
name: "merkleIPFSHash",
|
|
11054
|
+
type: "string",
|
|
11055
|
+
internalType: "string",
|
|
11056
|
+
},
|
|
10969
11057
|
],
|
|
10970
|
-
|
|
11058
|
+
},
|
|
11059
|
+
{
|
|
10971
11060
|
name: "_treasuryManagerParams",
|
|
10972
11061
|
type: "tuple",
|
|
11062
|
+
internalType: "struct FlaunchZap.TreasuryManagerParams",
|
|
11063
|
+
components: [
|
|
11064
|
+
{ name: "manager", type: "address", internalType: "address" },
|
|
11065
|
+
{
|
|
11066
|
+
name: "permissions",
|
|
11067
|
+
type: "address",
|
|
11068
|
+
internalType: "address",
|
|
11069
|
+
},
|
|
11070
|
+
{
|
|
11071
|
+
name: "initializeData",
|
|
11072
|
+
type: "bytes",
|
|
11073
|
+
internalType: "bytes",
|
|
11074
|
+
},
|
|
11075
|
+
{ name: "depositData", type: "bytes", internalType: "bytes" },
|
|
11076
|
+
],
|
|
10973
11077
|
},
|
|
10974
11078
|
],
|
|
10975
|
-
name: "flaunch",
|
|
10976
11079
|
outputs: [
|
|
10977
|
-
{
|
|
10978
|
-
{
|
|
10979
|
-
{
|
|
11080
|
+
{ name: "memecoin_", type: "address", internalType: "address" },
|
|
11081
|
+
{ name: "ethSpent_", type: "uint256", internalType: "uint256" },
|
|
11082
|
+
{
|
|
11083
|
+
name: "deployedManager_",
|
|
11084
|
+
type: "address",
|
|
11085
|
+
internalType: "address",
|
|
11086
|
+
},
|
|
10980
11087
|
],
|
|
10981
11088
|
stateMutability: "payable",
|
|
10982
|
-
type: "function",
|
|
10983
11089
|
},
|
|
10984
11090
|
{
|
|
10985
|
-
|
|
11091
|
+
type: "function",
|
|
10986
11092
|
name: "flaunchContract",
|
|
10987
|
-
|
|
11093
|
+
inputs: [],
|
|
11094
|
+
outputs: [{ name: "", type: "address", internalType: "contract Flaunch" }],
|
|
10988
11095
|
stateMutability: "view",
|
|
10989
|
-
type: "function",
|
|
10990
11096
|
},
|
|
10991
11097
|
{
|
|
10992
|
-
|
|
11098
|
+
type: "function",
|
|
10993
11099
|
name: "merkleAirdrop",
|
|
11100
|
+
inputs: [],
|
|
10994
11101
|
outputs: [
|
|
10995
|
-
{
|
|
11102
|
+
{
|
|
11103
|
+
name: "",
|
|
11104
|
+
type: "address",
|
|
11105
|
+
internalType: "contract IMerkleAirdrop",
|
|
11106
|
+
},
|
|
10996
11107
|
],
|
|
10997
11108
|
stateMutability: "view",
|
|
10998
|
-
type: "function",
|
|
10999
11109
|
},
|
|
11000
11110
|
{
|
|
11001
|
-
|
|
11111
|
+
type: "function",
|
|
11002
11112
|
name: "poolSwap",
|
|
11003
|
-
|
|
11113
|
+
inputs: [],
|
|
11114
|
+
outputs: [{ name: "", type: "address", internalType: "contract PoolSwap" }],
|
|
11004
11115
|
stateMutability: "view",
|
|
11005
|
-
type: "function",
|
|
11006
11116
|
},
|
|
11007
11117
|
{
|
|
11008
|
-
|
|
11118
|
+
type: "function",
|
|
11009
11119
|
name: "positionManager",
|
|
11120
|
+
inputs: [],
|
|
11010
11121
|
outputs: [
|
|
11011
|
-
{
|
|
11122
|
+
{
|
|
11123
|
+
name: "",
|
|
11124
|
+
type: "address",
|
|
11125
|
+
internalType: "contract PositionManager",
|
|
11126
|
+
},
|
|
11012
11127
|
],
|
|
11013
11128
|
stateMutability: "view",
|
|
11014
|
-
type: "function",
|
|
11015
11129
|
},
|
|
11016
11130
|
{
|
|
11017
|
-
|
|
11131
|
+
type: "function",
|
|
11018
11132
|
name: "treasuryManagerFactory",
|
|
11133
|
+
inputs: [],
|
|
11019
11134
|
outputs: [
|
|
11020
11135
|
{
|
|
11021
|
-
internalType: "contract ITreasuryManagerFactory",
|
|
11022
11136
|
name: "",
|
|
11023
11137
|
type: "address",
|
|
11138
|
+
internalType: "contract ITreasuryManagerFactory",
|
|
11024
11139
|
},
|
|
11025
11140
|
],
|
|
11026
11141
|
stateMutability: "view",
|
|
11027
|
-
type: "function",
|
|
11028
11142
|
},
|
|
11029
11143
|
{
|
|
11030
|
-
|
|
11144
|
+
type: "function",
|
|
11031
11145
|
name: "whitelistFairLaunch",
|
|
11146
|
+
inputs: [],
|
|
11032
11147
|
outputs: [
|
|
11033
11148
|
{
|
|
11034
|
-
internalType: "contract WhitelistFairLaunch",
|
|
11035
11149
|
name: "",
|
|
11036
11150
|
type: "address",
|
|
11151
|
+
internalType: "contract WhitelistFairLaunch",
|
|
11037
11152
|
},
|
|
11038
11153
|
],
|
|
11039
11154
|
stateMutability: "view",
|
|
11040
|
-
type: "function",
|
|
11041
11155
|
},
|
|
11042
|
-
{
|
|
11156
|
+
{ type: "error", name: "CreatorCannotBeZero", inputs: [] },
|
|
11157
|
+
{ type: "error", name: "InsufficientMemecoinsForAirdrop", inputs: [] },
|
|
11043
11158
|
];
|
|
11044
11159
|
|
|
11160
|
+
/**
|
|
11161
|
+
* Enumeration of Flaunch contract versions
|
|
11162
|
+
*/
|
|
11163
|
+
exports.FlaunchVersion = void 0;
|
|
11164
|
+
(function (FlaunchVersion) {
|
|
11165
|
+
FlaunchVersion["V1"] = "V1";
|
|
11166
|
+
FlaunchVersion["V1_1"] = "V1_1";
|
|
11167
|
+
FlaunchVersion["V1_1_1"] = "V1_1_1";
|
|
11168
|
+
FlaunchVersion["ANY"] = "ANY";
|
|
11169
|
+
})(exports.FlaunchVersion || (exports.FlaunchVersion = {}));
|
|
11170
|
+
/**
|
|
11171
|
+
* Enumeration of Verifiers for TokenImporter
|
|
11172
|
+
*/
|
|
11173
|
+
exports.Verifier = void 0;
|
|
11174
|
+
(function (Verifier) {
|
|
11175
|
+
Verifier["CLANKER"] = "clanker";
|
|
11176
|
+
Verifier["DOPPLER"] = "doppler";
|
|
11177
|
+
Verifier["VIRTUALS"] = "virtuals";
|
|
11178
|
+
Verifier["WHITELIST"] = "whitelist";
|
|
11179
|
+
Verifier["ZORA"] = "zora";
|
|
11180
|
+
})(exports.Verifier || (exports.Verifier = {}));
|
|
11181
|
+
/**
|
|
11182
|
+
* Enumeration of Permissions for TreasuryManagers. Defaults to OPEN.
|
|
11183
|
+
*/
|
|
11184
|
+
exports.Permissions = void 0;
|
|
11185
|
+
(function (Permissions) {
|
|
11186
|
+
Permissions["OPEN"] = "open";
|
|
11187
|
+
Permissions["CLOSED"] = "closed";
|
|
11188
|
+
Permissions["WHITELISTED"] = "whitelisted";
|
|
11189
|
+
})(exports.Permissions || (exports.Permissions = {}));
|
|
11190
|
+
|
|
11191
|
+
/**
|
|
11192
|
+
* Maps a Permissions enum value to its corresponding contract address
|
|
11193
|
+
* @param permissions - The permissions enum value
|
|
11194
|
+
* @param chainId - The chain ID to get the address for
|
|
11195
|
+
* @returns The corresponding permissions contract address
|
|
11196
|
+
*/
|
|
11197
|
+
function getPermissionsAddress(permissions, chainId) {
|
|
11198
|
+
switch (permissions) {
|
|
11199
|
+
case exports.Permissions.CLOSED:
|
|
11200
|
+
return ClosedPermissionsAddress[chainId];
|
|
11201
|
+
case exports.Permissions.WHITELISTED:
|
|
11202
|
+
return WhitelistedPermissionsAddress[chainId];
|
|
11203
|
+
case exports.Permissions.OPEN:
|
|
11204
|
+
default:
|
|
11205
|
+
return viem.zeroAddress;
|
|
11206
|
+
}
|
|
11207
|
+
}
|
|
11208
|
+
|
|
11045
11209
|
const FlaunchPositionManagerV1_1Abi = [
|
|
11046
11210
|
{
|
|
11047
11211
|
inputs: [
|
|
@@ -12965,11 +13129,13 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
|
12965
13129
|
const _treasuryManagerParams = params.treasuryManagerParams
|
|
12966
13130
|
? {
|
|
12967
13131
|
manager: params.treasuryManagerParams.manager ?? viem.zeroAddress,
|
|
13132
|
+
permissions: params.treasuryManagerParams.permissions ?? exports.Permissions.OPEN,
|
|
12968
13133
|
initializeData: params.treasuryManagerParams.initializeData ?? "0x",
|
|
12969
13134
|
depositData: params.treasuryManagerParams.depositData ?? "0x",
|
|
12970
13135
|
}
|
|
12971
13136
|
: {
|
|
12972
13137
|
manager: viem.zeroAddress,
|
|
13138
|
+
permissions: exports.Permissions.OPEN,
|
|
12973
13139
|
initializeData: "0x",
|
|
12974
13140
|
depositData: "0x",
|
|
12975
13141
|
};
|
|
@@ -12987,7 +13153,10 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
|
12987
13153
|
initialPriceParams,
|
|
12988
13154
|
feeCalculatorParams: "0x",
|
|
12989
13155
|
},
|
|
12990
|
-
_treasuryManagerParams
|
|
13156
|
+
_treasuryManagerParams: {
|
|
13157
|
+
..._treasuryManagerParams,
|
|
13158
|
+
permissions: getPermissionsAddress(_treasuryManagerParams.permissions, this.chainId),
|
|
13159
|
+
},
|
|
12991
13160
|
_whitelistParams: {
|
|
12992
13161
|
merkleRoot: viem.zeroHash,
|
|
12993
13162
|
merkleIPFSHash: "",
|
|
@@ -13061,6 +13230,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
|
13061
13230
|
},
|
|
13062
13231
|
_treasuryManagerParams: {
|
|
13063
13232
|
manager: params.revenueManagerInstanceAddress,
|
|
13233
|
+
permissions: getPermissionsAddress(params.treasuryManagerParams?.permissions ?? exports.Permissions.OPEN, this.chainId),
|
|
13064
13234
|
initializeData: "0x",
|
|
13065
13235
|
depositData: "0x",
|
|
13066
13236
|
},
|
|
@@ -13178,6 +13348,7 @@ class ReadWriteFlaunchZap extends ReadFlaunchZap {
|
|
|
13178
13348
|
},
|
|
13179
13349
|
_treasuryManagerParams: {
|
|
13180
13350
|
manager: AddressFeeSplitManagerAddress[this.chainId],
|
|
13351
|
+
permissions: getPermissionsAddress(params.treasuryManagerParams?.permissions ?? exports.Permissions.OPEN, this.chainId),
|
|
13181
13352
|
initializeData,
|
|
13182
13353
|
depositData: "0x",
|
|
13183
13354
|
},
|
|
@@ -17423,30 +17594,8 @@ const TokenImporterAbi = [
|
|
|
17423
17594
|
];
|
|
17424
17595
|
|
|
17425
17596
|
/**
|
|
17426
|
-
*
|
|
17427
|
-
|
|
17428
|
-
exports.FlaunchVersion = void 0;
|
|
17429
|
-
(function (FlaunchVersion) {
|
|
17430
|
-
FlaunchVersion["V1"] = "V1";
|
|
17431
|
-
FlaunchVersion["V1_1"] = "V1_1";
|
|
17432
|
-
FlaunchVersion["V1_1_1"] = "V1_1_1";
|
|
17433
|
-
FlaunchVersion["ANY"] = "ANY";
|
|
17434
|
-
})(exports.FlaunchVersion || (exports.FlaunchVersion = {}));
|
|
17435
|
-
/**
|
|
17436
|
-
* Enumeration of Verifiers for TokenImporter
|
|
17437
|
-
*/
|
|
17438
|
-
exports.Verifier = void 0;
|
|
17439
|
-
(function (Verifier) {
|
|
17440
|
-
Verifier["CLANKER"] = "clanker";
|
|
17441
|
-
Verifier["DOPPLER"] = "doppler";
|
|
17442
|
-
Verifier["VIRTUALS"] = "virtuals";
|
|
17443
|
-
Verifier["WHITELIST"] = "whitelist";
|
|
17444
|
-
Verifier["ZORA"] = "zora";
|
|
17445
|
-
})(exports.Verifier || (exports.Verifier = {}));
|
|
17446
|
-
|
|
17447
|
-
/**
|
|
17448
|
-
* Base client for interacting with the TokenImporter contract in read-only mode
|
|
17449
|
-
* Provides basic contract initialization
|
|
17597
|
+
* Base client for interacting with the TokenImporter contract in read-only mode
|
|
17598
|
+
* Provides basic contract initialization
|
|
17450
17599
|
*/
|
|
17451
17600
|
class ReadTokenImporter {
|
|
17452
17601
|
constructor(chainId, address, drift$1 = drift.createDrift()) {
|
|
@@ -19856,388 +20005,446 @@ class ReadFlaunchV1_1 {
|
|
|
19856
20005
|
|
|
19857
20006
|
const TreasuryManagerFactoryAbi = [
|
|
19858
20007
|
{
|
|
19859
|
-
inputs: [
|
|
19860
|
-
{ internalType: "address", name: "_protocolOwner", type: "address" },
|
|
19861
|
-
{ internalType: "address", name: "_feeEscrow", type: "address" },
|
|
19862
|
-
],
|
|
19863
|
-
stateMutability: "nonpayable",
|
|
19864
20008
|
type: "constructor",
|
|
19865
|
-
},
|
|
19866
|
-
{ inputs: [], name: "AccessControlBadConfirmation", type: "error" },
|
|
19867
|
-
{
|
|
19868
|
-
inputs: [
|
|
19869
|
-
{ internalType: "address", name: "account", type: "address" },
|
|
19870
|
-
{ internalType: "bytes32", name: "neededRole", type: "bytes32" },
|
|
19871
|
-
],
|
|
19872
|
-
name: "AccessControlUnauthorizedAccount",
|
|
19873
|
-
type: "error",
|
|
19874
|
-
},
|
|
19875
|
-
{ inputs: [], name: "AlreadyInitialized", type: "error" },
|
|
19876
|
-
{ inputs: [], name: "NewOwnerIsZeroAddress", type: "error" },
|
|
19877
|
-
{ inputs: [], name: "NoHandoverRequest", type: "error" },
|
|
19878
|
-
{ inputs: [], name: "Unauthorized", type: "error" },
|
|
19879
|
-
{ inputs: [], name: "UnknownManagerImplemention", type: "error" },
|
|
19880
|
-
{
|
|
19881
|
-
anonymous: false,
|
|
19882
20009
|
inputs: [
|
|
19883
20010
|
{
|
|
19884
|
-
|
|
19885
|
-
internalType: "address",
|
|
19886
|
-
name: "_manager",
|
|
20011
|
+
name: "_protocolOwner",
|
|
19887
20012
|
type: "address",
|
|
19888
|
-
},
|
|
19889
|
-
{
|
|
19890
|
-
indexed: true,
|
|
19891
20013
|
internalType: "address",
|
|
19892
|
-
name: "_managerImplementation",
|
|
19893
|
-
type: "address",
|
|
19894
20014
|
},
|
|
20015
|
+
{ name: "_feeEscrow", type: "address", internalType: "address" },
|
|
19895
20016
|
],
|
|
19896
|
-
|
|
19897
|
-
type: "event",
|
|
20017
|
+
stateMutability: "nonpayable",
|
|
19898
20018
|
},
|
|
19899
20019
|
{
|
|
19900
|
-
|
|
20020
|
+
type: "function",
|
|
20021
|
+
name: "DEFAULT_ADMIN_ROLE",
|
|
20022
|
+
inputs: [],
|
|
20023
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
20024
|
+
stateMutability: "view",
|
|
20025
|
+
},
|
|
20026
|
+
{
|
|
20027
|
+
type: "function",
|
|
20028
|
+
name: "approveManager",
|
|
19901
20029
|
inputs: [
|
|
19902
20030
|
{
|
|
19903
|
-
indexed: true,
|
|
19904
|
-
internalType: "address",
|
|
19905
20031
|
name: "_managerImplementation",
|
|
19906
20032
|
type: "address",
|
|
20033
|
+
internalType: "address",
|
|
19907
20034
|
},
|
|
19908
20035
|
],
|
|
19909
|
-
|
|
19910
|
-
|
|
20036
|
+
outputs: [],
|
|
20037
|
+
stateMutability: "nonpayable",
|
|
19911
20038
|
},
|
|
19912
20039
|
{
|
|
19913
|
-
|
|
20040
|
+
type: "function",
|
|
20041
|
+
name: "approvedManagerImplementation",
|
|
19914
20042
|
inputs: [
|
|
19915
20043
|
{
|
|
19916
|
-
indexed: true,
|
|
19917
|
-
internalType: "address",
|
|
19918
20044
|
name: "_managerImplementation",
|
|
19919
20045
|
type: "address",
|
|
20046
|
+
internalType: "address",
|
|
19920
20047
|
},
|
|
19921
20048
|
],
|
|
19922
|
-
name: "
|
|
19923
|
-
|
|
20049
|
+
outputs: [{ name: "_approved", type: "bool", internalType: "bool" }],
|
|
20050
|
+
stateMutability: "view",
|
|
19924
20051
|
},
|
|
19925
20052
|
{
|
|
19926
|
-
|
|
19927
|
-
|
|
19928
|
-
|
|
19929
|
-
|
|
19930
|
-
|
|
19931
|
-
name: "pendingOwner",
|
|
19932
|
-
type: "address",
|
|
19933
|
-
},
|
|
19934
|
-
],
|
|
19935
|
-
name: "OwnershipHandoverCanceled",
|
|
19936
|
-
type: "event",
|
|
20053
|
+
type: "function",
|
|
20054
|
+
name: "cancelOwnershipHandover",
|
|
20055
|
+
inputs: [],
|
|
20056
|
+
outputs: [],
|
|
20057
|
+
stateMutability: "payable",
|
|
19937
20058
|
},
|
|
19938
20059
|
{
|
|
19939
|
-
|
|
20060
|
+
type: "function",
|
|
20061
|
+
name: "completeOwnershipHandover",
|
|
19940
20062
|
inputs: [
|
|
19941
|
-
{
|
|
19942
|
-
indexed: true,
|
|
19943
|
-
internalType: "address",
|
|
19944
|
-
name: "pendingOwner",
|
|
19945
|
-
type: "address",
|
|
19946
|
-
},
|
|
20063
|
+
{ name: "pendingOwner", type: "address", internalType: "address" },
|
|
19947
20064
|
],
|
|
19948
|
-
|
|
19949
|
-
|
|
20065
|
+
outputs: [],
|
|
20066
|
+
stateMutability: "payable",
|
|
19950
20067
|
},
|
|
19951
20068
|
{
|
|
19952
|
-
|
|
20069
|
+
type: "function",
|
|
20070
|
+
name: "deployAndInitializeManager",
|
|
19953
20071
|
inputs: [
|
|
19954
20072
|
{
|
|
19955
|
-
|
|
19956
|
-
internalType: "address",
|
|
19957
|
-
name: "oldOwner",
|
|
20073
|
+
name: "_managerImplementation",
|
|
19958
20074
|
type: "address",
|
|
19959
|
-
},
|
|
19960
|
-
{
|
|
19961
|
-
indexed: true,
|
|
19962
20075
|
internalType: "address",
|
|
19963
|
-
name: "newOwner",
|
|
19964
|
-
type: "address",
|
|
19965
20076
|
},
|
|
20077
|
+
{ name: "_owner", type: "address", internalType: "address" },
|
|
20078
|
+
{ name: "_data", type: "bytes", internalType: "bytes" },
|
|
19966
20079
|
],
|
|
19967
|
-
|
|
19968
|
-
type: "event",
|
|
19969
|
-
},
|
|
19970
|
-
{
|
|
19971
|
-
anonymous: false,
|
|
19972
|
-
inputs: [
|
|
19973
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
19974
|
-
{
|
|
19975
|
-
indexed: true,
|
|
19976
|
-
internalType: "bytes32",
|
|
19977
|
-
name: "previousAdminRole",
|
|
19978
|
-
type: "bytes32",
|
|
19979
|
-
},
|
|
20080
|
+
outputs: [
|
|
19980
20081
|
{
|
|
19981
|
-
|
|
19982
|
-
|
|
19983
|
-
|
|
19984
|
-
type: "bytes32",
|
|
20082
|
+
name: "manager_",
|
|
20083
|
+
type: "address",
|
|
20084
|
+
internalType: "address payable",
|
|
19985
20085
|
},
|
|
19986
20086
|
],
|
|
19987
|
-
|
|
19988
|
-
type: "event",
|
|
20087
|
+
stateMutability: "nonpayable",
|
|
19989
20088
|
},
|
|
19990
20089
|
{
|
|
19991
|
-
|
|
20090
|
+
type: "function",
|
|
20091
|
+
name: "deployAndInitializeManager",
|
|
19992
20092
|
inputs: [
|
|
19993
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
19994
20093
|
{
|
|
19995
|
-
|
|
19996
|
-
internalType: "address",
|
|
19997
|
-
name: "account",
|
|
20094
|
+
name: "_managerImplementation",
|
|
19998
20095
|
type: "address",
|
|
20096
|
+
internalType: "address",
|
|
19999
20097
|
},
|
|
20098
|
+
{ name: "_owner", type: "address", internalType: "address" },
|
|
20099
|
+
{ name: "_data", type: "bytes", internalType: "bytes" },
|
|
20100
|
+
{ name: "_permissions", type: "address", internalType: "address" },
|
|
20101
|
+
],
|
|
20102
|
+
outputs: [
|
|
20000
20103
|
{
|
|
20001
|
-
|
|
20002
|
-
internalType: "address",
|
|
20003
|
-
name: "sender",
|
|
20104
|
+
name: "manager_",
|
|
20004
20105
|
type: "address",
|
|
20106
|
+
internalType: "address payable",
|
|
20005
20107
|
},
|
|
20006
20108
|
],
|
|
20007
|
-
|
|
20008
|
-
type: "event",
|
|
20109
|
+
stateMutability: "nonpayable",
|
|
20009
20110
|
},
|
|
20010
20111
|
{
|
|
20011
|
-
|
|
20112
|
+
type: "function",
|
|
20113
|
+
name: "deployManager",
|
|
20012
20114
|
inputs: [
|
|
20013
|
-
{ indexed: true, internalType: "bytes32", name: "role", type: "bytes32" },
|
|
20014
20115
|
{
|
|
20015
|
-
|
|
20016
|
-
internalType: "address",
|
|
20017
|
-
name: "account",
|
|
20116
|
+
name: "_managerImplementation",
|
|
20018
20117
|
type: "address",
|
|
20118
|
+
internalType: "address",
|
|
20019
20119
|
},
|
|
20120
|
+
],
|
|
20121
|
+
outputs: [
|
|
20020
20122
|
{
|
|
20021
|
-
|
|
20022
|
-
internalType: "address",
|
|
20023
|
-
name: "sender",
|
|
20123
|
+
name: "manager_",
|
|
20024
20124
|
type: "address",
|
|
20125
|
+
internalType: "address payable",
|
|
20025
20126
|
},
|
|
20026
20127
|
],
|
|
20027
|
-
|
|
20028
|
-
type: "event",
|
|
20128
|
+
stateMutability: "nonpayable",
|
|
20029
20129
|
},
|
|
20030
20130
|
{
|
|
20131
|
+
type: "function",
|
|
20132
|
+
name: "feeEscrow",
|
|
20031
20133
|
inputs: [],
|
|
20032
|
-
|
|
20033
|
-
|
|
20134
|
+
outputs: [
|
|
20135
|
+
{ name: "", type: "address", internalType: "contract IFeeEscrow" },
|
|
20136
|
+
],
|
|
20034
20137
|
stateMutability: "view",
|
|
20138
|
+
},
|
|
20139
|
+
{
|
|
20035
20140
|
type: "function",
|
|
20141
|
+
name: "getRoleAdmin",
|
|
20142
|
+
inputs: [{ name: "role", type: "bytes32", internalType: "bytes32" }],
|
|
20143
|
+
outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
|
|
20144
|
+
stateMutability: "view",
|
|
20036
20145
|
},
|
|
20037
20146
|
{
|
|
20147
|
+
type: "function",
|
|
20148
|
+
name: "grantRole",
|
|
20038
20149
|
inputs: [
|
|
20039
|
-
{
|
|
20040
|
-
|
|
20041
|
-
name: "_managerImplementation",
|
|
20042
|
-
type: "address",
|
|
20043
|
-
},
|
|
20150
|
+
{ name: "role", type: "bytes32", internalType: "bytes32" },
|
|
20151
|
+
{ name: "account", type: "address", internalType: "address" },
|
|
20044
20152
|
],
|
|
20045
|
-
name: "approveManager",
|
|
20046
20153
|
outputs: [],
|
|
20047
20154
|
stateMutability: "nonpayable",
|
|
20048
|
-
type: "function",
|
|
20049
20155
|
},
|
|
20050
20156
|
{
|
|
20157
|
+
type: "function",
|
|
20158
|
+
name: "hasRole",
|
|
20051
20159
|
inputs: [
|
|
20160
|
+
{ name: "role", type: "bytes32", internalType: "bytes32" },
|
|
20161
|
+
{ name: "account", type: "address", internalType: "address" },
|
|
20162
|
+
],
|
|
20163
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
20164
|
+
stateMutability: "view",
|
|
20165
|
+
},
|
|
20166
|
+
{
|
|
20167
|
+
type: "function",
|
|
20168
|
+
name: "managerImplementation",
|
|
20169
|
+
inputs: [{ name: "_manager", type: "address", internalType: "address" }],
|
|
20170
|
+
outputs: [
|
|
20052
20171
|
{
|
|
20053
|
-
internalType: "address",
|
|
20054
20172
|
name: "_managerImplementation",
|
|
20055
20173
|
type: "address",
|
|
20174
|
+
internalType: "address",
|
|
20056
20175
|
},
|
|
20057
20176
|
],
|
|
20058
|
-
name: "approvedManagerImplementation",
|
|
20059
|
-
outputs: [{ internalType: "bool", name: "_approved", type: "bool" }],
|
|
20060
20177
|
stateMutability: "view",
|
|
20061
|
-
type: "function",
|
|
20062
20178
|
},
|
|
20063
20179
|
{
|
|
20064
|
-
inputs: [],
|
|
20065
|
-
name: "cancelOwnershipHandover",
|
|
20066
|
-
outputs: [],
|
|
20067
|
-
stateMutability: "payable",
|
|
20068
20180
|
type: "function",
|
|
20181
|
+
name: "owner",
|
|
20182
|
+
inputs: [],
|
|
20183
|
+
outputs: [{ name: "result", type: "address", internalType: "address" }],
|
|
20184
|
+
stateMutability: "view",
|
|
20069
20185
|
},
|
|
20070
20186
|
{
|
|
20187
|
+
type: "function",
|
|
20188
|
+
name: "ownershipHandoverExpiresAt",
|
|
20071
20189
|
inputs: [
|
|
20072
|
-
{
|
|
20190
|
+
{ name: "pendingOwner", type: "address", internalType: "address" },
|
|
20073
20191
|
],
|
|
20074
|
-
name: "
|
|
20192
|
+
outputs: [{ name: "result", type: "uint256", internalType: "uint256" }],
|
|
20193
|
+
stateMutability: "view",
|
|
20194
|
+
},
|
|
20195
|
+
{
|
|
20196
|
+
type: "function",
|
|
20197
|
+
name: "renounceOwnership",
|
|
20198
|
+
inputs: [],
|
|
20075
20199
|
outputs: [],
|
|
20076
20200
|
stateMutability: "payable",
|
|
20077
|
-
type: "function",
|
|
20078
20201
|
},
|
|
20079
20202
|
{
|
|
20203
|
+
type: "function",
|
|
20204
|
+
name: "renounceRole",
|
|
20080
20205
|
inputs: [
|
|
20206
|
+
{ name: "role", type: "bytes32", internalType: "bytes32" },
|
|
20081
20207
|
{
|
|
20082
|
-
|
|
20083
|
-
name: "_managerImplementation",
|
|
20208
|
+
name: "callerConfirmation",
|
|
20084
20209
|
type: "address",
|
|
20210
|
+
internalType: "address",
|
|
20085
20211
|
},
|
|
20086
|
-
{ internalType: "address", name: "_owner", type: "address" },
|
|
20087
|
-
{ internalType: "bytes", name: "_data", type: "bytes" },
|
|
20088
|
-
],
|
|
20089
|
-
name: "deployAndInitializeManager",
|
|
20090
|
-
outputs: [
|
|
20091
|
-
{ internalType: "address payable", name: "manager_", type: "address" },
|
|
20092
20212
|
],
|
|
20213
|
+
outputs: [],
|
|
20093
20214
|
stateMutability: "nonpayable",
|
|
20215
|
+
},
|
|
20216
|
+
{
|
|
20094
20217
|
type: "function",
|
|
20218
|
+
name: "requestOwnershipHandover",
|
|
20219
|
+
inputs: [],
|
|
20220
|
+
outputs: [],
|
|
20221
|
+
stateMutability: "payable",
|
|
20095
20222
|
},
|
|
20096
20223
|
{
|
|
20224
|
+
type: "function",
|
|
20225
|
+
name: "revokeRole",
|
|
20097
20226
|
inputs: [
|
|
20098
|
-
{
|
|
20099
|
-
|
|
20100
|
-
name: "_managerImplementation",
|
|
20101
|
-
type: "address",
|
|
20102
|
-
},
|
|
20103
|
-
],
|
|
20104
|
-
name: "deployManager",
|
|
20105
|
-
outputs: [
|
|
20106
|
-
{ internalType: "address payable", name: "manager_", type: "address" },
|
|
20227
|
+
{ name: "role", type: "bytes32", internalType: "bytes32" },
|
|
20228
|
+
{ name: "account", type: "address", internalType: "address" },
|
|
20107
20229
|
],
|
|
20230
|
+
outputs: [],
|
|
20108
20231
|
stateMutability: "nonpayable",
|
|
20109
|
-
type: "function",
|
|
20110
20232
|
},
|
|
20111
20233
|
{
|
|
20112
|
-
inputs: [],
|
|
20113
|
-
name: "feeEscrow",
|
|
20114
|
-
outputs: [
|
|
20115
|
-
{ internalType: "contract IFeeEscrow", name: "", type: "address" },
|
|
20116
|
-
],
|
|
20117
|
-
stateMutability: "view",
|
|
20118
20234
|
type: "function",
|
|
20235
|
+
name: "supportsInterface",
|
|
20236
|
+
inputs: [{ name: "interfaceId", type: "bytes4", internalType: "bytes4" }],
|
|
20237
|
+
outputs: [{ name: "", type: "bool", internalType: "bool" }],
|
|
20238
|
+
stateMutability: "view",
|
|
20119
20239
|
},
|
|
20120
20240
|
{
|
|
20121
|
-
inputs: [{ internalType: "bytes32", name: "role", type: "bytes32" }],
|
|
20122
|
-
name: "getRoleAdmin",
|
|
20123
|
-
outputs: [{ internalType: "bytes32", name: "", type: "bytes32" }],
|
|
20124
|
-
stateMutability: "view",
|
|
20125
20241
|
type: "function",
|
|
20242
|
+
name: "transferOwnership",
|
|
20243
|
+
inputs: [{ name: "newOwner", type: "address", internalType: "address" }],
|
|
20244
|
+
outputs: [],
|
|
20245
|
+
stateMutability: "payable",
|
|
20126
20246
|
},
|
|
20127
20247
|
{
|
|
20248
|
+
type: "function",
|
|
20249
|
+
name: "unapproveManager",
|
|
20128
20250
|
inputs: [
|
|
20129
|
-
{
|
|
20130
|
-
|
|
20251
|
+
{
|
|
20252
|
+
name: "_managerImplementation",
|
|
20253
|
+
type: "address",
|
|
20254
|
+
internalType: "address",
|
|
20255
|
+
},
|
|
20131
20256
|
],
|
|
20132
|
-
name: "grantRole",
|
|
20133
20257
|
outputs: [],
|
|
20134
20258
|
stateMutability: "nonpayable",
|
|
20135
|
-
type: "function",
|
|
20136
20259
|
},
|
|
20137
20260
|
{
|
|
20261
|
+
type: "event",
|
|
20262
|
+
name: "ManagerDeployed",
|
|
20138
20263
|
inputs: [
|
|
20139
|
-
{ internalType: "bytes32", name: "role", type: "bytes32" },
|
|
20140
|
-
{ internalType: "address", name: "account", type: "address" },
|
|
20141
|
-
],
|
|
20142
|
-
name: "hasRole",
|
|
20143
|
-
outputs: [{ internalType: "bool", name: "", type: "bool" }],
|
|
20144
|
-
stateMutability: "view",
|
|
20145
|
-
type: "function",
|
|
20146
|
-
},
|
|
20147
|
-
{
|
|
20148
|
-
inputs: [{ internalType: "address", name: "_manager", type: "address" }],
|
|
20149
|
-
name: "managerImplementation",
|
|
20150
|
-
outputs: [
|
|
20151
20264
|
{
|
|
20265
|
+
name: "_manager",
|
|
20266
|
+
type: "address",
|
|
20267
|
+
indexed: true,
|
|
20152
20268
|
internalType: "address",
|
|
20269
|
+
},
|
|
20270
|
+
{
|
|
20153
20271
|
name: "_managerImplementation",
|
|
20154
20272
|
type: "address",
|
|
20273
|
+
indexed: true,
|
|
20274
|
+
internalType: "address",
|
|
20155
20275
|
},
|
|
20156
20276
|
],
|
|
20157
|
-
|
|
20158
|
-
type: "function",
|
|
20159
|
-
},
|
|
20160
|
-
{
|
|
20161
|
-
inputs: [],
|
|
20162
|
-
name: "owner",
|
|
20163
|
-
outputs: [{ internalType: "address", name: "result", type: "address" }],
|
|
20164
|
-
stateMutability: "view",
|
|
20165
|
-
type: "function",
|
|
20277
|
+
anonymous: false,
|
|
20166
20278
|
},
|
|
20167
20279
|
{
|
|
20280
|
+
type: "event",
|
|
20281
|
+
name: "ManagerImplementationApproved",
|
|
20168
20282
|
inputs: [
|
|
20169
|
-
{
|
|
20283
|
+
{
|
|
20284
|
+
name: "_managerImplementation",
|
|
20285
|
+
type: "address",
|
|
20286
|
+
indexed: true,
|
|
20287
|
+
internalType: "address",
|
|
20288
|
+
},
|
|
20170
20289
|
],
|
|
20171
|
-
|
|
20172
|
-
outputs: [{ internalType: "uint256", name: "result", type: "uint256" }],
|
|
20173
|
-
stateMutability: "view",
|
|
20174
|
-
type: "function",
|
|
20290
|
+
anonymous: false,
|
|
20175
20291
|
},
|
|
20176
20292
|
{
|
|
20177
|
-
|
|
20178
|
-
name: "
|
|
20179
|
-
|
|
20180
|
-
|
|
20181
|
-
|
|
20293
|
+
type: "event",
|
|
20294
|
+
name: "ManagerImplementationUnapproved",
|
|
20295
|
+
inputs: [
|
|
20296
|
+
{
|
|
20297
|
+
name: "_managerImplementation",
|
|
20298
|
+
type: "address",
|
|
20299
|
+
indexed: true,
|
|
20300
|
+
internalType: "address",
|
|
20301
|
+
},
|
|
20302
|
+
],
|
|
20303
|
+
anonymous: false,
|
|
20182
20304
|
},
|
|
20183
20305
|
{
|
|
20306
|
+
type: "event",
|
|
20307
|
+
name: "OwnershipHandoverCanceled",
|
|
20184
20308
|
inputs: [
|
|
20185
|
-
{
|
|
20186
|
-
|
|
20309
|
+
{
|
|
20310
|
+
name: "pendingOwner",
|
|
20311
|
+
type: "address",
|
|
20312
|
+
indexed: true,
|
|
20313
|
+
internalType: "address",
|
|
20314
|
+
},
|
|
20187
20315
|
],
|
|
20188
|
-
|
|
20189
|
-
outputs: [],
|
|
20190
|
-
stateMutability: "nonpayable",
|
|
20191
|
-
type: "function",
|
|
20316
|
+
anonymous: false,
|
|
20192
20317
|
},
|
|
20193
20318
|
{
|
|
20194
|
-
|
|
20195
|
-
name: "
|
|
20196
|
-
|
|
20197
|
-
|
|
20198
|
-
|
|
20319
|
+
type: "event",
|
|
20320
|
+
name: "OwnershipHandoverRequested",
|
|
20321
|
+
inputs: [
|
|
20322
|
+
{
|
|
20323
|
+
name: "pendingOwner",
|
|
20324
|
+
type: "address",
|
|
20325
|
+
indexed: true,
|
|
20326
|
+
internalType: "address",
|
|
20327
|
+
},
|
|
20328
|
+
],
|
|
20329
|
+
anonymous: false,
|
|
20199
20330
|
},
|
|
20200
20331
|
{
|
|
20332
|
+
type: "event",
|
|
20333
|
+
name: "OwnershipTransferred",
|
|
20201
20334
|
inputs: [
|
|
20202
|
-
{
|
|
20203
|
-
|
|
20335
|
+
{
|
|
20336
|
+
name: "oldOwner",
|
|
20337
|
+
type: "address",
|
|
20338
|
+
indexed: true,
|
|
20339
|
+
internalType: "address",
|
|
20340
|
+
},
|
|
20341
|
+
{
|
|
20342
|
+
name: "newOwner",
|
|
20343
|
+
type: "address",
|
|
20344
|
+
indexed: true,
|
|
20345
|
+
internalType: "address",
|
|
20346
|
+
},
|
|
20204
20347
|
],
|
|
20205
|
-
|
|
20206
|
-
outputs: [],
|
|
20207
|
-
stateMutability: "nonpayable",
|
|
20208
|
-
type: "function",
|
|
20348
|
+
anonymous: false,
|
|
20209
20349
|
},
|
|
20210
20350
|
{
|
|
20211
|
-
|
|
20212
|
-
name: "
|
|
20213
|
-
|
|
20214
|
-
|
|
20215
|
-
|
|
20351
|
+
type: "event",
|
|
20352
|
+
name: "RoleAdminChanged",
|
|
20353
|
+
inputs: [
|
|
20354
|
+
{
|
|
20355
|
+
name: "role",
|
|
20356
|
+
type: "bytes32",
|
|
20357
|
+
indexed: true,
|
|
20358
|
+
internalType: "bytes32",
|
|
20359
|
+
},
|
|
20360
|
+
{
|
|
20361
|
+
name: "previousAdminRole",
|
|
20362
|
+
type: "bytes32",
|
|
20363
|
+
indexed: true,
|
|
20364
|
+
internalType: "bytes32",
|
|
20365
|
+
},
|
|
20366
|
+
{
|
|
20367
|
+
name: "newAdminRole",
|
|
20368
|
+
type: "bytes32",
|
|
20369
|
+
indexed: true,
|
|
20370
|
+
internalType: "bytes32",
|
|
20371
|
+
},
|
|
20372
|
+
],
|
|
20373
|
+
anonymous: false,
|
|
20216
20374
|
},
|
|
20217
20375
|
{
|
|
20218
|
-
|
|
20219
|
-
name: "
|
|
20220
|
-
|
|
20221
|
-
|
|
20222
|
-
|
|
20376
|
+
type: "event",
|
|
20377
|
+
name: "RoleGranted",
|
|
20378
|
+
inputs: [
|
|
20379
|
+
{
|
|
20380
|
+
name: "role",
|
|
20381
|
+
type: "bytes32",
|
|
20382
|
+
indexed: true,
|
|
20383
|
+
internalType: "bytes32",
|
|
20384
|
+
},
|
|
20385
|
+
{
|
|
20386
|
+
name: "account",
|
|
20387
|
+
type: "address",
|
|
20388
|
+
indexed: true,
|
|
20389
|
+
internalType: "address",
|
|
20390
|
+
},
|
|
20391
|
+
{
|
|
20392
|
+
name: "sender",
|
|
20393
|
+
type: "address",
|
|
20394
|
+
indexed: true,
|
|
20395
|
+
internalType: "address",
|
|
20396
|
+
},
|
|
20397
|
+
],
|
|
20398
|
+
anonymous: false,
|
|
20223
20399
|
},
|
|
20224
20400
|
{
|
|
20401
|
+
type: "event",
|
|
20402
|
+
name: "RoleRevoked",
|
|
20225
20403
|
inputs: [
|
|
20226
20404
|
{
|
|
20405
|
+
name: "role",
|
|
20406
|
+
type: "bytes32",
|
|
20407
|
+
indexed: true,
|
|
20408
|
+
internalType: "bytes32",
|
|
20409
|
+
},
|
|
20410
|
+
{
|
|
20411
|
+
name: "account",
|
|
20412
|
+
type: "address",
|
|
20413
|
+
indexed: true,
|
|
20227
20414
|
internalType: "address",
|
|
20228
|
-
|
|
20415
|
+
},
|
|
20416
|
+
{
|
|
20417
|
+
name: "sender",
|
|
20229
20418
|
type: "address",
|
|
20419
|
+
indexed: true,
|
|
20420
|
+
internalType: "address",
|
|
20230
20421
|
},
|
|
20231
20422
|
],
|
|
20232
|
-
|
|
20233
|
-
outputs: [],
|
|
20234
|
-
stateMutability: "nonpayable",
|
|
20235
|
-
type: "function",
|
|
20423
|
+
anonymous: false,
|
|
20236
20424
|
},
|
|
20425
|
+
{ type: "error", name: "AccessControlBadConfirmation", inputs: [] },
|
|
20426
|
+
{
|
|
20427
|
+
type: "error",
|
|
20428
|
+
name: "AccessControlUnauthorizedAccount",
|
|
20429
|
+
inputs: [
|
|
20430
|
+
{ name: "account", type: "address", internalType: "address" },
|
|
20431
|
+
{ name: "neededRole", type: "bytes32", internalType: "bytes32" },
|
|
20432
|
+
],
|
|
20433
|
+
},
|
|
20434
|
+
{ type: "error", name: "AlreadyInitialized", inputs: [] },
|
|
20435
|
+
{ type: "error", name: "NewOwnerIsZeroAddress", inputs: [] },
|
|
20436
|
+
{ type: "error", name: "NoHandoverRequest", inputs: [] },
|
|
20437
|
+
{ type: "error", name: "Unauthorized", inputs: [] },
|
|
20438
|
+
{ type: "error", name: "UnknownManagerImplemention", inputs: [] },
|
|
20237
20439
|
];
|
|
20238
20440
|
|
|
20441
|
+
const chainIdToChain = {
|
|
20442
|
+
[base.id]: base,
|
|
20443
|
+
[baseSepolia.id]: baseSepolia,
|
|
20444
|
+
};
|
|
20445
|
+
|
|
20239
20446
|
class ReadTreasuryManagerFactory {
|
|
20240
|
-
constructor(address, drift$1 = drift.createDrift()) {
|
|
20447
|
+
constructor(chainId, address, drift$1 = drift.createDrift()) {
|
|
20241
20448
|
if (!address) {
|
|
20242
20449
|
throw new Error("Address is required");
|
|
20243
20450
|
}
|
|
@@ -20245,21 +20452,46 @@ class ReadTreasuryManagerFactory {
|
|
|
20245
20452
|
abi: TreasuryManagerFactoryAbi,
|
|
20246
20453
|
address,
|
|
20247
20454
|
});
|
|
20455
|
+
this.chainId = chainId;
|
|
20456
|
+
}
|
|
20457
|
+
async getManagerDeployedAddressFromTx(hash) {
|
|
20458
|
+
// Create a public client to get the transaction receipt with logs
|
|
20459
|
+
const publicClient = viem.createPublicClient({
|
|
20460
|
+
chain: chainIdToChain[this.chainId],
|
|
20461
|
+
transport: viem.http(),
|
|
20462
|
+
});
|
|
20463
|
+
// Wait for transaction receipt
|
|
20464
|
+
const receipt = await publicClient.waitForTransactionReceipt({ hash });
|
|
20465
|
+
// Get the logs from the receipt and find the ManagerDeployed event
|
|
20466
|
+
const events = await publicClient.getContractEvents({
|
|
20467
|
+
address: this.contract.address,
|
|
20468
|
+
abi: TreasuryManagerFactoryAbi,
|
|
20469
|
+
eventName: "ManagerDeployed",
|
|
20470
|
+
fromBlock: receipt.blockNumber,
|
|
20471
|
+
toBlock: receipt.blockNumber,
|
|
20472
|
+
});
|
|
20473
|
+
// Find the event from our transaction
|
|
20474
|
+
const event = events.find((e) => e.transactionHash === hash);
|
|
20475
|
+
if (!event) {
|
|
20476
|
+
throw new Error("ManagerDeployed event not found in transaction logs");
|
|
20477
|
+
}
|
|
20478
|
+
return event.args._manager;
|
|
20248
20479
|
}
|
|
20249
20480
|
}
|
|
20250
20481
|
class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
|
|
20251
20482
|
constructor(chainId, address, drift$1 = drift.createDrift()) {
|
|
20252
|
-
super(address, drift$1);
|
|
20253
|
-
this.chainId = chainId;
|
|
20483
|
+
super(chainId, address, drift$1);
|
|
20254
20484
|
}
|
|
20255
20485
|
/**
|
|
20256
20486
|
* Deploys a new revenue manager
|
|
20257
20487
|
* @param params - Parameters for deploying the revenue manager
|
|
20258
20488
|
* @param params.protocolRecipient - The address of the protocol recipient
|
|
20259
20489
|
* @param params.protocolFeePercent - The percentage of the protocol fee
|
|
20490
|
+
* @param params.permissions - The permissions for the revenue manager
|
|
20260
20491
|
* @returns Transaction response
|
|
20261
20492
|
*/
|
|
20262
20493
|
deployRevenueManager(params) {
|
|
20494
|
+
const permissionsAddress = getPermissionsAddress(params.permissions ?? exports.Permissions.OPEN, this.chainId);
|
|
20263
20495
|
return this.contract.write("deployAndInitializeManager", {
|
|
20264
20496
|
_managerImplementation: RevenueManagerAddress[this.chainId],
|
|
20265
20497
|
_owner: params.protocolRecipient,
|
|
@@ -20277,6 +20509,48 @@ class ReadWriteTreasuryManagerFactory extends ReadTreasuryManagerFactory {
|
|
|
20277
20509
|
protocolFee: BigInt(params.protocolFeePercent * 100), // Convert percentage to basis points
|
|
20278
20510
|
},
|
|
20279
20511
|
]),
|
|
20512
|
+
_permissions: permissionsAddress,
|
|
20513
|
+
});
|
|
20514
|
+
}
|
|
20515
|
+
/**
|
|
20516
|
+
* Deploys a new staking manager
|
|
20517
|
+
* @param params - Parameters for deploying the staking manager
|
|
20518
|
+
* @param params.managerOwner - The address of the manager owner
|
|
20519
|
+
* @param params.stakingToken - The address of the token to be staked
|
|
20520
|
+
* @param params.minEscrowDuration - The minimum duration (in seconds) that the creator's NFT is locked for
|
|
20521
|
+
* @param params.minStakeDuration - The minimum duration (in seconds) that the user's tokens are locked for
|
|
20522
|
+
* @param params.creatorSharePercent - The % share that a creator will earn from their token
|
|
20523
|
+
* @param params.ownerSharePercent - The % share that the manager owner will earn from their token
|
|
20524
|
+
* @param params.permissions - The permissions for the staking manager
|
|
20525
|
+
* @returns Transaction response
|
|
20526
|
+
*/
|
|
20527
|
+
deployStakingManager(params) {
|
|
20528
|
+
const permissionsAddress = getPermissionsAddress(params.permissions ?? exports.Permissions.OPEN, this.chainId);
|
|
20529
|
+
const VALID_SHARE_TOTAL = 10000000n; // 5 decimals as BigInt
|
|
20530
|
+
return this.contract.write("deployAndInitializeManager", {
|
|
20531
|
+
_managerImplementation: StakingManagerAddress[this.chainId],
|
|
20532
|
+
_owner: params.managerOwner,
|
|
20533
|
+
_data: viem.encodeAbiParameters([
|
|
20534
|
+
{
|
|
20535
|
+
type: "tuple",
|
|
20536
|
+
components: [
|
|
20537
|
+
{ type: "address", name: "stakingToken" },
|
|
20538
|
+
{ type: "uint256", name: "minEscrowDuration" },
|
|
20539
|
+
{ type: "uint256", name: "minStakeDuration" },
|
|
20540
|
+
{ type: "uint256", name: "creatorShare" },
|
|
20541
|
+
{ type: "uint256", name: "ownerShare" },
|
|
20542
|
+
],
|
|
20543
|
+
},
|
|
20544
|
+
], [
|
|
20545
|
+
{
|
|
20546
|
+
stakingToken: params.stakingToken,
|
|
20547
|
+
minEscrowDuration: params.minEscrowDuration,
|
|
20548
|
+
minStakeDuration: params.minStakeDuration,
|
|
20549
|
+
creatorShare: (BigInt(params.creatorSharePercent) * VALID_SHARE_TOTAL) / 100n,
|
|
20550
|
+
ownerShare: (BigInt(params.ownerSharePercent) * VALID_SHARE_TOTAL) / 100n,
|
|
20551
|
+
},
|
|
20552
|
+
]),
|
|
20553
|
+
_permissions: permissionsAddress,
|
|
20280
20554
|
});
|
|
20281
20555
|
}
|
|
20282
20556
|
}
|
|
@@ -21414,6 +21688,185 @@ class ReadWriteRevenueManager extends ReadRevenueManager {
|
|
|
21414
21688
|
}
|
|
21415
21689
|
}
|
|
21416
21690
|
|
|
21691
|
+
const TreasuryManagerAbi = [
|
|
21692
|
+
{
|
|
21693
|
+
type: "function",
|
|
21694
|
+
name: "deposit",
|
|
21695
|
+
inputs: [
|
|
21696
|
+
{
|
|
21697
|
+
name: "_flaunchToken",
|
|
21698
|
+
type: "tuple",
|
|
21699
|
+
internalType: "struct ITreasuryManager.FlaunchToken",
|
|
21700
|
+
components: [
|
|
21701
|
+
{
|
|
21702
|
+
name: "flaunch",
|
|
21703
|
+
type: "address",
|
|
21704
|
+
internalType: "contract Flaunch",
|
|
21705
|
+
},
|
|
21706
|
+
{ name: "tokenId", type: "uint256", internalType: "uint256" },
|
|
21707
|
+
],
|
|
21708
|
+
},
|
|
21709
|
+
{ name: "_creator", type: "address", internalType: "address" },
|
|
21710
|
+
{ name: "_data", type: "bytes", internalType: "bytes" },
|
|
21711
|
+
],
|
|
21712
|
+
outputs: [],
|
|
21713
|
+
stateMutability: "nonpayable",
|
|
21714
|
+
},
|
|
21715
|
+
{
|
|
21716
|
+
type: "function",
|
|
21717
|
+
name: "initialize",
|
|
21718
|
+
inputs: [
|
|
21719
|
+
{ name: "_owner", type: "address", internalType: "address" },
|
|
21720
|
+
{ name: "_data", type: "bytes", internalType: "bytes" },
|
|
21721
|
+
],
|
|
21722
|
+
outputs: [],
|
|
21723
|
+
stateMutability: "nonpayable",
|
|
21724
|
+
},
|
|
21725
|
+
{
|
|
21726
|
+
type: "function",
|
|
21727
|
+
name: "managerOwner",
|
|
21728
|
+
inputs: [],
|
|
21729
|
+
outputs: [{ name: "", type: "address", internalType: "address" }],
|
|
21730
|
+
stateMutability: "view",
|
|
21731
|
+
},
|
|
21732
|
+
{
|
|
21733
|
+
type: "function",
|
|
21734
|
+
name: "permissions",
|
|
21735
|
+
inputs: [],
|
|
21736
|
+
outputs: [
|
|
21737
|
+
{
|
|
21738
|
+
name: "",
|
|
21739
|
+
type: "address",
|
|
21740
|
+
internalType: "contract IManagerPermissions",
|
|
21741
|
+
},
|
|
21742
|
+
],
|
|
21743
|
+
stateMutability: "view",
|
|
21744
|
+
},
|
|
21745
|
+
{
|
|
21746
|
+
type: "function",
|
|
21747
|
+
name: "rescue",
|
|
21748
|
+
inputs: [
|
|
21749
|
+
{
|
|
21750
|
+
name: "_flaunchToken",
|
|
21751
|
+
type: "tuple",
|
|
21752
|
+
internalType: "struct ITreasuryManager.FlaunchToken",
|
|
21753
|
+
components: [
|
|
21754
|
+
{
|
|
21755
|
+
name: "flaunch",
|
|
21756
|
+
type: "address",
|
|
21757
|
+
internalType: "contract Flaunch",
|
|
21758
|
+
},
|
|
21759
|
+
{ name: "tokenId", type: "uint256", internalType: "uint256" },
|
|
21760
|
+
],
|
|
21761
|
+
},
|
|
21762
|
+
{ name: "_recipient", type: "address", internalType: "address" },
|
|
21763
|
+
],
|
|
21764
|
+
outputs: [],
|
|
21765
|
+
stateMutability: "nonpayable",
|
|
21766
|
+
},
|
|
21767
|
+
{
|
|
21768
|
+
type: "function",
|
|
21769
|
+
name: "setPermissions",
|
|
21770
|
+
inputs: [
|
|
21771
|
+
{ name: "_permissions", type: "address", internalType: "address" },
|
|
21772
|
+
],
|
|
21773
|
+
outputs: [],
|
|
21774
|
+
stateMutability: "nonpayable",
|
|
21775
|
+
},
|
|
21776
|
+
{
|
|
21777
|
+
type: "function",
|
|
21778
|
+
name: "transferManagerOwnership",
|
|
21779
|
+
inputs: [
|
|
21780
|
+
{
|
|
21781
|
+
name: "_newManagerOwner",
|
|
21782
|
+
type: "address",
|
|
21783
|
+
internalType: "address",
|
|
21784
|
+
},
|
|
21785
|
+
],
|
|
21786
|
+
outputs: [],
|
|
21787
|
+
stateMutability: "nonpayable",
|
|
21788
|
+
},
|
|
21789
|
+
];
|
|
21790
|
+
|
|
21791
|
+
/**
|
|
21792
|
+
* Client for interacting with the TreasuryManager contract in read-only mode
|
|
21793
|
+
* Provides methods to query permissions and manager owner
|
|
21794
|
+
*/
|
|
21795
|
+
class ReadTreasuryManager {
|
|
21796
|
+
/**
|
|
21797
|
+
* Creates a new ReadTreasuryManager instance
|
|
21798
|
+
* @param address - The address of the TreasuryManager contract
|
|
21799
|
+
* @param drift - Optional drift instance for contract interactions (creates new instance if not provided)
|
|
21800
|
+
* @throws Error if address is not provided
|
|
21801
|
+
*/
|
|
21802
|
+
constructor(address, drift$1 = drift.createDrift()) {
|
|
21803
|
+
if (!address) {
|
|
21804
|
+
throw new Error("Address is required");
|
|
21805
|
+
}
|
|
21806
|
+
this.contract = drift$1.contract({
|
|
21807
|
+
abi: TreasuryManagerAbi,
|
|
21808
|
+
address,
|
|
21809
|
+
});
|
|
21810
|
+
}
|
|
21811
|
+
/**
|
|
21812
|
+
* Gets the permissions contract address
|
|
21813
|
+
* @returns Promise<Address> - The address of the permissions contract
|
|
21814
|
+
*/
|
|
21815
|
+
permissions() {
|
|
21816
|
+
return this.contract.read("permissions");
|
|
21817
|
+
}
|
|
21818
|
+
/**
|
|
21819
|
+
* Gets the manager owner address
|
|
21820
|
+
* @returns Promise<Address> - The address of the manager owner
|
|
21821
|
+
*/
|
|
21822
|
+
managerOwner() {
|
|
21823
|
+
return this.contract.read("managerOwner");
|
|
21824
|
+
}
|
|
21825
|
+
}
|
|
21826
|
+
/**
|
|
21827
|
+
* Extended client for interacting with the TreasuryManager contract with write capabilities
|
|
21828
|
+
* Provides methods to deposit tokens, set permissions, and transfer ownership
|
|
21829
|
+
*/
|
|
21830
|
+
class ReadWriteTreasuryManager extends ReadTreasuryManager {
|
|
21831
|
+
constructor(address, drift$1 = drift.createDrift()) {
|
|
21832
|
+
super(address, drift$1);
|
|
21833
|
+
}
|
|
21834
|
+
/**
|
|
21835
|
+
* Deposits a flaunch token to the treasury
|
|
21836
|
+
* @param flaunchToken - The flaunch token to deposit
|
|
21837
|
+
* @param creator - The address of the creator
|
|
21838
|
+
* @param data - Additional data for the deposit
|
|
21839
|
+
* @returns Promise<void>
|
|
21840
|
+
*/
|
|
21841
|
+
deposit(flaunchToken, creator, data) {
|
|
21842
|
+
return this.contract.write("deposit", {
|
|
21843
|
+
_flaunchToken: flaunchToken,
|
|
21844
|
+
_creator: creator,
|
|
21845
|
+
_data: data,
|
|
21846
|
+
});
|
|
21847
|
+
}
|
|
21848
|
+
/**
|
|
21849
|
+
* Sets the permissions contract address
|
|
21850
|
+
* @param permissions - The address of the new permissions contract
|
|
21851
|
+
* @returns Promise<void>
|
|
21852
|
+
*/
|
|
21853
|
+
setPermissions(permissions) {
|
|
21854
|
+
return this.contract.write("setPermissions", {
|
|
21855
|
+
_permissions: permissions,
|
|
21856
|
+
});
|
|
21857
|
+
}
|
|
21858
|
+
/**
|
|
21859
|
+
* Transfers the manager ownership to a new address
|
|
21860
|
+
* @param newManagerOwner - The address of the new manager owner
|
|
21861
|
+
* @returns Promise<void>
|
|
21862
|
+
*/
|
|
21863
|
+
transferManagerOwnership(newManagerOwner) {
|
|
21864
|
+
return this.contract.write("transferManagerOwnership", {
|
|
21865
|
+
_newManagerOwner: newManagerOwner,
|
|
21866
|
+
});
|
|
21867
|
+
}
|
|
21868
|
+
}
|
|
21869
|
+
|
|
21417
21870
|
// our min/max tick range that is valid for the tick spacing (60)
|
|
21418
21871
|
const TickFinder = {
|
|
21419
21872
|
MIN_TICK: -887220,
|
|
@@ -21505,11 +21958,6 @@ const calculateUnderlyingTokenBalances = (liquidity, tickLower, tickUpper, tickC
|
|
|
21505
21958
|
return { amount0, amount1 };
|
|
21506
21959
|
};
|
|
21507
21960
|
|
|
21508
|
-
const chainIdToChain = {
|
|
21509
|
-
[base.id]: base,
|
|
21510
|
-
[baseSepolia.id]: baseSepolia,
|
|
21511
|
-
};
|
|
21512
|
-
|
|
21513
21961
|
const FastFlaunchZapAbi = [
|
|
21514
21962
|
{
|
|
21515
21963
|
inputs: [
|
|
@@ -21677,6 +22125,22 @@ class ReadFlaunchSDK {
|
|
|
21677
22125
|
return this.readBidWallV1_1;
|
|
21678
22126
|
}
|
|
21679
22127
|
}
|
|
22128
|
+
/**
|
|
22129
|
+
* Gets the flaunch contract address for a given version
|
|
22130
|
+
* @param version - The version to get the flaunch contract address for
|
|
22131
|
+
*/
|
|
22132
|
+
getFlaunchAddress(version) {
|
|
22133
|
+
switch (version) {
|
|
22134
|
+
case exports.FlaunchVersion.V1:
|
|
22135
|
+
return this.readFlaunch.contract.address;
|
|
22136
|
+
case exports.FlaunchVersion.V1_1:
|
|
22137
|
+
return this.readFlaunchV1_1.contract.address;
|
|
22138
|
+
case exports.FlaunchVersion.ANY:
|
|
22139
|
+
return this.readFlaunchV1_1.contract.address;
|
|
22140
|
+
default:
|
|
22141
|
+
return this.readFlaunchV1_1.contract.address;
|
|
22142
|
+
}
|
|
22143
|
+
}
|
|
21680
22144
|
getPositionManagerAddress(version) {
|
|
21681
22145
|
return this.getPositionManager(version).contract.address;
|
|
21682
22146
|
}
|
|
@@ -22196,6 +22660,22 @@ class ReadFlaunchSDK {
|
|
|
22196
22660
|
const readRevenueManager = new ReadRevenueManager(params.revenueManagerAddress, this.drift);
|
|
22197
22661
|
return readRevenueManager.allTokensInManager(params.sortByDesc);
|
|
22198
22662
|
}
|
|
22663
|
+
/**
|
|
22664
|
+
* Gets treasury manager information including owner and permissions
|
|
22665
|
+
* @param treasuryManagerAddress - The address of the treasury manager
|
|
22666
|
+
* @returns Promise<{managerOwner: Address, permissions: Address}> - Treasury manager owner and permissions contract addresses
|
|
22667
|
+
*/
|
|
22668
|
+
async treasuryManagerInfo(treasuryManagerAddress) {
|
|
22669
|
+
const readTreasuryManager = new ReadTreasuryManager(treasuryManagerAddress, this.drift);
|
|
22670
|
+
const [managerOwner, permissions] = await Promise.all([
|
|
22671
|
+
readTreasuryManager.managerOwner(),
|
|
22672
|
+
readTreasuryManager.permissions(),
|
|
22673
|
+
]);
|
|
22674
|
+
return {
|
|
22675
|
+
managerOwner,
|
|
22676
|
+
permissions,
|
|
22677
|
+
};
|
|
22678
|
+
}
|
|
22199
22679
|
/**
|
|
22200
22680
|
* Gets the pool ID for a given coin
|
|
22201
22681
|
* @param coinAddress - The address of the coin
|
|
@@ -22331,6 +22811,22 @@ class ReadFlaunchSDK {
|
|
|
22331
22811
|
tokenImporterVerifyMemecoin(memecoin) {
|
|
22332
22812
|
return this.readTokenImporter.verifyMemecoin(memecoin);
|
|
22333
22813
|
}
|
|
22814
|
+
/**
|
|
22815
|
+
* Checks if an operator is approved for all flaunch tokens of an owner
|
|
22816
|
+
* @param version - The flaunch version to determine the correct contract address
|
|
22817
|
+
* @param owner - The owner address to check
|
|
22818
|
+
* @param operator - The operator address to check
|
|
22819
|
+
* @returns Promise<boolean> - True if operator is approved for all tokens
|
|
22820
|
+
*/
|
|
22821
|
+
async isFlaunchTokenApprovedForAll(version, owner, operator) {
|
|
22822
|
+
const flaunchAddress = this.getFlaunchAddress(version);
|
|
22823
|
+
return this.drift.read({
|
|
22824
|
+
abi: viem.erc721Abi,
|
|
22825
|
+
address: flaunchAddress,
|
|
22826
|
+
fn: "isApprovedForAll",
|
|
22827
|
+
args: { owner, operator },
|
|
22828
|
+
});
|
|
22829
|
+
}
|
|
22334
22830
|
}
|
|
22335
22831
|
class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
22336
22832
|
constructor(chainId, drift$1 = drift.createDrift()) {
|
|
@@ -22350,31 +22846,28 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
22350
22846
|
* @param params - Parameters for deploying the revenue manager
|
|
22351
22847
|
* @param params.protocolRecipient - The address of the protocol recipient
|
|
22352
22848
|
* @param params.protocolFeePercent - The percentage of the protocol fee
|
|
22849
|
+
* @param params.permissions - The permissions for the revenue manager
|
|
22353
22850
|
* @returns Address of the deployed revenue manager
|
|
22354
22851
|
*/
|
|
22355
22852
|
async deployRevenueManager(params) {
|
|
22356
22853
|
const hash = await this.readWriteTreasuryManagerFactory.deployRevenueManager(params);
|
|
22357
|
-
|
|
22358
|
-
|
|
22359
|
-
|
|
22360
|
-
|
|
22361
|
-
|
|
22362
|
-
|
|
22363
|
-
|
|
22364
|
-
|
|
22365
|
-
|
|
22366
|
-
|
|
22367
|
-
|
|
22368
|
-
|
|
22369
|
-
|
|
22370
|
-
|
|
22371
|
-
|
|
22372
|
-
|
|
22373
|
-
|
|
22374
|
-
if (!event) {
|
|
22375
|
-
throw new Error("ManagerDeployed event not found in transaction logs");
|
|
22376
|
-
}
|
|
22377
|
-
return event.args._manager;
|
|
22854
|
+
return await this.readWriteTreasuryManagerFactory.getManagerDeployedAddressFromTx(hash);
|
|
22855
|
+
}
|
|
22856
|
+
/**
|
|
22857
|
+
* Deploys a new staking manager
|
|
22858
|
+
* @param params - Parameters for deploying the staking manager
|
|
22859
|
+
* @param params.managerOwner - The address of the manager owner
|
|
22860
|
+
* @param params.stakingToken - The address of the token to be staked
|
|
22861
|
+
* @param params.minEscrowDuration - The minimum duration (in seconds) that the creator's NFT is locked for
|
|
22862
|
+
* @param params.minStakeDuration - The minimum duration (in seconds) that the user's tokens are locked for
|
|
22863
|
+
* @param params.creatorSharePercent - The % share that a creator will earn from their token
|
|
22864
|
+
* @param params.ownerSharePercent - The % share that the manager owner will earn from their token
|
|
22865
|
+
* @param params.permissions - The permissions for the staking manager
|
|
22866
|
+
* @returns Address of the deployed staking manager
|
|
22867
|
+
*/
|
|
22868
|
+
async deployStakingManager(params) {
|
|
22869
|
+
const hash = await this.readWriteTreasuryManagerFactory.deployStakingManager(params);
|
|
22870
|
+
return await this.readWriteTreasuryManagerFactory.getManagerDeployedAddressFromTx(hash);
|
|
22378
22871
|
}
|
|
22379
22872
|
/**
|
|
22380
22873
|
* Creates a new Flaunch on the specified version
|
|
@@ -22629,6 +23122,63 @@ class ReadWriteFlaunchSDK extends ReadFlaunchSDK {
|
|
|
22629
23122
|
const readWriteRevenueManager = new ReadWriteRevenueManager(params.revenueManagerAddress, this.drift);
|
|
22630
23123
|
return readWriteRevenueManager.creatorClaimForTokens(params.flaunchTokens);
|
|
22631
23124
|
}
|
|
23125
|
+
/**
|
|
23126
|
+
* Sets the permissions contract address for a treasury manager
|
|
23127
|
+
* @param treasuryManagerAddress - The address of the treasury manager
|
|
23128
|
+
* @param permissions - The permissions enum value to set
|
|
23129
|
+
* @returns Transaction response
|
|
23130
|
+
*/
|
|
23131
|
+
treasuryManagerSetPermissions(treasuryManagerAddress, permissions) {
|
|
23132
|
+
const readWriteTreasuryManager = new ReadWriteTreasuryManager(treasuryManagerAddress, this.drift);
|
|
23133
|
+
const permissionsAddress = getPermissionsAddress(permissions, this.chainId);
|
|
23134
|
+
return readWriteTreasuryManager.setPermissions(permissionsAddress);
|
|
23135
|
+
}
|
|
23136
|
+
/**
|
|
23137
|
+
* Transfers the ownership of a treasury manager to a new address
|
|
23138
|
+
* @param treasuryManagerAddress - The address of the treasury manager
|
|
23139
|
+
* @param newManagerOwner - The address of the new manager owner
|
|
23140
|
+
* @returns Transaction response
|
|
23141
|
+
*/
|
|
23142
|
+
treasuryManagerTransferOwnership(treasuryManagerAddress, newManagerOwner) {
|
|
23143
|
+
const readWriteTreasuryManager = new ReadWriteTreasuryManager(treasuryManagerAddress, this.drift);
|
|
23144
|
+
return readWriteTreasuryManager.transferManagerOwnership(newManagerOwner);
|
|
23145
|
+
}
|
|
23146
|
+
/**
|
|
23147
|
+
* Sets approval for all flaunch tokens to an operator
|
|
23148
|
+
* @param version - The flaunch version to determine the correct contract address
|
|
23149
|
+
* @param operator - The operator address to approve/revoke
|
|
23150
|
+
* @param approved - Whether to approve or revoke approval
|
|
23151
|
+
* @returns Transaction response
|
|
23152
|
+
*/
|
|
23153
|
+
async setFlaunchTokenApprovalForAll(version, operator, approved) {
|
|
23154
|
+
const flaunchAddress = this.getFlaunchAddress(version);
|
|
23155
|
+
return this.drift.write({
|
|
23156
|
+
abi: viem.erc721Abi,
|
|
23157
|
+
address: flaunchAddress,
|
|
23158
|
+
fn: "setApprovalForAll",
|
|
23159
|
+
args: { operator, approved },
|
|
23160
|
+
});
|
|
23161
|
+
}
|
|
23162
|
+
/**
|
|
23163
|
+
* Adds an existing flaunch token to a treasury manager. NFT approval must be given prior to calling this function.
|
|
23164
|
+
* @param treasuryManagerAddress - The address of the treasury manager
|
|
23165
|
+
* @param version - The flaunch version to determine the correct contract address
|
|
23166
|
+
* @param tokenId - The token ID to deposit
|
|
23167
|
+
* @param creator - Optional creator address. If not provided, uses the connected wallet address
|
|
23168
|
+
* @param data - Optional additional data for the deposit (defaults to empty bytes)
|
|
23169
|
+
* @returns Transaction response
|
|
23170
|
+
*/
|
|
23171
|
+
async addToTreasuryManager(treasuryManagerAddress, version, tokenId, creator, data = "0x") {
|
|
23172
|
+
const readWriteTreasuryManager = new ReadWriteTreasuryManager(treasuryManagerAddress, this.drift);
|
|
23173
|
+
// Get the flaunch contract address based on version
|
|
23174
|
+
const flaunchAddress = this.getFlaunchAddress(version);
|
|
23175
|
+
const flaunchToken = {
|
|
23176
|
+
flaunch: flaunchAddress,
|
|
23177
|
+
tokenId,
|
|
23178
|
+
};
|
|
23179
|
+
const creatorAddress = creator ?? (await this.drift.getSignerAddress());
|
|
23180
|
+
return readWriteTreasuryManager.deposit(flaunchToken, creatorAddress, data);
|
|
23181
|
+
}
|
|
22632
23182
|
/**
|
|
22633
23183
|
* Imports a memecoin into the TokenImporter
|
|
22634
23184
|
* @param params.memecoin - The address of the memecoin to import
|
|
@@ -22695,6 +23245,7 @@ exports.BidWallV1_1Abi = BidWallV1_1Abi;
|
|
|
22695
23245
|
exports.BidWallV1_1Address = BidWallV1_1Address;
|
|
22696
23246
|
exports.BidwallAbi = BidwallAbi;
|
|
22697
23247
|
exports.ClankerWorldVerifierAddress = ClankerWorldVerifierAddress;
|
|
23248
|
+
exports.ClosedPermissionsAddress = ClosedPermissionsAddress;
|
|
22698
23249
|
exports.DopplerVerifierAddress = DopplerVerifierAddress;
|
|
22699
23250
|
exports.FLETHAddress = FLETHAddress;
|
|
22700
23251
|
exports.FLETHHooksAddress = FLETHHooksAddress;
|
|
@@ -22734,6 +23285,7 @@ exports.ReferralEscrowAbi = ReferralEscrowAbi;
|
|
|
22734
23285
|
exports.ReferralEscrowAddress = ReferralEscrowAddress;
|
|
22735
23286
|
exports.RevenueManagerAbi = RevenueManagerAbi;
|
|
22736
23287
|
exports.RevenueManagerAddress = RevenueManagerAddress;
|
|
23288
|
+
exports.StakingManagerAddress = StakingManagerAddress;
|
|
22737
23289
|
exports.StateViewAbi = StateViewAbi;
|
|
22738
23290
|
exports.StateViewAddress = StateViewAddress;
|
|
22739
23291
|
exports.TICK_SPACING = TICK_SPACING;
|
|
@@ -22746,6 +23298,7 @@ exports.UniversalRouterAbi = UniversalRouterAbi;
|
|
|
22746
23298
|
exports.UniversalRouterAddress = UniversalRouterAddress;
|
|
22747
23299
|
exports.VirtualsVerifierAddress = VirtualsVerifierAddress;
|
|
22748
23300
|
exports.WhitelistVerifierAddress = WhitelistVerifierAddress;
|
|
23301
|
+
exports.WhitelistedPermissionsAddress = WhitelistedPermissionsAddress;
|
|
22749
23302
|
exports.ZoraVerifierAddress = ZoraVerifierAddress;
|
|
22750
23303
|
exports.bytes32ToUint256 = bytes32ToUint256;
|
|
22751
23304
|
exports.calculateUnderlyingTokenBalances = calculateUnderlyingTokenBalances;
|
|
@@ -22755,6 +23308,7 @@ exports.createFlaunch = createFlaunch;
|
|
|
22755
23308
|
exports.ethToMemecoin = ethToMemecoin;
|
|
22756
23309
|
exports.generateTokenUri = generateTokenUri;
|
|
22757
23310
|
exports.getAmountWithSlippage = getAmountWithSlippage;
|
|
23311
|
+
exports.getPermissionsAddress = getPermissionsAddress;
|
|
22758
23312
|
exports.getPermit2TypedData = getPermit2TypedData;
|
|
22759
23313
|
exports.getPoolId = getPoolId;
|
|
22760
23314
|
exports.getSqrtPriceX96FromTick = getSqrtPriceX96FromTick;
|