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