four-flap-meme-sdk 2.2.8 → 2.2.11
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/README.en.md +6 -41
- package/README.md +0 -31
- package/README.zh-CN.md +6 -41
- package/dist/chains/bsc/four/approve-tokenmanager.d.ts +26 -1
- package/dist/chains/bsc/four/approve-tokenmanager.js +113 -1
- package/dist/chains/bsc/four/config.d.ts +67 -5
- package/dist/chains/bsc/four/config.js +114 -2
- package/dist/chains/bsc/four/core.d.ts +4 -1
- package/dist/chains/bsc/four/core.js +592 -1
- package/dist/chains/bsc/four/index.d.ts +6 -6
- package/dist/chains/bsc/four/index.js +6 -6
- package/dist/chains/bsc/four/internal.d.ts +46 -2
- package/dist/chains/bsc/four/internal.js +239 -2
- package/dist/chains/bsc/four/pancake-proxy.d.ts +28 -1
- package/dist/chains/bsc/four/pancake-proxy.js +687 -1
- package/dist/chains/bsc/four/private.d.ts +27 -1
- package/dist/chains/bsc/four/private.js +477 -1
- package/dist/chains/bsc/four/submit.d.ts +315 -2
- package/dist/chains/bsc/four/submit.js +752 -2
- package/dist/chains/bsc/four/swap-buy-first.d.ts +55 -2
- package/dist/chains/bsc/four/swap-buy-first.js +507 -2
- package/dist/chains/bsc/four/swap-internal.d.ts +3 -1
- package/dist/chains/bsc/four/swap-internal.js +18 -1
- package/dist/chains/bsc/four/swap.d.ts +144 -2
- package/dist/chains/bsc/four/swap.js +766 -2
- package/dist/chains/bsc/four/types.d.ts +476 -1
- package/dist/chains/bsc/four/utils.d.ts +18 -5
- package/dist/chains/bsc/four/utils.js +1552 -5
- package/dist/chains/bsc/pancake/bundle-buy-first.d.ts +91 -1
- package/dist/chains/bsc/pancake/bundle-buy-first.js +212 -97
- package/dist/chains/bsc/pancake/bundle-swap.d.ts +79 -1
- package/dist/chains/bsc/pancake/bundle-swap.js +726 -114
- package/dist/chains/bsc/pancake/index.d.ts +2 -4
- package/dist/chains/bsc/pancake/index.js +3 -1
- package/dist/chains/bsc/platforms/iro/factory.d.ts +2 -2
- package/dist/chains/bsc/platforms/iro/factory.js +1 -3
- package/dist/chains/bsc/platforms/iro/index.d.ts +5 -5
- package/dist/chains/bsc/platforms/iro/index.js +3 -3
- package/dist/chains/bsc/platforms/iro/pool.js +10 -31
- package/dist/chains/bsc/platforms/iro/token.js +1 -4
- package/dist/chains/eni/batch-router/bundle-approve.js +3 -4
- package/dist/chains/eni/batch-router/transfer.js +25 -55
- package/dist/chains/eni/batch-router/utils.js +6 -32
- package/dist/chains/eni/bundler/sign.js +6 -5
- package/dist/chains/eni/bundler/submit.js +4 -1
- package/dist/chains/eni/constants.js +1 -1
- package/dist/chains/eni/index.d.ts +1 -2
- package/dist/chains/eni/index.js +0 -1
- package/dist/chains/eni/platforms/daoaas/create.js +2 -2
- package/dist/chains/eni/platforms/daoaas/index.d.ts +3 -3
- package/dist/chains/eni/platforms/daoaas/index.js +3 -3
- package/dist/chains/eni/platforms/daoaas/meta.js +6 -9
- package/dist/chains/eni/platforms/daoaas/portal-direct.js +44 -28
- package/dist/chains/eni/platforms/daoaas/portal.js +6 -10
- package/dist/chains/eni/platforms/dswap/liquidity.js +26 -58
- package/dist/chains/eni/platforms/fair-launch/index.d.ts +2 -2
- package/dist/chains/eni/platforms/fair-launch/index.js +1 -1
- package/dist/chains/eni/platforms/fair-launch/launcher.js +46 -87
- package/dist/chains/eni/platforms/fair-launch/pool.js +1 -4
- package/dist/chains/eni/platforms/fair-launch/presets.js +2 -2
- package/dist/chains/eni/platforms/iro/factory.d.ts +2 -2
- package/dist/chains/eni/platforms/iro/factory.js +1 -3
- package/dist/chains/eni/platforms/iro/index.d.ts +6 -6
- package/dist/chains/eni/platforms/iro/index.js +4 -4
- package/dist/chains/eni/platforms/iro/pool.js +26 -90
- package/dist/chains/eni/platforms/iro/token.js +31 -107
- package/dist/chains/eni/platforms/iro/whitelist.js +18 -6
- package/dist/chains/index.d.ts +0 -13
- package/dist/chains/index.js +0 -13
- package/dist/chains/xlayer/eip7702/bundle-approve.d.ts +26 -2
- package/dist/chains/xlayer/eip7702/bundle-approve.js +21 -11
- package/dist/chains/xlayer/eip7702/bundle-buy.d.ts +6 -2
- package/dist/chains/xlayer/eip7702/bundle-buy.js +51 -13
- package/dist/chains/xlayer/eip7702/bundle-create.js +59 -93
- package/dist/chains/xlayer/eip7702/bundle-sell.d.ts +6 -2
- package/dist/chains/xlayer/eip7702/bundle-sell.js +111 -29
- package/dist/chains/xlayer/eip7702/bundle-swap.d.ts +65 -3
- package/dist/chains/xlayer/eip7702/bundle-swap.js +245 -51
- package/dist/chains/xlayer/eip7702/constants.d.ts +16 -1
- package/dist/chains/xlayer/eip7702/constants.js +21 -3
- package/dist/chains/xlayer/eip7702/index.d.ts +46 -28
- package/dist/chains/xlayer/eip7702/index.js +81 -28
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.d.ts +203 -2
- package/dist/chains/xlayer/eip7702/multi-hop-transfer.js +307 -63
- package/dist/chains/xlayer/eip7702/types.d.ts +0 -88
- package/dist/chains/xlayer/eip7702/utils.d.ts +3 -0
- package/dist/chains/xlayer/eip7702/utils.js +28 -23
- package/dist/chains/xlayer/eip7702/volume.d.ts +184 -6
- package/dist/chains/xlayer/eip7702/volume.js +164 -89
- package/dist/chains/xlayer/eoa/constants.js +1 -1
- package/dist/chains/xlayer/eoa/dex-helpers.js +5 -5
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.d.ts +95 -1
- package/dist/chains/xlayer/eoa/eoa-bundle-swap.js +299 -66
- package/dist/chains/xlayer/eoa/eoa-wash-volume.d.ts +1 -1
- package/dist/chains/xlayer/eoa/eoa-wash-volume.js +23 -18
- package/dist/chains/xlayer/eoa/index.d.ts +6 -10
- package/dist/chains/xlayer/eoa/index.js +23 -8
- package/dist/chains/xlayer/eoa/portal-ops.js +2 -7
- package/dist/chains/xlayer/eoa/router-manager.js +3 -3
- package/dist/chains/xlayer/eoa/types.d.ts +2 -2
- package/dist/chains/xlayer/eoa/types.js +3 -1
- package/dist/chains/xlayer/index.d.ts +2 -3
- package/dist/chains/xlayer/index.js +7 -4
- package/dist/contracts/helper3.d.ts +5 -20
- package/dist/contracts/helper3.js +20 -56
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.d.ts +26 -1
- package/dist/contracts/tm-bundle-merkle/approve-tokenmanager.js +113 -1
- package/dist/contracts/tm-bundle-merkle/config.d.ts +67 -5
- package/dist/contracts/tm-bundle-merkle/config.js +114 -2
- package/dist/contracts/tm-bundle-merkle/core.d.ts +4 -1
- package/dist/contracts/tm-bundle-merkle/core.js +591 -1
- package/dist/contracts/tm-bundle-merkle/index.d.ts +5 -5
- package/dist/contracts/tm-bundle-merkle/index.js +5 -5
- package/dist/contracts/tm-bundle-merkle/internal.d.ts +46 -2
- package/dist/contracts/tm-bundle-merkle/internal.js +238 -2
- package/dist/contracts/tm-bundle-merkle/pancake-proxy.d.ts +28 -1
- package/dist/contracts/tm-bundle-merkle/pancake-proxy.js +686 -1
- package/dist/contracts/tm-bundle-merkle/private.d.ts +27 -1
- package/dist/contracts/tm-bundle-merkle/private.js +476 -1
- package/dist/contracts/tm-bundle-merkle/submit.d.ts +314 -3
- package/dist/contracts/tm-bundle-merkle/submit.js +928 -3
- package/dist/contracts/tm-bundle-merkle/swap-buy-first.d.ts +55 -2
- package/dist/contracts/tm-bundle-merkle/swap-buy-first.js +506 -2
- package/dist/contracts/tm-bundle-merkle/swap-internal.d.ts +3 -1
- package/dist/contracts/tm-bundle-merkle/swap-internal.js +18 -1
- package/dist/contracts/tm-bundle-merkle/swap.d.ts +144 -2
- package/dist/contracts/tm-bundle-merkle/swap.js +764 -2
- package/dist/contracts/tm-bundle-merkle/types.d.ts +476 -1
- package/dist/contracts/tm-bundle-merkle/utils.d.ts +18 -6
- package/dist/contracts/tm-bundle-merkle/utils.js +1501 -6
- package/dist/contracts/tm-bundle.d.ts +51 -3
- package/dist/contracts/tm-bundle.js +177 -108
- package/dist/contracts/tm.d.ts +2 -3
- package/dist/contracts/tm.js +32 -37
- package/dist/contracts/tm1.js +4 -9
- package/dist/contracts/tm2.js +4 -9
- package/dist/dex/direct-router.d.ts +125 -3
- package/dist/dex/direct-router.js +666 -237
- package/dist/flows/create.d.ts +1 -2
- package/dist/flows/create.js +6 -6
- package/dist/index.d.ts +87 -20
- package/dist/index.js +217 -20
- package/dist/shared/abis/TaxToken.json +105 -0
- package/dist/shared/abis/TokenManager2.json +60 -0
- package/dist/shared/abis/common.d.ts +83 -2
- package/dist/shared/abis/common.js +254 -2
- package/dist/shared/abis/index.d.ts +6 -5
- package/dist/shared/abis/index.js +7 -5
- package/dist/shared/clients/blockrazor.js +25 -39
- package/dist/shared/clients/club48.d.ts +2 -2
- package/dist/shared/clients/club48.js +29 -34
- package/dist/shared/clients/emitservice.js +0 -2
- package/dist/shared/clients/four.d.ts +6 -21
- package/dist/shared/clients/four.js +24 -29
- package/dist/shared/clients/merkle.js +34 -27
- package/dist/shared/constants/addresses.d.ts +1 -1
- package/dist/shared/constants/addresses.js +2 -11
- package/dist/shared/constants/chains.d.ts +1 -1
- package/dist/shared/constants/chains.js +1 -1
- package/dist/shared/constants/gas.d.ts +1 -1
- package/dist/shared/constants/gas.js +6 -2
- package/dist/shared/constants/index.d.ts +0 -3
- package/dist/shared/constants/index.js +0 -1
- package/dist/shared/flap/abi.js +1 -1
- package/dist/shared/flap/constants.d.ts +2 -1
- package/dist/shared/flap/constants.js +4 -3
- package/dist/shared/flap/curve.js +0 -3
- package/dist/shared/flap/errors.d.ts +4 -1
- package/dist/shared/flap/errors.js +1 -20
- package/dist/shared/flap/index.d.ts +5 -4
- package/dist/shared/flap/index.js +5 -4
- package/dist/shared/flap/launch-v6.d.ts +127 -0
- package/dist/shared/flap/launch-v6.js +123 -0
- package/dist/shared/flap/meta.d.ts +18 -22
- package/dist/shared/flap/meta.js +17 -12
- package/dist/shared/flap/permit.js +2 -5
- package/dist/shared/flap/pinata.d.ts +6 -22
- package/dist/shared/flap/pinata.js +26 -21
- package/dist/shared/flap/portal-bundle-merkle/config.d.ts +72 -3
- package/dist/shared/flap/portal-bundle-merkle/config.js +124 -4
- package/dist/shared/flap/portal-bundle-merkle/core.d.ts +4 -0
- package/dist/shared/flap/portal-bundle-merkle/core.js +151 -142
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.d.ts +4 -17
- package/dist/shared/flap/portal-bundle-merkle/create-to-dex.js +86 -86
- package/dist/shared/flap/portal-bundle-merkle/curve-to-dex.js +92 -100
- package/dist/shared/flap/portal-bundle-merkle/index.d.ts +7 -11
- package/dist/shared/flap/portal-bundle-merkle/index.js +7 -4
- package/dist/shared/flap/portal-bundle-merkle/pancake-proxy.js +68 -71
- package/dist/shared/flap/portal-bundle-merkle/private.js +114 -61
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.d.ts +64 -1
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first.js +247 -66
- package/dist/shared/flap/portal-bundle-merkle/swap.d.ts +71 -2
- package/dist/shared/flap/portal-bundle-merkle/swap.js +410 -103
- package/dist/shared/flap/portal-bundle-merkle/types.d.ts +12 -88
- package/dist/shared/flap/portal-bundle-merkle/utils.d.ts +80 -1
- package/dist/shared/flap/portal-bundle-merkle/utils.js +265 -145
- package/dist/shared/flap/portal-bundle.js +56 -55
- package/dist/shared/flap/portal-create-token.d.ts +19 -37
- package/dist/shared/flap/portal-create-token.js +124 -121
- package/dist/shared/flap/portal.d.ts +2 -1
- package/dist/shared/flap/portal.js +28 -36
- package/dist/shared/flap/vanity.d.ts +6 -6
- package/dist/shared/flap/vanity.js +21 -15
- package/dist/shared/flap/vault.d.ts +93 -25
- package/dist/shared/flap/vault.js +126 -75
- package/dist/shared/four/tax-token.d.ts +1 -1
- package/dist/shared/four/tax-token.js +7 -27
- package/dist/shared/index.d.ts +0 -6
- package/dist/shared/index.js +0 -4
- package/dist/utils/airdrop-sweep.d.ts +76 -4
- package/dist/utils/airdrop-sweep.js +55 -42
- package/dist/utils/bundle-helpers.d.ts +243 -9
- package/dist/utils/bundle-helpers.js +584 -10
- package/dist/utils/constants.d.ts +61 -5
- package/dist/utils/constants.js +80 -5
- package/dist/utils/contract-factory.d.ts +4 -2
- package/dist/utils/contract-factory.js +18 -25
- package/dist/utils/erc20.d.ts +89 -7
- package/dist/utils/erc20.js +125 -94
- package/dist/utils/errors.d.ts +1 -12
- package/dist/utils/errors.js +1 -60
- package/dist/utils/holders-maker.d.ts +138 -2
- package/dist/utils/holders-maker.js +661 -26
- package/dist/utils/lp-inspect.d.ts +112 -2
- package/dist/utils/lp-inspect.js +223 -73
- package/dist/utils/mpcExclusive.d.ts +5 -2
- package/dist/utils/mpcExclusive.js +3 -4
- package/dist/utils/private-sale.d.ts +58 -2
- package/dist/utils/private-sale.js +15 -4
- package/dist/utils/provider-factory.d.ts +0 -4
- package/dist/utils/provider-factory.js +0 -10
- package/dist/utils/quote-helpers.d.ts +45 -4
- package/dist/utils/quote-helpers.js +74 -17
- package/dist/utils/stealth-transfer.d.ts +28 -2
- package/dist/utils/stealth-transfer.js +15 -31
- package/dist/utils/swap-helpers.d.ts +15 -2
- package/dist/utils/swap-helpers.js +11 -6
- package/dist/utils/wallet.d.ts +25 -2
- package/dist/utils/wallet.js +10 -13
- package/package.json +4 -160
- package/dist/__tests__/subpath-exports.test.d.ts +0 -1
- package/dist/__tests__/subpath-exports.test.js +0 -64
- package/dist/abis/common.d.ts +0 -85
- package/dist/abis/common.js +0 -264
- package/dist/abis/contracts/TaxToken.json +0 -969
- package/dist/abis/contracts/TokenManager2.json +0 -136
- package/dist/abis/contracts/index.d.ts +0 -5
- package/dist/abis/contracts/index.js +0 -5
- package/dist/abis/flap/index.d.ts +0 -3
- package/dist/abis/flap/index.js +0 -3
- package/dist/abis/flap/portal-events.d.ts +0 -6
- package/dist/abis/flap/portal-events.js +0 -17
- package/dist/abis/flap/portal.d.ts +0 -6
- package/dist/abis/flap/portal.js +0 -37
- package/dist/abis/flap/vault.d.ts +0 -171
- package/dist/abis/flap/vault.js +0 -91
- package/dist/abis/index.d.ts +0 -8
- package/dist/abis/index.js +0 -11
- package/dist/bundle-core/__tests__/config-helpers.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/config-helpers.test.js +0 -28
- package/dist/bundle-core/__tests__/facade-parity.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/facade-parity.test.js +0 -33
- package/dist/bundle-core/__tests__/sign-context-helpers.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/sign-context-helpers.test.js +0 -60
- package/dist/bundle-core/__tests__/sign-fixture.test.d.ts +0 -1
- package/dist/bundle-core/__tests__/sign-fixture.test.js +0 -220
- package/dist/bundle-core/__tests__/sign-fixtures.d.ts +0 -10
- package/dist/bundle-core/__tests__/sign-fixtures.js +0 -16
- package/dist/bundle-core/config-helpers.d.ts +0 -36
- package/dist/bundle-core/config-helpers.js +0 -57
- package/dist/bundle-core/errors.d.ts +0 -50
- package/dist/bundle-core/errors.js +0 -35
- package/dist/bundle-core/four-meme/approve-tokenmanager.d.ts +0 -7
- package/dist/bundle-core/four-meme/approve-tokenmanager.js +0 -99
- package/dist/bundle-core/four-meme/core-helpers.d.ts +0 -8
- package/dist/bundle-core/four-meme/core-helpers.js +0 -40
- package/dist/bundle-core/four-meme/core.d.ts +0 -4
- package/dist/bundle-core/four-meme/core.js +0 -515
- package/dist/bundle-core/four-meme/pancake-proxy.d.ts +0 -28
- package/dist/bundle-core/four-meme/pancake-proxy.js +0 -679
- package/dist/bundle-core/four-meme/private.d.ts +0 -27
- package/dist/bundle-core/four-meme/private.js +0 -465
- package/dist/bundle-core/four-meme/sign-context-helpers.d.ts +0 -2
- package/dist/bundle-core/four-meme/sign-context-helpers.js +0 -2
- package/dist/bundle-core/four-meme/swap-buy-first.d.ts +0 -8
- package/dist/bundle-core/four-meme/swap-buy-first.js +0 -493
- package/dist/bundle-core/four-meme/swap-hop-helpers.d.ts +0 -6
- package/dist/bundle-core/four-meme/swap-hop-helpers.js +0 -63
- package/dist/bundle-core/four-meme/swap-internal.d.ts +0 -3
- package/dist/bundle-core/four-meme/swap-internal.js +0 -18
- package/dist/bundle-core/four-meme/swap-sign-helpers.d.ts +0 -27
- package/dist/bundle-core/four-meme/swap-sign-helpers.js +0 -105
- package/dist/bundle-core/four-meme/swap.d.ts +0 -17
- package/dist/bundle-core/four-meme/swap.js +0 -505
- package/dist/bundle-core/four-meme/types/buy-first.d.ts +0 -50
- package/dist/bundle-core/four-meme/types/buy-first.js +0 -1
- package/dist/bundle-core/four-meme/types/core-flow.d.ts +0 -63
- package/dist/bundle-core/four-meme/types/core-flow.js +0 -1
- package/dist/bundle-core/four-meme/types/index.d.ts +0 -600
- package/dist/bundle-core/four-meme/types/index.js +0 -1
- package/dist/bundle-core/four-meme/types/swap-internal.d.ts +0 -19
- package/dist/bundle-core/four-meme/types/swap-internal.js +0 -1
- package/dist/bundle-core/four-meme/types.d.ts +0 -1
- package/dist/bundle-core/four-meme/types.js +0 -1
- package/dist/bundle-core/four-meme/utils-disperse.d.ts +0 -7
- package/dist/bundle-core/four-meme/utils-disperse.js +0 -396
- package/dist/bundle-core/four-meme/utils-pairwise.d.ts +0 -8
- package/dist/bundle-core/four-meme/utils-pairwise.js +0 -328
- package/dist/bundle-core/four-meme/utils-sweep.d.ts +0 -8
- package/dist/bundle-core/four-meme/utils-sweep.js +0 -744
- package/dist/bundle-core/index.d.ts +0 -8
- package/dist/bundle-core/index.js +0 -8
- package/dist/bundle-core/internal.d.ts +0 -21
- package/dist/bundle-core/internal.js +0 -182
- package/dist/bundle-core/sign-context-helpers.d.ts +0 -25
- package/dist/bundle-core/sign-context-helpers.js +0 -67
- package/dist/bundle-core/submit.d.ts +0 -293
- package/dist/bundle-core/submit.js +0 -727
- package/dist/bundle-core/types/index.d.ts +0 -8
- package/dist/bundle-core/types/index.js +0 -1
- package/dist/bundle-core/types.d.ts +0 -1
- package/dist/bundle-core/types.js +0 -1
- package/dist/chains/bsc/four/utils-disperse.d.ts +0 -1
- package/dist/chains/bsc/four/utils-disperse.js +0 -1
- package/dist/chains/bsc/four/utils-pairwise.d.ts +0 -1
- package/dist/chains/bsc/four/utils-pairwise.js +0 -1
- package/dist/chains/bsc/four/utils-sweep.d.ts +0 -1
- package/dist/chains/bsc/four/utils-sweep.js +0 -1
- package/dist/chains/bsc/iro.d.ts +0 -5
- package/dist/chains/bsc/iro.js +0 -4
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.d.ts +0 -159
- package/dist/chains/bsc/pancake/bundle-buy-first-helpers.js +0 -117
- package/dist/chains/bsc/pancake/bundle-swap-helpers.d.ts +0 -241
- package/dist/chains/bsc/pancake/bundle-swap-helpers.js +0 -565
- package/dist/chains/eni/flat-aliases.d.ts +0 -10
- package/dist/chains/eni/flat-aliases.js +0 -8
- package/dist/chains/eni/submit.d.ts +0 -43
- package/dist/chains/eni/submit.js +0 -286
- package/dist/chains/xlayer/eip7702/flat-aliases.d.ts +0 -13
- package/dist/chains/xlayer/eip7702/flat-aliases.js +0 -10
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.d.ts +0 -79
- package/dist/chains/xlayer/eip7702/multi-hop-transfer-helpers.js +0 -1
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.d.ts +0 -26
- package/dist/chains/xlayer/eip7702/transfer-context-helpers.js +0 -57
- package/dist/chains/xlayer/eip7702/volume-helpers.d.ts +0 -148
- package/dist/chains/xlayer/eip7702/volume-helpers.js +0 -48
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.d.ts +0 -126
- package/dist/chains/xlayer/eoa/eoa-bundle-swap-helpers.js +0 -228
- package/dist/contracts/tm-bundle-helpers.d.ts +0 -88
- package/dist/contracts/tm-bundle-helpers.js +0 -72
- package/dist/contracts/tm-bundle-merkle/utils-disperse.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-disperse.js +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-pairwise.js +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-sweep.d.ts +0 -1
- package/dist/contracts/tm-bundle-merkle/utils-sweep.js +0 -1
- package/dist/dex/direct-router-helpers.d.ts +0 -264
- package/dist/dex/direct-router-helpers.js +0 -539
- package/dist/dex/types.d.ts +0 -81
- package/dist/dex/types.js +0 -1
- package/dist/exports/root-bundle-and-tooling.d.ts +0 -27
- package/dist/exports/root-bundle-and-tooling.js +0 -30
- package/dist/exports/root-eni-and-bsc-iro.d.ts +0 -26
- package/dist/exports/root-eni-and-bsc-iro.js +0 -66
- package/dist/exports/root-foundations.d.ts +0 -35
- package/dist/exports/root-foundations.js +0 -70
- package/dist/exports/root-swap-dex-and-xlayer.d.ts +0 -30
- package/dist/exports/root-swap-dex-and-xlayer.js +0 -78
- package/dist/flap/index.d.ts +0 -10
- package/dist/flap/index.js +0 -8
- package/dist/flows/index.d.ts +0 -1
- package/dist/flows/index.js +0 -1
- package/dist/merkle/index.d.ts +0 -12
- package/dist/merkle/index.js +0 -11
- package/dist/shared/clients/index.d.ts +0 -8
- package/dist/shared/clients/index.js +0 -8
- package/dist/shared/constants/quote.d.ts +0 -30
- package/dist/shared/constants/quote.js +0 -37
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.d.ts +0 -32
- package/dist/shared/flap/portal-bundle-merkle/core-helpers.js +0 -83
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.d.ts +0 -125
- package/dist/shared/flap/portal-bundle-merkle/swap-buy-first-helpers.js +0 -113
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.d.ts +0 -149
- package/dist/shared/flap/portal-bundle-merkle/swap-helpers.js +0 -259
- package/dist/shared/foundation/dex/v3-path.d.ts +0 -6
- package/dist/shared/foundation/dex/v3-path.js +0 -35
- package/dist/shared/foundation/gas/bundle-gas.d.ts +0 -49
- package/dist/shared/foundation/gas/bundle-gas.js +0 -93
- package/dist/shared/foundation/gas/profit-hop.d.ts +0 -20
- package/dist/shared/foundation/gas/profit-hop.js +0 -72
- package/dist/shared/foundation/index.d.ts +0 -13
- package/dist/shared/foundation/index.js +0 -12
- package/dist/shared/foundation/nonce/nonce-manager.d.ts +0 -17
- package/dist/shared/foundation/nonce/nonce-manager.js +0 -183
- package/dist/shared/foundation/normalize-unknown.d.ts +0 -9
- package/dist/shared/foundation/normalize-unknown.js +0 -29
- package/dist/shared/foundation/sdk-logger.d.ts +0 -13
- package/dist/shared/foundation/sdk-logger.js +0 -12
- package/dist/shared/foundation/tx/build-request.d.ts +0 -17
- package/dist/shared/foundation/tx/build-request.js +0 -25
- package/dist/shared/foundation/tx/sign-batch.d.ts +0 -5
- package/dist/shared/foundation/tx/sign-batch.js +0 -26
- package/dist/shared/foundation/tx/wallet-sign-patch.d.ts +0 -1
- package/dist/shared/foundation/tx/wallet-sign-patch.js +0 -18
- package/dist/shared/foundation/types/airdrop-sweep.d.ts +0 -79
- package/dist/shared/foundation/types/airdrop-sweep.js +0 -1
- package/dist/shared/foundation/types/erc20.d.ts +0 -65
- package/dist/shared/foundation/types/erc20.js +0 -1
- package/dist/shared/foundation/types/holders-maker.d.ts +0 -64
- package/dist/shared/foundation/types/holders-maker.js +0 -1
- package/dist/shared/foundation/types/index.d.ts +0 -7
- package/dist/shared/foundation/types/index.js +0 -1
- package/dist/shared/foundation/types/lp-inspect.d.ts +0 -102
- package/dist/shared/foundation/types/lp-inspect.js +0 -1
- package/dist/shared/foundation/types/multicall.d.ts +0 -5
- package/dist/shared/foundation/types/multicall.js +0 -1
- package/dist/shared/foundation/types/private-sale.d.ts +0 -35
- package/dist/shared/foundation/types/private-sale.js +0 -1
- package/dist/shared/foundation/types/quote-helpers.d.ts +0 -17
- package/dist/shared/foundation/types/quote-helpers.js +0 -1
- package/dist/types/errors.d.ts +0 -27
- package/dist/types/errors.js +0 -34
- package/dist/utils/holders-maker/addresses.d.ts +0 -12
- package/dist/utils/holders-maker/addresses.js +0 -15
- package/dist/utils/holders-maker/buy-tx.d.ts +0 -44
- package/dist/utils/holders-maker/buy-tx.js +0 -278
- package/dist/utils/holders-maker/constants.d.ts +0 -6
- package/dist/utils/holders-maker/constants.js +0 -7
- package/dist/utils/holders-maker/disperse.d.ts +0 -18
- package/dist/utils/holders-maker/disperse.js +0 -90
- package/dist/utils/holders-maker/routing.d.ts +0 -4
- package/dist/utils/holders-maker/routing.js +0 -45
- package/dist/utils/holders-maker/transfer-tx.d.ts +0 -4
- package/dist/utils/holders-maker/transfer-tx.js +0 -67
- package/dist/utils/holders-maker-helpers.d.ts +0 -9
- package/dist/utils/holders-maker-helpers.js +0 -9
- package/dist/utils/hop-chains.d.ts +0 -35
- package/dist/utils/hop-chains.js +0 -215
- package/dist/utils/lp-inspect-helpers.d.ts +0 -9
- package/dist/utils/lp-inspect-helpers.js +0 -109
- package/dist/utils/types/airdrop-sweep.d.ts +0 -1
- package/dist/utils/types/airdrop-sweep.js +0 -1
- package/dist/utils/types/contract-factory.d.ts +0 -1
- package/dist/utils/types/contract-factory.js +0 -1
- package/dist/utils/types/erc20.d.ts +0 -1
- package/dist/utils/types/erc20.js +0 -1
- package/dist/utils/types/errors.d.ts +0 -1
- package/dist/utils/types/errors.js +0 -1
- package/dist/utils/types/holders-maker.d.ts +0 -1
- package/dist/utils/types/holders-maker.js +0 -1
- package/dist/utils/types/hop-chains.d.ts +0 -8
- package/dist/utils/types/hop-chains.js +0 -1
- package/dist/utils/types/index.d.ts +0 -13
- package/dist/utils/types/index.js +0 -1
- package/dist/utils/types/lp-inspect.d.ts +0 -1
- package/dist/utils/types/lp-inspect.js +0 -1
- package/dist/utils/types/mpc-exclusive.d.ts +0 -5
- package/dist/utils/types/mpc-exclusive.js +0 -1
- package/dist/utils/types/private-sale.d.ts +0 -1
- package/dist/utils/types/private-sale.js +0 -1
- package/dist/utils/types/quote-helpers.d.ts +0 -1
- package/dist/utils/types/quote-helpers.js +0 -1
- package/dist/utils/types/stealth-transfer.d.ts +0 -44
- package/dist/utils/types/stealth-transfer.js +0 -1
- package/dist/utils/types/wallet.d.ts +0 -25
- package/dist/utils/types/wallet.js +0 -1
- package/dist/vanity/index.d.ts +0 -5
- package/dist/vanity/index.js +0 -5
- package/src/abis/contracts/TaxToken.json +0 -969
- package/src/abis/contracts/TokenManager.json +0 -836
- package/src/abis/contracts/TokenManager2.json +0 -136
- package/src/abis/contracts/TokenManagerHelper3.json +0 -993
- /package/dist/{abis/contracts → shared/abis}/TokenManager.json +0 -0
- /package/dist/{abis/contracts → shared/abis}/TokenManagerHelper3.json +0 -0
|
@@ -1,24 +1,19 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Portal 发币交易构建(newTokenV6 / newTokenV7 / VaultPortal)
|
|
3
|
-
*
|
|
4
|
-
* 对齐 Flap 官方文档:
|
|
5
|
-
* - newTokenV6:TOKEN_V2_PERMIT / TOKEN_TAXED_V3
|
|
6
|
-
* - newTokenV7:TOKEN_V3_PERMIT(BSC 标准 V3 / PCS Infinity CL,与 Flap 官网一致)
|
|
7
|
-
* - newTokenV4:已弃用(Portal 侧 FeatureDisabled,勿再使用)
|
|
8
|
-
* - VaultPortal.newTaxTokenWithVault:带金库的税币(legacy 参数结构)
|
|
3
|
+
* @see https://docs.flap.sh/flap/developers/token-launcher-developers/launch-token-through-portal
|
|
9
4
|
*/
|
|
10
5
|
import { Contract, ZeroAddress } from 'ethers';
|
|
11
6
|
import { ZERO_ADDRESS } from '../constants/index.js';
|
|
12
|
-
import {
|
|
7
|
+
import { buildNewTokenV6WithVaultParams, VAULT_PORTAL_ADDRESSES, VAULT_PORTAL_ABI, } from './vault.js';
|
|
8
|
+
import { buildNewTokenV6Params, normalizeTaxV2Fields } from './launch-v6.js';
|
|
13
9
|
import { TokenVersion, MigratorType, FeeType } from './portal.js';
|
|
14
|
-
/** 分红代币:将 launching token 本身作为分红代币 */
|
|
15
10
|
export const MAGIC_DIVIDEND_SELF = '0xfEEDFEEDfeEDFEedFEEdFEEDFeEdfEEdFeEdFEEd';
|
|
16
11
|
function zeroBytes32() {
|
|
17
12
|
return '0x' + '00'.repeat(32);
|
|
18
13
|
}
|
|
19
|
-
function resolveTaxRates(taxConfig, taxRate) {
|
|
20
|
-
const buy = taxConfig?.buyTaxRate ?? taxRate ?? 0;
|
|
21
|
-
const sell = taxConfig?.sellTaxRate ?? taxRate ?? 0;
|
|
14
|
+
function resolveTaxRates(taxConfig, taxRate, buyTaxRate, sellTaxRate) {
|
|
15
|
+
const buy = taxConfig?.buyTaxRate ?? buyTaxRate ?? taxRate ?? 0;
|
|
16
|
+
const sell = taxConfig?.sellTaxRate ?? sellTaxRate ?? taxRate ?? 0;
|
|
22
17
|
return { buyTaxRate: buy & 0xffff, sellTaxRate: sell & 0xffff };
|
|
23
18
|
}
|
|
24
19
|
function validateTaxDistribution(mkt, def, div, lp) {
|
|
@@ -27,77 +22,47 @@ function validateTaxDistribution(mkt, def, div, lp) {
|
|
|
27
22
|
throw new Error(`Tax distribution must sum to 10000 (100%), got ${total}`);
|
|
28
23
|
}
|
|
29
24
|
}
|
|
30
|
-
function
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
symbol: params.tokenInfo.symbol,
|
|
36
|
-
meta: params.tokenInfo.meta,
|
|
37
|
-
dexThresh: (params.dexThresh ?? 1) & 0xff,
|
|
38
|
-
salt: params.salt ?? zeroBytes32(),
|
|
39
|
-
migratorType: (params.migratorType ?? MigratorType.V2_MIGRATOR) & 0xff,
|
|
40
|
-
quoteToken: params.quoteToken || ZERO_ADDRESS,
|
|
41
|
-
quoteAmt: resolveCreateQuoteAmt(params),
|
|
42
|
-
beneficiary: params.beneficiary,
|
|
43
|
-
permitData: '0x',
|
|
44
|
-
extensionID: params.extensionID ?? zeroBytes32(),
|
|
45
|
-
extensionData: params.extensionData ?? '0x',
|
|
46
|
-
dexId: (params.dexId ?? 0) & 0xff,
|
|
47
|
-
lpFeeProfile: (params.lpFeeProfile ?? 0) & 0xff,
|
|
48
|
-
buyTaxRate,
|
|
49
|
-
sellTaxRate,
|
|
50
|
-
taxDuration: BigInt(taxConfig.taxDuration),
|
|
51
|
-
antiFarmerDuration: BigInt(taxConfig.antiFarmerDuration),
|
|
52
|
-
mktBps: dist.mktBps,
|
|
53
|
-
deflationBps: dist.deflationBps,
|
|
54
|
-
dividendBps: dist.dividendBps,
|
|
55
|
-
lpBps: dist.lpBps,
|
|
56
|
-
minimumShareBalance: BigInt(taxConfig.minimumShareBalance ?? 10000) * 10n ** 18n,
|
|
57
|
-
dividendToken: taxConfig.dividendToken || ZeroAddress,
|
|
58
|
-
commissionReceiver: taxConfig.commissionReceiver || ZeroAddress,
|
|
59
|
-
tokenVersion: TokenVersion.TOKEN_TAXED_V3,
|
|
60
|
-
};
|
|
25
|
+
function resolveCreateQuoteAmt(params) {
|
|
26
|
+
return params.initialQuoteAmt ?? 0n;
|
|
27
|
+
}
|
|
28
|
+
function resolveUseV7Portal(params) {
|
|
29
|
+
return !!params.useV7Portal;
|
|
61
30
|
}
|
|
62
|
-
/**
|
|
31
|
+
/** bundle 发币路径:标准 V3(dexId/lpFeeProfile)→ newTokenV7,税币/金库 → V6 */
|
|
32
|
+
export function resolveCreateTokenLaunchFlags(params) {
|
|
33
|
+
const normalizedTax = normalizeTaxLaunchConfig(params.taxV2Config, params.taxRate);
|
|
34
|
+
const hasVault = !!normalizedTax?.vaultConfig && normalizedTax.vaultConfig.vaultType !== 'none';
|
|
35
|
+
const isTaxLaunch = !!normalizedTax || hasVault || (params.taxRate ?? 0) > 0;
|
|
36
|
+
const useV7Portal = !isTaxLaunch &&
|
|
37
|
+
!hasVault &&
|
|
38
|
+
(params.lpFeeProfile !== undefined ||
|
|
39
|
+
params.dexId !== undefined ||
|
|
40
|
+
params.migratorType === MigratorType.PCS_INFINITY_CL_MIGRATOR);
|
|
41
|
+
return { normalizedTax, useV7Portal };
|
|
42
|
+
}
|
|
43
|
+
/** 将 TaxV2Config(含 distribution)归一化;金库发射在税率为 0 时仍返回配置 */
|
|
63
44
|
export function normalizeTaxLaunchConfig(input, fallbackTaxRate) {
|
|
64
45
|
if (!input)
|
|
65
46
|
return undefined;
|
|
66
|
-
const
|
|
67
|
-
const
|
|
68
|
-
const
|
|
69
|
-
const
|
|
70
|
-
|
|
71
|
-
const minimumShareBalance = dist?.minimumShareBalance ?? input.minimumShareBalance;
|
|
72
|
-
const buyTaxRate = input.buyTaxRate ?? fallbackTaxRate ?? 0;
|
|
73
|
-
const sellTaxRate = input.sellTaxRate ?? fallbackTaxRate ?? 0;
|
|
74
|
-
if (buyTaxRate <= 0 && sellTaxRate <= 0)
|
|
47
|
+
const flat = normalizeTaxV2Fields(input);
|
|
48
|
+
const buyTaxRate = fallbackTaxRate ?? 0;
|
|
49
|
+
const sellTaxRate = fallbackTaxRate ?? 0;
|
|
50
|
+
const hasVault = flat.vaultConfig && flat.vaultConfig.vaultType !== 'none';
|
|
51
|
+
if (buyTaxRate <= 0 && sellTaxRate <= 0 && !hasVault)
|
|
75
52
|
return undefined;
|
|
76
53
|
return {
|
|
77
|
-
taxDuration:
|
|
78
|
-
antiFarmerDuration:
|
|
79
|
-
mktBps,
|
|
80
|
-
deflationBps,
|
|
81
|
-
dividendBps,
|
|
82
|
-
lpBps,
|
|
83
|
-
minimumShareBalance,
|
|
84
|
-
buyTaxRate,
|
|
85
|
-
sellTaxRate,
|
|
86
|
-
|
|
87
|
-
commissionReceiver: input.commissionReceiver,
|
|
88
|
-
vaultConfig: input.vaultConfig,
|
|
54
|
+
taxDuration: flat.taxDuration,
|
|
55
|
+
antiFarmerDuration: flat.antiFarmerDuration,
|
|
56
|
+
mktBps: flat.mktBps,
|
|
57
|
+
deflationBps: flat.deflationBps,
|
|
58
|
+
dividendBps: flat.dividendBps,
|
|
59
|
+
lpBps: flat.lpBps,
|
|
60
|
+
minimumShareBalance: flat.minimumShareBalance,
|
|
61
|
+
buyTaxRate: buyTaxRate > 0 ? buyTaxRate : (hasVault ? 1 : 0),
|
|
62
|
+
sellTaxRate: sellTaxRate > 0 ? sellTaxRate : (hasVault ? 1 : 0),
|
|
63
|
+
vaultConfig: flat.vaultConfig,
|
|
89
64
|
};
|
|
90
65
|
}
|
|
91
|
-
/**
|
|
92
|
-
* 构建发币 populateTransaction(优先 V6/V7,Vault 走 VaultPortal)
|
|
93
|
-
*/
|
|
94
|
-
function resolveCreateQuoteAmt(params) {
|
|
95
|
-
return params.initialQuoteAmt ?? 0n;
|
|
96
|
-
}
|
|
97
|
-
function resolveUseV7Portal(params) {
|
|
98
|
-
return !!(params.useV7Portal ?? params.useV4Portal ?? params.useClInfinityLaunch);
|
|
99
|
-
}
|
|
100
|
-
/** Flap 文档:TOKEN_V3_PERMIT 须 migratorType=3、feeConfigs 单槽 MARKETING_OR_VAULT 10000 bps */
|
|
101
66
|
function buildNewTokenV7PermitParams(params) {
|
|
102
67
|
const emptyFeeConfig = {
|
|
103
68
|
feeType: FeeType.NONE,
|
|
@@ -137,10 +102,9 @@ function buildNewTokenV7PermitParams(params) {
|
|
|
137
102
|
}
|
|
138
103
|
export async function populateCreateTokenTransaction(params) {
|
|
139
104
|
const taxConfig = params.taxConfig;
|
|
140
|
-
const { buyTaxRate, sellTaxRate } = resolveTaxRates(taxConfig, params.taxRate);
|
|
105
|
+
const { buyTaxRate, sellTaxRate } = resolveTaxRates(taxConfig, params.taxRate, params.buyTaxRate, params.sellTaxRate);
|
|
141
106
|
const isTaxLaunch = buyTaxRate > 0 || sellTaxRate > 0;
|
|
142
|
-
|
|
143
|
-
// 1) Vault 金库税币
|
|
107
|
+
// 1) 金库税币 → VaultPortal.newTokenV6WithVault
|
|
144
108
|
if (taxConfig?.vaultConfig && taxConfig.vaultConfig.vaultType !== 'none') {
|
|
145
109
|
validateTaxDistribution(taxConfig.mktBps, taxConfig.deflationBps, taxConfig.dividendBps, taxConfig.lpBps);
|
|
146
110
|
const chainKey = params.chain.toUpperCase();
|
|
@@ -149,59 +113,98 @@ export async function populateCreateTokenTransaction(params) {
|
|
|
149
113
|
throw new Error(`链 "${params.chain}" 不支持 Tax Vault 金库功能`);
|
|
150
114
|
}
|
|
151
115
|
const vaultPortal = new Contract(vaultPortalAddr, VAULT_PORTAL_ABI, params.devWallet);
|
|
152
|
-
const
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
116
|
+
const tv2 = {
|
|
117
|
+
taxDuration: taxConfig.taxDuration,
|
|
118
|
+
antiFarmerDuration: taxConfig.antiFarmerDuration,
|
|
119
|
+
distribution: {
|
|
120
|
+
mktBps: taxConfig.mktBps,
|
|
121
|
+
deflationBps: taxConfig.deflationBps,
|
|
122
|
+
dividendBps: taxConfig.dividendBps,
|
|
123
|
+
lpBps: taxConfig.lpBps,
|
|
124
|
+
minimumShareBalance: taxConfig.minimumShareBalance,
|
|
125
|
+
},
|
|
126
|
+
vaultConfig: taxConfig.vaultConfig,
|
|
127
|
+
};
|
|
128
|
+
const v6VaultParams = buildNewTokenV6WithVaultParams({
|
|
129
|
+
tokenInfo: params.tokenInfo,
|
|
130
|
+
taxV2: tv2,
|
|
131
|
+
chain: chainKey,
|
|
132
|
+
salt: params.salt,
|
|
133
|
+
taxRate: Math.max(buyTaxRate, sellTaxRate),
|
|
134
|
+
buyTaxRate,
|
|
135
|
+
sellTaxRate,
|
|
136
|
+
dexThresh: params.dexThresh,
|
|
137
|
+
migratorType: params.migratorType,
|
|
138
|
+
quoteToken: params.quoteToken,
|
|
139
|
+
quoteAmt: resolveCreateQuoteAmt(params),
|
|
140
|
+
dexId: params.dexId,
|
|
141
|
+
lpFeeProfile: params.lpFeeProfile,
|
|
177
142
|
});
|
|
143
|
+
return vaultPortal.newTokenV6WithVault.populateTransaction(v6VaultParams);
|
|
178
144
|
}
|
|
179
|
-
// 2)
|
|
145
|
+
// 2) 税币无金库 → newTokenV6 + TOKEN_TAXED_V3
|
|
180
146
|
if (isTaxLaunch && taxConfig) {
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
147
|
+
const tv2 = {
|
|
148
|
+
taxDuration: taxConfig.taxDuration,
|
|
149
|
+
antiFarmerDuration: taxConfig.antiFarmerDuration,
|
|
150
|
+
distribution: {
|
|
151
|
+
mktBps: taxConfig.mktBps,
|
|
152
|
+
deflationBps: taxConfig.deflationBps,
|
|
153
|
+
dividendBps: taxConfig.dividendBps,
|
|
154
|
+
lpBps: taxConfig.lpBps,
|
|
155
|
+
minimumShareBalance: taxConfig.minimumShareBalance,
|
|
156
|
+
},
|
|
157
|
+
vaultConfig: taxConfig.vaultConfig,
|
|
158
|
+
};
|
|
159
|
+
return params.originalPortal.newTokenV6.populateTransaction(buildNewTokenV6Params({
|
|
160
|
+
tokenInfo: params.tokenInfo,
|
|
161
|
+
taxV2: tv2,
|
|
162
|
+
beneficiary: params.beneficiary,
|
|
163
|
+
salt: params.salt,
|
|
164
|
+
taxRate: Math.max(buyTaxRate, sellTaxRate),
|
|
165
|
+
buyTaxRate,
|
|
166
|
+
sellTaxRate,
|
|
167
|
+
dexThresh: params.dexThresh,
|
|
168
|
+
migratorType: params.migratorType,
|
|
169
|
+
quoteToken: params.quoteToken,
|
|
170
|
+
quoteAmt: resolveCreateQuoteAmt(params),
|
|
171
|
+
dexId: params.dexId,
|
|
172
|
+
lpFeeProfile: params.lpFeeProfile,
|
|
173
|
+
extensionID: params.extensionID,
|
|
174
|
+
extensionData: params.extensionData,
|
|
186
175
|
}));
|
|
187
176
|
}
|
|
188
177
|
if (isTaxLaunch) {
|
|
189
|
-
return params.originalPortal.newTokenV6.populateTransaction(
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
178
|
+
return params.originalPortal.newTokenV6.populateTransaction(buildNewTokenV6Params({
|
|
179
|
+
tokenInfo: params.tokenInfo,
|
|
180
|
+
taxV2: {
|
|
181
|
+
taxDuration: 365 * 24 * 60 * 60,
|
|
182
|
+
antiFarmerDuration: 3 * 24 * 60 * 60,
|
|
183
|
+
distribution: {
|
|
184
|
+
mktBps: 10000,
|
|
185
|
+
deflationBps: 0,
|
|
186
|
+
dividendBps: 0,
|
|
187
|
+
lpBps: 0,
|
|
188
|
+
},
|
|
189
|
+
},
|
|
190
|
+
beneficiary: params.beneficiary,
|
|
191
|
+
salt: params.salt,
|
|
192
|
+
taxRate: Math.max(buyTaxRate, sellTaxRate),
|
|
196
193
|
buyTaxRate,
|
|
197
194
|
sellTaxRate,
|
|
198
|
-
|
|
195
|
+
dexThresh: params.dexThresh,
|
|
196
|
+
migratorType: params.migratorType,
|
|
197
|
+
quoteToken: params.quoteToken,
|
|
198
|
+
quoteAmt: resolveCreateQuoteAmt(params),
|
|
199
|
+
dexId: params.dexId,
|
|
200
|
+
lpFeeProfile: params.lpFeeProfile,
|
|
201
|
+
}));
|
|
199
202
|
}
|
|
200
|
-
// 3) 标准 V3
|
|
203
|
+
// 3) 标准 V3 池 → newTokenV7(Portal v5.8.6+;V4 已 FeatureDisabled)
|
|
201
204
|
if (resolveUseV7Portal(params)) {
|
|
202
205
|
return params.originalPortal.newTokenV7.populateTransaction(buildNewTokenV7PermitParams(params));
|
|
203
206
|
}
|
|
204
|
-
// 4)
|
|
207
|
+
// 4) extension only → newTokenV3
|
|
205
208
|
const hasExtension = !!params.extensionID &&
|
|
206
209
|
params.extensionID !== zeroBytes32() &&
|
|
207
210
|
params.lpFeeProfile === undefined &&
|
|
@@ -216,14 +219,14 @@ export async function populateCreateTokenTransaction(params) {
|
|
|
216
219
|
taxRate: (params.taxRate ?? 0) & 0xffff,
|
|
217
220
|
migratorType: (params.migratorType ?? MigratorType.V3_MIGRATOR) & 0xff,
|
|
218
221
|
quoteToken: params.quoteToken || ZERO_ADDRESS,
|
|
219
|
-
quoteAmt,
|
|
222
|
+
quoteAmt: resolveCreateQuoteAmt(params),
|
|
220
223
|
beneficiary: params.beneficiary,
|
|
221
224
|
permitData: '0x',
|
|
222
225
|
extensionID: params.extensionID,
|
|
223
226
|
extensionData: params.extensionData ?? '0x',
|
|
224
227
|
});
|
|
225
228
|
}
|
|
226
|
-
// 5) 标准 V2
|
|
229
|
+
// 5) 标准 V2 路径 → newTokenV6 + TOKEN_V2_PERMIT
|
|
227
230
|
return params.originalPortal.newTokenV6.populateTransaction({
|
|
228
231
|
name: params.tokenInfo.name,
|
|
229
232
|
symbol: params.tokenInfo.symbol,
|
|
@@ -232,7 +235,7 @@ export async function populateCreateTokenTransaction(params) {
|
|
|
232
235
|
salt: params.salt ?? zeroBytes32(),
|
|
233
236
|
migratorType: (params.migratorType ?? MigratorType.V2_MIGRATOR) & 0xff,
|
|
234
237
|
quoteToken: params.quoteToken || ZERO_ADDRESS,
|
|
235
|
-
quoteAmt,
|
|
238
|
+
quoteAmt: resolveCreateQuoteAmt(params),
|
|
236
239
|
beneficiary: params.beneficiary,
|
|
237
240
|
permitData: '0x',
|
|
238
241
|
extensionID: params.extensionID ?? zeroBytes32(),
|
|
@@ -12,8 +12,9 @@ export declare enum TokenVersion {
|
|
|
12
12
|
TOKEN_V2_PERMIT = 2,
|
|
13
13
|
TOKEN_GOPLUS = 3,
|
|
14
14
|
TOKEN_TAXED = 4,
|
|
15
|
-
|
|
15
|
+
/** FlapTaxTokenV3 — 推荐税币;配合 newTokenV6 / newTokenV6WithVault */
|
|
16
16
|
TOKEN_TAXED_V3 = 6,
|
|
17
|
+
/** 标准 V3 池(PCS Infinity CL);配合 newTokenV7 */
|
|
17
18
|
TOKEN_V3_PERMIT = 7
|
|
18
19
|
}
|
|
19
20
|
/** newTokenV7 feeConfigs 槽位类型 */
|
|
@@ -16,8 +16,9 @@ export var TokenVersion;
|
|
|
16
16
|
TokenVersion[TokenVersion["TOKEN_V2_PERMIT"] = 2] = "TOKEN_V2_PERMIT";
|
|
17
17
|
TokenVersion[TokenVersion["TOKEN_GOPLUS"] = 3] = "TOKEN_GOPLUS";
|
|
18
18
|
TokenVersion[TokenVersion["TOKEN_TAXED"] = 4] = "TOKEN_TAXED";
|
|
19
|
-
|
|
19
|
+
/** FlapTaxTokenV3 — 推荐税币;配合 newTokenV6 / newTokenV6WithVault */
|
|
20
20
|
TokenVersion[TokenVersion["TOKEN_TAXED_V3"] = 6] = "TOKEN_TAXED_V3";
|
|
21
|
+
/** 标准 V3 池(PCS Infinity CL);配合 newTokenV7 */
|
|
21
22
|
TokenVersion[TokenVersion["TOKEN_V3_PERMIT"] = 7] = "TOKEN_V3_PERMIT";
|
|
22
23
|
})(TokenVersion || (TokenVersion = {}));
|
|
23
24
|
/** newTokenV7 feeConfigs 槽位类型 */
|
|
@@ -95,11 +96,11 @@ const PORTAL_ABI = [
|
|
|
95
96
|
'function newTokenV2((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint16 taxRate,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData)) external payable returns (address)',
|
|
96
97
|
'function newTokenV3((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint16 taxRate,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData)) external payable returns (address)',
|
|
97
98
|
'function newTokenV4((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint16 taxRate,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData,uint8 dexId,uint8 lpFeeProfile)) external payable returns (address)',
|
|
98
|
-
// newTokenV5: 支持 Tax Token V2 高级税收分配(
|
|
99
|
+
// newTokenV5: 支持 Tax Token V2 高级税收分配(taxRate > 0 时使用,Legacy)
|
|
99
100
|
'function newTokenV5((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint16 taxRate,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData,uint8 dexId,uint8 lpFeeProfile,uint64 taxDuration,uint64 antiFarmerDuration,uint16 mktBps,uint16 deflationBps,uint16 dividendBps,uint16 lpBps,uint256 minimumShareBalance)) external payable returns (address)',
|
|
100
|
-
// newTokenV6:
|
|
101
|
+
// newTokenV6: 统一发射入口(标准 TOKEN_V2_PERMIT / 税币 TOKEN_TAXED_V3)
|
|
101
102
|
'function newTokenV6((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint8 migratorType,address quoteToken,uint256 quoteAmt,address beneficiary,bytes permitData,bytes32 extensionID,bytes extensionData,uint8 dexId,uint8 lpFeeProfile,uint16 buyTaxRate,uint16 sellTaxRate,uint64 taxDuration,uint64 antiFarmerDuration,uint16 mktBps,uint16 deflationBps,uint16 dividendBps,uint16 lpBps,uint256 minimumShareBalance,address dividendToken,address commissionReceiver,uint8 tokenVersion)) external payable returns (address)',
|
|
102
|
-
// newTokenV7: TOKEN_V3_PERMIT + CL
|
|
103
|
+
// newTokenV7: TOKEN_V3_PERMIT + PCS Infinity CL 迁移(标准 V3 池,Portal v5.8.6+)
|
|
103
104
|
'function newTokenV7((string name,string symbol,string meta,uint8 dexThresh,bytes32 salt,uint8 migratorType,address quoteToken,uint256 quoteAmt,bytes permitData,bytes32 extensionID,bytes extensionData,uint8 dexId,uint16 buyTaxRate,uint16 sellTaxRate,uint64 taxDuration,uint64 antiFarmerDuration,address commissionReceiver,uint8 tokenVersion,(uint8 feeType,uint16 bps,address marketingAddress,address dividendToken,uint256 minimumShareBalance)[4] feeConfigs)) external payable returns (address)',
|
|
104
105
|
// 受益人领取
|
|
105
106
|
'function claim(address token) external returns (uint256,uint256)',
|
|
@@ -108,21 +109,17 @@ const PORTAL_ABI = [
|
|
|
108
109
|
'function getFeeRate() external view returns (uint256,uint256)',
|
|
109
110
|
'function nonce() external view returns (uint256)',
|
|
110
111
|
'function version() external pure returns (string)',
|
|
111
|
-
'function getLocks(address token) external view returns (uint256[])'
|
|
112
|
+
'function getLocks(address token) external view returns (uint256[])'
|
|
112
113
|
];
|
|
113
114
|
/**
|
|
114
115
|
* 将 lpFeeProfile 转换为 V3 fee 值
|
|
115
116
|
*/
|
|
116
117
|
export function lpFeeProfileToV3Fee(profile) {
|
|
117
118
|
switch (profile) {
|
|
118
|
-
case V3LPFeeProfile.LP_FEE_PROFILE_STANDARD:
|
|
119
|
-
|
|
120
|
-
case V3LPFeeProfile.
|
|
121
|
-
|
|
122
|
-
case V3LPFeeProfile.LP_FEE_PROFILE_HIGH:
|
|
123
|
-
return 10000;
|
|
124
|
-
default:
|
|
125
|
-
return 2500; // 默认 STANDARD
|
|
119
|
+
case V3LPFeeProfile.LP_FEE_PROFILE_STANDARD: return 2500;
|
|
120
|
+
case V3LPFeeProfile.LP_FEE_PROFILE_LOW: return 100;
|
|
121
|
+
case V3LPFeeProfile.LP_FEE_PROFILE_HIGH: return 10000;
|
|
122
|
+
default: return 2500; // 默认 STANDARD
|
|
126
123
|
}
|
|
127
124
|
}
|
|
128
125
|
/**
|
|
@@ -139,11 +136,6 @@ export function validateTaxDistribution(config) {
|
|
|
139
136
|
return { valid: true };
|
|
140
137
|
}
|
|
141
138
|
export class FlapPortal {
|
|
142
|
-
rpcUrl;
|
|
143
|
-
portal;
|
|
144
|
-
contract;
|
|
145
|
-
buyFeeRate;
|
|
146
|
-
sellFeeRate;
|
|
147
139
|
constructor(cfg) {
|
|
148
140
|
this.rpcUrl = cfg.rpcUrl;
|
|
149
141
|
this.portal = cfg.addressOverride ?? FLAP_PORTAL_ADDRESSES[cfg.chain];
|
|
@@ -158,27 +150,13 @@ export class FlapPortal {
|
|
|
158
150
|
async getTokenV2(token) {
|
|
159
151
|
const r = await this.contract.getTokenV2(token);
|
|
160
152
|
return {
|
|
161
|
-
status: r[0],
|
|
162
|
-
reserve: r[1],
|
|
163
|
-
circulatingSupply: r[2],
|
|
164
|
-
price: r[3],
|
|
165
|
-
tokenVersion: r[4],
|
|
166
|
-
r: r[5],
|
|
167
|
-
dexSupplyThresh: r[6],
|
|
153
|
+
status: r[0], reserve: r[1], circulatingSupply: r[2], price: r[3], tokenVersion: r[4], r: r[5], dexSupplyThresh: r[6],
|
|
168
154
|
};
|
|
169
155
|
}
|
|
170
156
|
async getTokenV3(token) {
|
|
171
157
|
const r = await this.contract.getTokenV3(token);
|
|
172
158
|
return {
|
|
173
|
-
status: r[0],
|
|
174
|
-
reserve: r[1],
|
|
175
|
-
circulatingSupply: r[2],
|
|
176
|
-
price: r[3],
|
|
177
|
-
tokenVersion: r[4],
|
|
178
|
-
r: r[5],
|
|
179
|
-
dexSupplyThresh: r[6],
|
|
180
|
-
quoteTokenAddress: r[7],
|
|
181
|
-
nativeToQuoteSwapEnabled: r[8],
|
|
159
|
+
status: r[0], reserve: r[1], circulatingSupply: r[2], price: r[3], tokenVersion: r[4], r: r[5], dexSupplyThresh: r[6], quoteTokenAddress: r[7], nativeToQuoteSwapEnabled: r[8],
|
|
182
160
|
};
|
|
183
161
|
}
|
|
184
162
|
async getTokenV4(token) {
|
|
@@ -250,6 +228,7 @@ export class FlapPortal {
|
|
|
250
228
|
const curve = new CDPV2(r, h, k);
|
|
251
229
|
const currentReserve = formatEther(state.reserve);
|
|
252
230
|
const dexSupplyThresh = formatEther(state.dexSupplyThresh);
|
|
231
|
+
const circulatingSupply = formatEther(state.circulatingSupply);
|
|
253
232
|
// 计算毕业时的储备
|
|
254
233
|
const graduationReserve = curve.estimateReserve(dexSupplyThresh);
|
|
255
234
|
const graduationReserveNum = parseFloat(graduationReserve.toString());
|
|
@@ -261,7 +240,9 @@ export class FlapPortal {
|
|
|
261
240
|
// 含手续费(1% buy fee)
|
|
262
241
|
const remainingWithFee = remainingNet / (1 - this.buyFeeRate);
|
|
263
242
|
// 计算进度
|
|
264
|
-
const progressPercent = isGraduated
|
|
243
|
+
const progressPercent = isGraduated
|
|
244
|
+
? '100.00'
|
|
245
|
+
: (currentReserveNum / graduationReserveNum * 100).toFixed(2);
|
|
265
246
|
return {
|
|
266
247
|
remainingOkb: remainingWithFee.toFixed(6),
|
|
267
248
|
graduationReserve: graduationReserveNum.toFixed(6),
|
|
@@ -369,7 +350,6 @@ export class FlapPortal {
|
|
|
369
350
|
}
|
|
370
351
|
}
|
|
371
352
|
export class FlapPortalWriter extends FlapPortal {
|
|
372
|
-
wallet;
|
|
373
353
|
constructor(cfg, privateKey) {
|
|
374
354
|
super(cfg);
|
|
375
355
|
// 使用 ethers v6 创建钱包
|
|
@@ -618,3 +598,15 @@ export class FlapPortalWriter extends FlapPortal {
|
|
|
618
598
|
return this.portal;
|
|
619
599
|
}
|
|
620
600
|
}
|
|
601
|
+
/**
|
|
602
|
+
* 获取 Flap Portal 合约地址(内部使用)
|
|
603
|
+
* 注意:此方法不对外导出,用户应使用 FlapPortal 实例而非直接获取地址
|
|
604
|
+
* @internal
|
|
605
|
+
*/
|
|
606
|
+
function getFlapPortalAddress(chain) {
|
|
607
|
+
const address = FLAP_PORTAL_ADDRESSES[chain];
|
|
608
|
+
if (!address) {
|
|
609
|
+
throw new Error(`Flap Portal not deployed on ${chain}`);
|
|
610
|
+
}
|
|
611
|
+
return address;
|
|
612
|
+
}
|
|
@@ -8,12 +8,11 @@ export declare function predictVanityTokenAddress(salt: string, portal: string,
|
|
|
8
8
|
* SDK 自动使用该链的 Portal 和 TokenImpl 地址
|
|
9
9
|
* 注意:使用 Flap 平台的原始 Portal 地址进行 CREATE2 计算
|
|
10
10
|
* BSC/MONAD 默认使用 NORMAL 实现(非税版)
|
|
11
|
-
* @param taxedV5 -
|
|
11
|
+
* @param taxedV5 - Legacy V5 税币 impl(不推荐,请用 taxedV3)
|
|
12
|
+
* @param taxedV3 - TOKEN_TAXED_V3(newTokenV6 / newTokenV6WithVault)
|
|
13
|
+
* @param useV3Permit - TOKEN_V3_PERMIT / newTokenV7(标准 V3 池)
|
|
12
14
|
*/
|
|
13
|
-
export declare function predictVanityTokenAddressByChain(chain: 'BSC' | 'BASE' | 'XLAYER' | 'MORPH' | 'MONAD', salt: string, taxed?: boolean, taxedV5?: boolean,
|
|
14
|
-
taxedV3?: boolean, // ✅ V5 + Vault 金库税代币标识
|
|
15
|
-
/** BSC 标准币 + newTokenV7 / TOKEN_V3_PERMIT */
|
|
16
|
-
useV3Permit?: boolean): string;
|
|
15
|
+
export declare function predictVanityTokenAddressByChain(chain: 'BSC' | 'BASE' | 'XLAYER' | 'MORPH' | 'MONAD', salt: string, taxed?: boolean, taxedV5?: boolean, taxedV3?: boolean, useV3Permit?: boolean): string;
|
|
17
16
|
/**
|
|
18
17
|
* 寻找满足后缀的 salt(默认 8888)
|
|
19
18
|
* 注意:该方法为同步 CPU 搜索,谨慎设置迭代限制
|
|
@@ -35,7 +34,8 @@ export declare function findSaltEnding(opts: {
|
|
|
35
34
|
* 注意:使用 Flap 平台的原始 Portal 地址进行 CREATE2 计算
|
|
36
35
|
* BSC/MONAD 默认使用 NORMAL 实现(非税版)
|
|
37
36
|
* XLayer 只有标准版,后缀是 1111
|
|
38
|
-
* @param taxedV5 -
|
|
37
|
+
* @param taxedV5 - Legacy V5 impl
|
|
38
|
+
* @param taxedV3 - TOKEN_TAXED_V3 impl(推荐)
|
|
39
39
|
*/
|
|
40
40
|
export declare function findSaltEndingByChain(opts: {
|
|
41
41
|
chain: 'BSC' | 'BASE' | 'XLAYER' | 'MORPH' | 'MONAD';
|
|
@@ -6,7 +6,9 @@ import { FLAP_ORIGINAL_PORTAL_ADDRESSES, FLAP_TOKEN_IMPL_ADDRESSES, getVanitySuf
|
|
|
6
6
|
*/
|
|
7
7
|
export function predictVanityTokenAddress(salt, portal, tokenImpl) {
|
|
8
8
|
// 规范化 salt 到 bytes32(避免前端传入的短字符串导致不可预期行为)
|
|
9
|
-
const normalizedSalt = /^0x[0-9a-fA-F]{64}$/.test(salt)
|
|
9
|
+
const normalizedSalt = /^0x[0-9a-fA-F]{64}$/.test(salt)
|
|
10
|
+
? salt.toLowerCase()
|
|
11
|
+
: keccak256(salt);
|
|
10
12
|
// 构建 EIP-1167 minimal proxy bytecode
|
|
11
13
|
const bytecode = '0x3d602d80600a3d3981f3363d3d373d3d3d363d73' + tokenImpl.slice(2).toLowerCase() + '5af43d82803e903d91602b57fd5bf3';
|
|
12
14
|
const bytecodeHash = keccak256(bytecode);
|
|
@@ -17,18 +19,19 @@ export function predictVanityTokenAddress(salt, portal, tokenImpl) {
|
|
|
17
19
|
* SDK 自动使用该链的 Portal 和 TokenImpl 地址
|
|
18
20
|
* 注意:使用 Flap 平台的原始 Portal 地址进行 CREATE2 计算
|
|
19
21
|
* BSC/MONAD 默认使用 NORMAL 实现(非税版)
|
|
20
|
-
* @param taxedV5 -
|
|
22
|
+
* @param taxedV5 - Legacy V5 税币 impl(不推荐,请用 taxedV3)
|
|
23
|
+
* @param taxedV3 - TOKEN_TAXED_V3(newTokenV6 / newTokenV6WithVault)
|
|
24
|
+
* @param useV3Permit - TOKEN_V3_PERMIT / newTokenV7(标准 V3 池)
|
|
21
25
|
*/
|
|
22
|
-
export function predictVanityTokenAddressByChain(chain, salt, taxed = false, taxedV5 = false,
|
|
23
|
-
taxedV3 = false, // ✅ V5 + Vault 金库税代币标识
|
|
24
|
-
/** BSC 标准币 + newTokenV7 / TOKEN_V3_PERMIT */
|
|
25
|
-
useV3Permit = false) {
|
|
26
|
+
export function predictVanityTokenAddressByChain(chain, salt, taxed = false, taxedV5 = false, taxedV3 = false, useV3Permit = false) {
|
|
26
27
|
// 使用 Flap 平台的原始 Portal 地址(用于 CREATE2)
|
|
27
28
|
const portal = FLAP_ORIGINAL_PORTAL_ADDRESSES[chain];
|
|
28
29
|
let tokenImpl;
|
|
29
30
|
if (chain === 'BSC') {
|
|
30
|
-
if (
|
|
31
|
-
|
|
31
|
+
if (taxedV3) {
|
|
32
|
+
tokenImpl = FLAP_TOKEN_IMPL_ADDRESSES.BSC_TAXED_V3;
|
|
33
|
+
}
|
|
34
|
+
else if (taxedV5) {
|
|
32
35
|
tokenImpl = FLAP_TOKEN_IMPL_ADDRESSES.BSC_TAXED_V5;
|
|
33
36
|
}
|
|
34
37
|
else if (useV3Permit) {
|
|
@@ -59,7 +62,7 @@ export async function findSaltEnding(opts) {
|
|
|
59
62
|
// 若未提供 seed,默认使用随机种子,避免每次结果都相同
|
|
60
63
|
let salt = opts.seed ?? keccak256(randomBytes(32));
|
|
61
64
|
let iterations = 0;
|
|
62
|
-
const limit = opts.maxIterations ??
|
|
65
|
+
const limit = opts.maxIterations ?? 1000000;
|
|
63
66
|
while (iterations < limit) {
|
|
64
67
|
const addr = predictVanityTokenAddress(salt, opts.portal, opts.tokenImpl);
|
|
65
68
|
if (addr.toLowerCase().endsWith(suffix)) {
|
|
@@ -76,15 +79,18 @@ export async function findSaltEnding(opts) {
|
|
|
76
79
|
* 注意:使用 Flap 平台的原始 Portal 地址进行 CREATE2 计算
|
|
77
80
|
* BSC/MONAD 默认使用 NORMAL 实现(非税版)
|
|
78
81
|
* XLayer 只有标准版,后缀是 1111
|
|
79
|
-
* @param taxedV5 -
|
|
82
|
+
* @param taxedV5 - Legacy V5 impl
|
|
83
|
+
* @param taxedV3 - TOKEN_TAXED_V3 impl(推荐)
|
|
80
84
|
*/
|
|
81
85
|
export async function findSaltEndingByChain(opts) {
|
|
82
86
|
// 使用 Flap 平台的原始 Portal 地址(用于 CREATE2)
|
|
83
87
|
const portal = FLAP_ORIGINAL_PORTAL_ADDRESSES[opts.chain];
|
|
84
88
|
let tokenImpl;
|
|
85
89
|
if (opts.chain === 'BSC') {
|
|
86
|
-
if (opts.
|
|
87
|
-
|
|
90
|
+
if (opts.taxedV3) {
|
|
91
|
+
tokenImpl = FLAP_TOKEN_IMPL_ADDRESSES.BSC_TAXED_V3;
|
|
92
|
+
}
|
|
93
|
+
else if (opts.taxedV5) {
|
|
88
94
|
tokenImpl = FLAP_TOKEN_IMPL_ADDRESSES.BSC_TAXED_V5;
|
|
89
95
|
}
|
|
90
96
|
else if (opts.useV3Permit) {
|
|
@@ -104,13 +110,13 @@ export async function findSaltEndingByChain(opts) {
|
|
|
104
110
|
if (!portal || !tokenImpl) {
|
|
105
111
|
throw new Error(`Flap Protocol not fully deployed on ${opts.chain}`);
|
|
106
112
|
}
|
|
107
|
-
// ✅
|
|
108
|
-
const suffix = opts.suffix ?? getVanitySuffix(opts.chain, opts.taxed
|
|
113
|
+
// ✅ 如果未指定后缀,根据链自动选择正确的后缀
|
|
114
|
+
const suffix = opts.suffix ?? getVanitySuffix(opts.chain, opts.taxed);
|
|
109
115
|
return findSaltEnding({
|
|
110
116
|
portal,
|
|
111
117
|
tokenImpl,
|
|
112
118
|
suffix,
|
|
113
119
|
maxIterations: opts.maxIterations,
|
|
114
|
-
seed: opts.seed
|
|
120
|
+
seed: opts.seed
|
|
115
121
|
});
|
|
116
122
|
}
|