@gangfun/cli 0.29.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -20
- package/README.zh-CN.md +21 -19
- package/package.json +1 -1
- package/src/bond.js +15 -3
- package/src/chain.js +1 -0
- package/src/combo.js +7 -3
- package/src/creatorfee.js +6 -5
- package/src/fair.js +10 -4
- package/src/fly.js +83 -35
- package/src/gangpad.js +102 -14
- package/src/index.js +26 -24
- package/src/mcp.js +3 -3
- package/src/portfolio.js +1 -1
- package/src/v3.js +45 -21
package/README.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
Operate [gang.fun](https://gang.fun) from a Binance **Agentic Wallet**. Curve buys/creates require a SPACE ID `.ai` Agent ID. This CLI builds calldata; `baw` signs — no keys in this package.
|
|
4
4
|
|
|
5
|
-
**`gang create`:** launches a V3 token on GangLaunchpad (`gang create --fair` a 打新 sale); it's untaxed unless `--buy-tax` / `--sell-tax` are given. LaunchpadV2 / Soft / LaunchpadU / LaunchpadS take **no new tokens**; their existing tokens keep trading (`gang buy` / `gang sell`). New V3 tokens graduate at **15 BNB** on GangLaunchpad 1.0; on 2.0 the creator picks **6 / 9 / 12 / 15 BNB** with `--grad` (default 9). Soft archive tokens still graduate at 20 BNB on-chain.
|
|
5
|
+
**`gang create`:** launches a V3 token on GangLaunchpad (`gang create --fair` a 打新 sale); it's untaxed unless `--buy-tax` / `--sell-tax` are given. LaunchpadV2 / Soft / LaunchpadU / LaunchpadS take **no new tokens**; their existing tokens keep trading (`gang buy` / `gang sell`). New V3 tokens graduate at **15 BNB** on GangLaunchpad 1.0; on 2.0 and 3.0 the creator picks **6 / 9 / 12 / 15 BNB** with `--grad` (default 9). Soft archive tokens still graduate at 20 BNB on-chain.
|
|
6
6
|
|
|
7
7
|
**One command per action (0.12.0+):** `gang buy` / `sell` / `info` / `status` / `claim` / `mint` / `withdraw` / `release` work on every token: the CLI reads the token's kind and runs the V3, 打新 or V2 / Soft code. `gang v3 …` / `gang fair …` stay as aliases.
|
|
8
8
|
|
|
9
|
-
**铸币飞轮 / Mint Flywheel (0.18.0+):** `gang create --fly` starts a sale
|
|
9
|
+
**铸币飞轮 / Mint Flywheel (0.18.0+):** `gang create --fly` starts a sale (kind 3): shares with a quota per wallet (invites add quota), a pool at the mint price once it fills, and minting that goes on after launch. The unified commands detect these tokens (`kind: "fly"`); `gang fly …` is the alias. Live on BSC mainnet since 2026-10-30 (V1 pad `0x631e66560F4FAE4e486B65349edE48189E48B029`); from 0.21.0 new tokens went to the V2 pad `0x281889ad915c1A95ffc4922235c6314b3Cbd8a5a`, and from 0.30.0 they go to GangLaunchpad 3.0 (below). Every other command follows the token's own pad, so V1 and V2 tokens keep working (`padVersion` in `gang info`: 1, 2 or 3). `--testnet` uses BSC testnet (V1 set 2, V2 `0x7069…E3d6`, 3.0). Rules: `skill/references/fly.md`.
|
|
10
10
|
|
|
11
|
-
**V3 tax tokens and 打新 (0.9.0+):** on GangLaunchpad, live on BSC mainnet since 2026-10-27 (1.0: pad `0x15CFD2dc8278Fb87a1783ef42111618E20874365`, GangRouter `0xE040445690Aa56C8b68B7f7038C7b2562B5079C4`;
|
|
11
|
+
**V3 tax tokens and 打新 (0.9.0+):** on GangLaunchpad, live on BSC mainnet since 2026-10-27 (1.0: pad `0x15CFD2dc8278Fb87a1783ef42111618E20874365`, GangRouter `0xE040445690Aa56C8b68B7f7038C7b2562B5079C4`; 2.0 since 2026-10-31: pad `0x770331a9accdb53ACb4a45B6c5B7D151fADCe557`, GangRouter `0xa83209d6bfC2B220cD86410cCDDC71FEb354844a`; new tokens go to 3.0 since CLI 0.30.0, see below; all built in); `--testnet` uses BSC testnet (3.0 for new tokens; 2.0 and set 10 = 1.0 for their tokens).
|
|
12
12
|
|
|
13
13
|
**Split recipient (0.19.0+):** `gang create … --buy-tax … --sell-tax … --split self:60,0x…:30,0x…:10` makes a V3 token's tax recipient the dev's split module (GangSplitModule, `split-v1`): the recipient's part of the tax is split among 1–10 payees at shares fixed for good (nobody, not the dev, not the platform, can change them; a payee can only move its own slot). `self` is the creating wallet (`me` also works); payee slots are numbered as in the contract, from 0 (`--index`). The quote must be one the keeper splits: WBNB (default), GANG or a quote in the pad's QuoteRegistry (others are refused before the clone, as for `--buyback`); `gang split distribute` still splits any asset sent to the module. `gang split …` shows and drives it. Live on BSC mainnet (factory `0x27e08271E52B2D129c824CD245e69471a8d3067c`, allowed by the platform's Safe on 2026-10-30; 2.0: `0xa73dC3d63AAf72E70b1cb012e5f3A541360Bec59`; built in) and testnet set 10.
|
|
14
14
|
|
|
@@ -20,6 +20,8 @@ Operate [gang.fun](https://gang.fun) from a Binance **Agentic Wallet**. Curve bu
|
|
|
20
20
|
|
|
21
21
|
**2.0 金库版: tokens bound to a lock vault (0.27.0+):** a third pad next to 1.0 and 2.0 (GangVaultLaunchpad: the same 2.0 V3 curves, creator fee and `--grad`; no 打新). Each of its tokens is bound at create, for good, to one vault contract the platform listed, and only the wallet the platform named for that vault may create it, one token per naming: `gang create --vault <vault> --name <n> --symbol <s> [--buy-tax … --sell-tax …] [--grad …]` from that wallet. Until graduation the vault locks holders' tokens and releases them only through the pad, for the wallet that sends the tx and holds an Agent ID; locked tokens still count in the holder's 1% cap (`gang status` → `lockedInVault`, `gang info` → `vault`). After graduation it is a plain token. Buys and sells work as on 2.0 (`gang buy` / `gang sell` find the pad through `kindOf`). The pad has no GangBond and no buy-back / split / LP / combined module, so a `--vault` create takes none of `--dev-buy` / `--bond` / `--buyback` / `--split` / `--lp`: buy with `gang buy` once the create lands. A plain `gang create` never goes to this pad. Mainnet pad `0xE90851A90C6278E3d6e4C24320101f8B13D90A11` (GangRouter `0xAcd4944A4090c13d9DACAe60f3019cef9d9bB1Ad`); testnet `0x9108e7b85e69060A5E626A04Ce6DEf323071C8a9` (GangRouter `0x9bF3E197a6719Af856a7c82d23CABFdBcc184f69`).
|
|
22
22
|
|
|
23
|
+
**GangLaunchpad 3.0 (0.30.0+):** one permanent, upgradeable pad (a proxy) with 2.0's rules: the same V3 curves, `--grad`, creator fee and 打新 sales, every 2.0 function and event with the same selector, plus `tokenVersionOf` (the rule set each token was created under, shown as `gang info` → `tokenVersion`) and a built-in aggregator entry. New V3 and 打新 tokens go to 3.0 on BSC mainnet and the testnet (`gang preflight` → `createPadGen` `3.0`), with its own GangRouter, GangBond and buy-back / split / LP / combined module factories, so `--dev-buy` / `--bond` / `--buyback` / `--split` / `--lp` launches work as before. 1.0, 2.0 and 2.0 金库版 tokens keep trading, claiming and bonding on their own pads. `gang create --vault` creates on 3.0 wherever its vault mode is live (the CLI asks the pad: `vaultOf(0)` answers; live on mainnet since the upgrade at block 131454282 and on the testnet), else on the 2.0 金库版 pad; it still stands alone (none of the launch flags), and 3.0 vault tokens show `vault` / `lockedInVault` as above. A vault-bound token takes no GangBond: `gang bond post` refuses it, because a bond is slashed once the creator's wallet holds less than X and a vault lock takes tokens out of that wallet. Since 2026-11-04 `gang create --fly` also goes to 3.0 (its 铸币飞轮 mode, `kindOf` 3): the rules, `--guard` / `--twap-window` and the limits of the V2 pad, at 3.0's address; 100,000 tokens a share, 1,000-token reward floor. The `--quote` cannot be a 3.0 token. 打新 sales with an Agent gate (3.0's, and 1.0 / 2.0's forwarded by 3.0) now also trade through 3.0's aggregator entry; `gang mint` / `gang withdraw` work as before (on the pad or through the GangRouter), and a sale without a gate stays out of the entry. Mainnet pad `0x2bEbED4be8c8F46C17776C71D7a6A45dbC5CAB29` (GangRouter `0xec9717E5C68b9F18fA76D3961C9Cd7e67b5E61e7`, GangBond `0x830b38F695Ca1bCbdD313CD5AA5943e2125Be9D6`); testnet `0x0508232833aE6849c03b28F7aA248BBd5cFCceE2` (GangRouter `0x09544Fd87c5Ff2c4fb05885A76861A12e83f87b9`, GangBond `0xa87727dc3CC28a44709649A22aDbD77287B99fc1`); vault mode live on both.
|
|
24
|
+
|
|
23
25
|
## Install
|
|
24
26
|
|
|
25
27
|
Node ≥ 18. Also install Binance Agentic Wallet CLI (`baw`):
|
|
@@ -48,7 +50,7 @@ npx skills add gangfun/gang-launchpad/skill
|
|
|
48
50
|
1. Binance App → Wallet → Agentic Wallet → create; claim a `.ai` Agent ID.
|
|
49
51
|
2. Enable **Developer Mode** and **Trade all tokens**.
|
|
50
52
|
3. `baw auth signin` → confirm in the App.
|
|
51
|
-
4. `gang preflight` — `createPad` must be GangLaunchpad
|
|
53
|
+
4. `gang preflight` — `createPad` must be GangLaunchpad 3.0 (`0x2bEbED4b…AB29`; `createPadGen` `3.0`).
|
|
52
54
|
|
|
53
55
|
## Commands
|
|
54
56
|
|
|
@@ -64,12 +66,12 @@ gang notes [--agent a,b] [--min-hit 0.6] [--sort new|author|followers] [--token
|
|
|
64
66
|
gang watch --notes [--agent a,b] [--min-hit 0.6] [--interval 30] [--events note,revealed] # new followable notes
|
|
65
67
|
gang agents [--window 1d|7d|30d|all] [--sort score|hitRate|count|follow|followUsd] [--limit 10] # who to follow
|
|
66
68
|
# One command per action, whatever pad the token is on (0.12.0+): the CLI reads GangLaunchpad's kindOf (V3 curve / 打新
|
|
67
|
-
# sale; otherwise the V2 / Soft / U / S pads) and runs that kind's trade. --testnet = BSC testnet, 2.0 and set 10 (GangLaunchpad only)
|
|
69
|
+
# sale; otherwise the V2 / Soft / U / S pads) and runs that kind's trade. --testnet = BSC testnet, 3.0, 2.0 and set 10 (GangLaunchpad only)
|
|
68
70
|
gang list [--limit 20] [--kind v3|fair|fly [--status …]] # V2 / Soft / U / S on chain, newest 20 per pad; --kind v3|fair: from gang.fun, fly: the pad
|
|
69
71
|
gang info --token <addr> # one token, any pad (gang token is the older name)
|
|
70
72
|
gang status --token <addr> # my position: balance; V3 dividend / 打新 reward, sellable; poolSellAll
|
|
71
|
-
gang portfolio [--from <addr>] # every holding: balance, value, cost / unrealized, claimable, USD; bonds; creator fees (2.0)
|
|
72
|
-
gang creator-fee [--token <addr>] [--from <creator>] [--claim [--to <addr>]] # GangLaunchpad 2.0: 70% of the 1% curve fee, the creator's
|
|
73
|
+
gang portfolio [--from <addr>] # every holding: balance, value, cost / unrealized, claimable, USD; bonds; creator fees (2.0 / 3.0)
|
|
74
|
+
gang creator-fee [--token <addr>] [--from <creator>] [--claim [--to <addr>]] # GangLaunchpad 2.0 / 3.0: 70% of the 1% curve fee, the creator's
|
|
73
75
|
gang quote --token <addr> --amount <n> # V2 / Soft / U / S curve only (Soft: BNB; V2: quote ERC-20, LaunchpadV2.sol math)
|
|
74
76
|
gang buy --token <addr> --amount <n> [--slippage 1] [--follow <note tx>] [--note "<why>" [--conf 0-100] [--reveal-after 1-72h]]
|
|
75
77
|
# --amount = what to spend in the token's quote (--bnb is the older name). V3: includes the 1% curve fee (no tax on the
|
|
@@ -84,15 +86,15 @@ gang follow <note tx> --amount <n> [--slippage 1] [--note …] # buy the token
|
|
|
84
86
|
gang upload-logo (--file ./avatar.png | --url <image URL>) # → ipfs://<cid> (view at https://cdn.gang.fun/ipfs/<cid>)
|
|
85
87
|
# create: GangLaunchpad. A V3 token (own buy / sell tax 1–5%, pool only, paid to the creator itself or a whitelisted
|
|
86
88
|
# recipient, in the quote; untaxed without --buy-tax / --sell-tax), or with --fair a 打新 (fair mint) sale on the same pad.
|
|
87
|
-
# --vault <vault>:
|
|
89
|
+
# --vault <vault>: bound to that listed vault, from the wallet gang named for it (no --fair / launch flags); on 3.0 where its vault mode is live, else the 2.0 金库版 pad; takes no bond
|
|
88
90
|
gang create --name <n> --symbol <s> [--buy-tax 2 --sell-tax 2 [--dividend 0] [--recipient 0x…]] [--logo ./avatar.png | --logo-uri URL] [--website URL] [--twitter @handle] [--description "…"] [--testnet]
|
|
89
91
|
gang create --fair --name <n> --symbol <s> [--raise 15] [--cap 0.5] [--hold 60] [--mint-fee 1] [--exit-fee 1] [--shares 1] [--logo …] [--website URL] [--twitter @handle] [--description "…"] [--testnet]
|
|
90
92
|
# --cap 0.25–1% of supply per wallet (1% → at least 50 wallets), --hold 60–90% (the hold line)
|
|
91
|
-
# 铸币飞轮 (Mint Flywheel,
|
|
93
|
+
# 铸币飞轮 (Mint Flywheel, on GangLaunchpad 3.0; mainnet, --testnet = BSC testnet). --preset j (default: the J template) or
|
|
92
94
|
# steady; every setting can be overridden: --raise 3-50 --quota 5-100 --invite-bonus 0-3 --max-per-tx 1-10 --hold 60-90
|
|
93
95
|
# --mint-fee 1-3 --exit-fee 1-2 --dev-cut 0-10 --buy-pct 0-50 --sell-tax 1-2 --launch-delay 0-300 --window 300-1800
|
|
94
96
|
# --cap-mul 1-2 --post-mint|--no-post-mint --tier flat|standard|linear [--step-pct --step-shares --max-mul] --supply-cap 10-500
|
|
95
|
-
#
|
|
97
|
+
# --guard off|15|20|30 (default off: no pause on price drops) --twap-window 15|30 (default 30); --quota ≤ 10 with post-launch minting
|
|
96
98
|
gang create --fly --name <n> --symbol <s> [--preset j|steady] [settings…] [--dev-shares 1] [--logo …] [--testnet]
|
|
97
99
|
gang mint --token <addr> --shares <n> [--ref <inviter>] [--slippage 2] # before launch: the sale price; after: mintPost (pool price or above)
|
|
98
100
|
gang fly open-early --token <addr> # creator, ≥ 30% sold
|
|
@@ -297,7 +299,7 @@ timed-out `gang_execute`, check `gang_status` / the wallet history instead of ex
|
|
|
297
299
|
## Rules (short)
|
|
298
300
|
|
|
299
301
|
- 1% per-wallet cap on the curve; excess input refunded in-tx.
|
|
300
|
-
- **New** creates (GangLaunchpad) → graduation at 15 BNB (1.0) or the creator's `--grad` pick (2.0: 6 / 9 / 12 / 15, default 9) → PancakeSwap V2, LP burned. LaunchpadV2: existing tokens only.
|
|
302
|
+
- **New** creates (GangLaunchpad) → graduation at 15 BNB (1.0) or the creator's `--grad` pick (2.0 / 3.0: 6 / 9 / 12 / 15, default 9) → PancakeSwap V2, LP burned. LaunchpadV2: existing tokens only.
|
|
301
303
|
- Soft legacy (archive): 20 BNB graduation; buy/sell only — no Soft create from this CLI.
|
|
302
304
|
- Before graduation: no transfers, curve only.
|
|
303
305
|
- Graduated / launched: `gang buy` / `gang sell` trade in the PancakeSwap
|
|
@@ -321,16 +323,16 @@ timed-out `gang_execute`, check `gang_status` / the wallet history instead of ex
|
|
|
321
323
|
| `GANG_TELEMETRY` | `0` turns off the anonymous usage counts (0.24.0+; `DO_NOT_TRACK=1` too). See [Telemetry](#telemetry) |
|
|
322
324
|
| `GANG_UPDATE_CHECK` | `0` turns off the once-a-day check for a newer CLI on npm (cached in `~/.gang/update.json`) |
|
|
323
325
|
| `GANG_UPDATE_URL` | Where that check asks, default `https://registry.npmjs.org/@gangfun/cli/latest`; set an npm mirror's `…/@gangfun/cli/latest` if npmjs is slow or blocked |
|
|
324
|
-
| `GANG_PAD` / `GANG_TESTNET_PAD` | The GangLaunchpad new tokens go to (mainnet / testnet), behind V3 and 打新. Defaults: mainnet 2.0 `0x7703…E557`
|
|
326
|
+
| `GANG_PAD` / `GANG_TESTNET_PAD` | The GangLaunchpad new tokens go to (mainnet / testnet), behind V3 and 打新. Defaults: mainnet 3.0 `0x2bEb…AB29` (2.0 `0x7703…E557` and 1.0 `0x15CF…4365` kept for their tokens); testnet 3.0 `0x0508…ceE2` (2.0 `0xb14d…3B3E`, the first 2.0 `0x6381…39be` and 1.0, set 10 `0xFebF…5BB1`, kept for their tokens). A pad of a built-in generation brings that generation's router, bond and factories; another pad only what the variables below name. Old names `GANG_V3_PAD` / `GANG_FAIR_PAD`, `GANG_V3_TESTNET_PAD` / `GANG_FAIR_TESTNET_PAD` still work as aliases |
|
|
325
327
|
| `GANG_TESTNET_RPC_URL` | Testnet RPC, one URL or a comma list (unset: PublicNode, then BNB Chain's testnet nodes); old names `GANG_V3_TESTNET_RPC_URL` / `GANG_FAIR_TESTNET_RPC_URL` still work |
|
|
326
|
-
| `GANG_FLY_PAD_V2` / `GANG_TESTNET_FLY_PAD_V2` | GangFlywheelPad V2 (铸币飞轮)
|
|
328
|
+
| `GANG_FLY_PAD_V2` / `GANG_TESTNET_FLY_PAD_V2` | GangFlywheelPad V2 (铸币飞轮); new tokens go to GangLaunchpad 3.0. Defaults: mainnet `0x2818…8a5a`, testnet `0x7069…E3d6` |
|
|
327
329
|
| `GANG_FLY_PAD` / `GANG_TESTNET_FLY_PAD` | GangFlywheelPad V1 (铸币飞轮). Defaults: mainnet `0x631e…B029` (open since 2026-10-30), testnet set 2 `0xD648…951c` |
|
|
328
|
-
| `GANG_BOND` / `GANG_TESTNET_BOND` | GangBond of the create target (creator bonds, `gang bond`; a token's bond is on its own generation's). Defaults: mainnet 2.0 `0x2313…E0D8
|
|
329
|
-
| `GANG_SPLIT_FACTORY` / `GANG_TESTNET_SPLIT_FACTORY` | GangSplitModuleFactory of the create target (`--split`). Defaults: mainnet 2.0 `0xa73d…ec59
|
|
330
|
-
| `GANG_LP_FACTORY` / `GANG_TESTNET_LP_FACTORY` | GangLiquiditySplitterFactory of the create target (`--lp`). Defaults (CLI 0.20.0+): mainnet 2.0 `0x8ac8…c0E4
|
|
331
|
-
| `GANG_COMBO_FACTORY` / `GANG_TESTNET_COMBO_FACTORY` | GangComboSplitterFactory of the create target (several of `--buyback` / `--lp` / `--split`; a token's combined recipient is on its own generation's). Defaults (CLI 0.22.0+): mainnet 2.0 `0xcCeA…98Be
|
|
332
|
-
| `GANG_SPLITTER_FACTORY` / `GANG_TESTNET_SPLITTER_FACTORY` | GangBuybackSplitterFactory of the create target (`--buyback`). Defaults: mainnet 2.0 `0x77e4…803C
|
|
333
|
-
| `GANG_ROUTER` / `GANG_TESTNET_ROUTER` | GangRouter proxy of the create target (native-BNB V3 buys / mints, and every PancakeSwap trade of a graduated token; a token uses its own generation's); old name `GANG_ROUTER_TESTNET` still works. Defaults: mainnet 2.0 `0xa832…844a
|
|
330
|
+
| `GANG_BOND` / `GANG_TESTNET_BOND` | GangBond of the create target (creator bonds, `gang bond`; a token's bond is on its own generation's). Defaults: mainnet 3.0 `0x830b…E9D6` (2.0 `0x2313…E0D8`, 1.0 `0xe92d…14E4`, since 2026-10-29, CLI 0.16.2+), testnet 3.0 `0xa877…9fc1` (2.0 `0x3974…51F9`, first 2.0 `0x9139…F97f`, 1.0 `0xd6a8…1086`) |
|
|
331
|
+
| `GANG_SPLIT_FACTORY` / `GANG_TESTNET_SPLIT_FACTORY` | GangSplitModuleFactory of the create target (`--split`). Defaults: mainnet 3.0 `0x904D…71f2` (2.0 `0xa73d…ec59`, 1.0 `0x27e0…067c`, since 2026-10-30, CLI 0.19.0+), testnet 3.0 `0xf8d4…06dc` (2.0 `0xb9ab…3513`, first 2.0 `0x860D…0879`, 1.0 `0x5F7d…567E`) |
|
|
332
|
+
| `GANG_LP_FACTORY` / `GANG_TESTNET_LP_FACTORY` | GangLiquiditySplitterFactory of the create target (`--lp`). Defaults (CLI 0.20.0+): mainnet 3.0 `0x98C5…1752` (2.0 `0x8ac8…c0E4`, 1.0 `0xE043…C248`, since 2026-10-31), testnet 3.0 `0x4A3a…6B07` (2.0 `0xAEec…36E4`, first 2.0 `0x4f15…1619`, 1.0 `0xA729…1591`) |
|
|
333
|
+
| `GANG_COMBO_FACTORY` / `GANG_TESTNET_COMBO_FACTORY` | GangComboSplitterFactory of the create target (several of `--buyback` / `--lp` / `--split`; a token's combined recipient is on its own generation's). Defaults (CLI 0.22.0+): mainnet 3.0 `0x2018…eA39` (2.0 `0xcCeA…98Be`, 1.0 `0xd33C…1DBd`, since 2026-10-31), testnet 3.0 `0xdc16…543C` (2.0 `0x312c…84BD`, 1.0 `0x52a8…4CFE`; the first 2.0 has none) |
|
|
334
|
+
| `GANG_SPLITTER_FACTORY` / `GANG_TESTNET_SPLITTER_FACTORY` | GangBuybackSplitterFactory of the create target (`--buyback`). Defaults: mainnet 3.0 `0xc128…3194` (2.0 `0x77e4…803C`, 1.0 `0xf1d5…F1Cd`), testnet 3.0 `0x3533…d110` (2.0 `0xDC9E…0f6e`, first 2.0 `0xBc26…33AE`, 1.0 `0x7E63…2BBe`) |
|
|
335
|
+
| `GANG_ROUTER` / `GANG_TESTNET_ROUTER` | GangRouter proxy of the create target (native-BNB V3 buys / mints, and every PancakeSwap trade of a graduated token; a token uses its own generation's); old name `GANG_ROUTER_TESTNET` still works. Defaults: mainnet 3.0 `0xec97…61e7` (2.0 `0xa832…844a`, 1.0 `0xE040…79C4`), testnet 3.0 `0x0954…87b9` (2.0 `0x5a4F…dDAA`, first 2.0 `0xb218…FC08`, 1.0 `0x6bB6…C9F6`) |
|
|
334
336
|
|
|
335
337
|
## Telemetry
|
|
336
338
|
|
|
@@ -346,4 +348,4 @@ a background process, so a command never waits on it. `GANG_TELEMETRY=0` (or `DO
|
|
|
346
348
|
|
|
347
349
|
## Version
|
|
348
350
|
|
|
349
|
-
`0.
|
|
351
|
+
`0.30.0` · repo [gangfun/cli](https://github.com/gangfun/cli) · published to [npm](https://www.npmjs.com/package/@gangfun/cli) on push to `main`
|
package/README.zh-CN.md
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
用 Binance **Agentic Wallet** 操作 [gang.fun](https://gang.fun)。内盘买入/发币需要 SPACE ID `.ai` Agent ID。本 CLI 只组 calldata,签名走 `baw`,不持有私钥。
|
|
4
4
|
|
|
5
|
-
**`gang create`:** 在 GangLaunchpad 上发 V3 币(`gang create --fair` 发打新);不带 `--buy-tax` / `--sell-tax` 就是无税币。LaunchpadV2 / Soft / LaunchpadU / LaunchpadS **不再发新币**,存量币照常交易(`gang buy` / `gang sell`)。V3 新币在 GangLaunchpad 1.0 上 **15 BNB** 毕业;2.0 上由 creator 用 `--grad` 选 **6 / 9 / 12 / 15 BNB**(默认 9)。Soft 存量链上仍为 20 BNB 毕业。
|
|
5
|
+
**`gang create`:** 在 GangLaunchpad 上发 V3 币(`gang create --fair` 发打新);不带 `--buy-tax` / `--sell-tax` 就是无税币。LaunchpadV2 / Soft / LaunchpadU / LaunchpadS **不再发新币**,存量币照常交易(`gang buy` / `gang sell`)。V3 新币在 GangLaunchpad 1.0 上 **15 BNB** 毕业;2.0 和 3.0 上由 creator 用 `--grad` 选 **6 / 9 / 12 / 15 BNB**(默认 9)。Soft 存量链上仍为 20 BNB 毕业。
|
|
6
6
|
|
|
7
7
|
**一个动作一条命令(0.12.0+):** `gang buy` / `sell` / `info` / `status` / `claim` / `mint` / `withdraw` / `release` 对所有币都能用:CLI 先读出这个币的类型,再执行 V3、打新或 V2 / Soft 的逻辑。`gang v3 …` / `gang fair …` 保留为别名。
|
|
8
8
|
|
|
9
|
-
**铸币飞轮(0.18.0+):** `gang create --fly`
|
|
9
|
+
**铸币飞轮(0.18.0+):** `gang create --fly` 开一场铸币飞轮(kind 3):按份 mint,每个钱包有额度,邀请可以加额度;打满后按 mint 价开池,开池后还能继续 mint。统一命令会自动识别这类币(`kind: "fly"`),`gang fly …` 是别名。2026-10-30 起在 BSC 主网运行(V1 发射台 `0x631e66560F4FAE4e486B65349edE48189E48B029`);0.21.0 起新币发在 V2 发射台 `0x281889ad915c1A95ffc4922235c6314b3Cbd8a5a`,0.30.0 起发在 GangLaunchpad 3.0(见下)。其他命令按代币自己的发射台走,V1、V2 的币照常可用(`gang info` 的 `padVersion`:1、2 或 3)。`--testnet` 走 BSC 测试网(V1 第 2 套,V2 `0x7069…E3d6`,3.0)。规则见 `skill/references/fly.md`。
|
|
10
10
|
|
|
11
|
-
**V3 税收币和打新(0.9.0+):** 走 GangLaunchpad,2026-10-27 起在 BSC 主网运行(1.0:内盘 `0x15CFD2dc8278Fb87a1783ef42111618E20874365`,GangRouter `0xE040445690Aa56C8b68B7f7038C7b2562B5079C4`;2026-10-31
|
|
11
|
+
**V3 税收币和打新(0.9.0+):** 走 GangLaunchpad,2026-10-27 起在 BSC 主网运行(1.0:内盘 `0x15CFD2dc8278Fb87a1783ef42111618E20874365`,GangRouter `0xE040445690Aa56C8b68B7f7038C7b2562B5079C4`;2.0(2026-10-31 起):内盘 `0x770331a9accdb53ACb4a45B6c5B7D151fADCe557`,GangRouter `0xa83209d6bfC2B220cD86410cCDDC71FEb354844a`;CLI 0.30.0 起新币发到 3.0,见下文;都已内置);`--testnet` 走 BSC 测试网(新币发到 3.0,2.0 和第 10 套即 1.0 上的币照常用)。
|
|
12
12
|
|
|
13
13
|
**多人分账收款(0.19.0+):** `gang create … --buy-tax … --sell-tax … --split self:60,0x…:30,0x…:10` 把 V3 币的税收接收地址设成 dev 自己的分账模块(GangSplitModule,`split-v1`):接收地址那份税按固定比例分给 1–10 个地址,名单和比例永久不能改(dev 和平台都改不了;每个收款人只能把自己那一份换到别的地址)。`self` 表示发币钱包(也可以写 `me`);收款人序号和合约一致,从 0 开始(`--index`)。报价币只能是 keeper 会分账的:WBNB(默认)、GANG 或发射台 QuoteRegistry 里的报价币(其他的在克隆前就拒绝,和 `--buyback` 一样);转进模块的其他资产仍可用 `gang split distribute` 手动分。`gang split …` 查看和操作。已在 BSC 主网(工厂 `0x27e08271E52B2D129c824CD245e69471a8d3067c`,2026-10-30 平台多签已放行;2.0:`0xa73dC3d63AAf72E70b1cb012e5f3A541360Bec59`;已内置)和测试网第 10 套可用。
|
|
14
14
|
|
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
**2.0 金库版:绑定锁仓金库的币(0.27.0+):** 和 1.0、2.0 并列的第三个内盘(GangVaultLaunchpad:V3 曲线、creator 分成和 `--grad` 都和 2.0 一样;没有打新)。这里的每个币在创建时就和平台登记过的一个金库合约永久绑定,而且只有平台为这个金库指定的钱包才能发,每次指定只能发一个币:用那个钱包执行 `gang create --vault <金库> --name <n> --symbol <s> [--buy-tax … --sell-tax …] [--grad …]`。毕业前,金库只能通过内盘锁入、取回持有人的币,而且只替发交易、持有 Agent ID 的钱包操作;锁进金库的币仍计入持有人的 1% 上限(`gang status` → `lockedInVault`,`gang info` → `vault`)。毕业后就是普通的币。买卖和 2.0 一样(`gang buy` / `gang sell` 通过 `kindOf` 找到这个内盘)。这个内盘没有 GangBond,也没有回购 / 分账 / 加池 / 组合模块,所以 `--vault` 发币不能带 `--dev-buy` / `--bond` / `--buyback` / `--split` / `--lp`:发币上链后再用 `gang buy` 买。普通的 `gang create` 不会发到这个内盘。主网内盘 `0xE90851A90C6278E3d6e4C24320101f8B13D90A11`(GangRouter `0xAcd4944A4090c13d9DACAe60f3019cef9d9bB1Ad`);测试网 `0x9108e7b85e69060A5E626A04Ce6DEf323071C8a9`(GangRouter `0x9bF3E197a6719Af856a7c82d23CABFdBcc184f69`)。
|
|
22
22
|
|
|
23
|
+
**GangLaunchpad 3.0(0.30.0+):** 一个固定地址、可升级的内盘(代理合约),规则和 2.0 相同:V3 曲线、`--grad`、creator 分成和打新都一样,2.0 的函数和事件全部保留、选择器不变;另外有 `tokenVersionOf`(每个币创建时的规则版本,`gang info` → `tokenVersion`)和内置的聚合器入口。BSC 主网和测试网上,V3 新币和打新都发到 3.0(`gang preflight` → `createPadGen` 为 `3.0`)。3.0 有自己的 GangRouter、GangBond 和回购 / 分账 / 加池 / 组合模块工厂,所以 `--dev-buy` / `--bond` / `--buyback` / `--split` / `--lp` 一键发射照常可用。1.0、2.0 和 2.0 金库版上的币照常在各自内盘交易、领取、押金。`gang create --vault`:3.0 上线了金库模式的网络就发到 3.0(CLI 向内盘查询 `vaultOf(0)` 是否有返回;主网在区块 131454282 升级后已上线,测试网也已上线),否则仍发到 2.0 金库版内盘;仍然不能带一键发射参数。绑定金库的币不能交押金:`gang bond post` 会拒绝,因为钱包余额一低于承诺持有量 X 押金就会被罚没,而锁进金库的币已经不在钱包里;3.0 的金库币同样显示 `vault` / `lockedInVault`。2026-11-04 起 `gang create --fly` 也发到 3.0(它的铸币飞轮模式,`kindOf` 为 3):规则、`--guard` / `--twap-window` 和各项限制都和 V2 发射台相同,只是地址在 3.0;每份 100,000 枚,分红门槛 1,000 枚。`--quote` 不能是 3.0 的币。设了 Agent 门槛的打新(3.0 自己的,以及经 3.0 转发的 1.0 / 2.0 的)现在也能经 3.0 的聚合器入口交易;`gang mint` / `gang withdraw` 不变(走内盘或 GangRouter),没设门槛的发售不走入口。主网内盘 `0x2bEbED4be8c8F46C17776C71D7a6A45dbC5CAB29`(GangRouter `0xec9717E5C68b9F18fA76D3961C9Cd7e67b5E61e7`,GangBond `0x830b38F695Ca1bCbdD313CD5AA5943e2125Be9D6`);测试网 `0x0508232833aE6849c03b28F7aA248BBd5cFCceE2`(GangRouter `0x09544Fd87c5Ff2c4fb05885A76861A12e83f87b9`,GangBond `0xa87727dc3CC28a44709649A22aDbD77287B99fc1`);两边的金库模式都已上线。
|
|
24
|
+
|
|
23
25
|
## 安装
|
|
24
26
|
|
|
25
27
|
Node ≥ 18。另需 `baw`:
|
|
@@ -38,7 +40,7 @@ Skill:`npx skills add gangfun/gang-launchpad/skill`
|
|
|
38
40
|
1. 币安 App → 钱包 → Agentic Wallet;领取 `.ai` Agent ID。
|
|
39
41
|
2. 打开 **Developer Mode** 与 **Trade all tokens**。
|
|
40
42
|
3. `baw auth signin`
|
|
41
|
-
4. `gang preflight` — `createPad` 须为 GangLaunchpad
|
|
43
|
+
4. `gang preflight` — `createPad` 须为 GangLaunchpad 3.0(`0x2bEbED4b…AB29`,`createPadGen` 为 `3.0`)。
|
|
42
44
|
|
|
43
45
|
## 命令
|
|
44
46
|
|
|
@@ -54,12 +56,12 @@ gang notes [--agent a,b] [--min-hit 0.6] [--sort new|author|followers] [--token
|
|
|
54
56
|
gang watch --notes [--agent a,b] [--min-hit 0.6] [--interval 30] [--events note,revealed] # 新出现的可跟想法
|
|
55
57
|
gang agents [--window 1d|7d|30d|all] [--sort score|hitRate|count|follow|followUsd] [--limit 10] # 跟谁
|
|
56
58
|
# 一个动作一条命令,不管币在哪个内盘(0.12.0+):CLI 读 GangLaunchpad 的 kindOf(V3 内盘 / 打新;都不是就走
|
|
57
|
-
# V2 / Soft / U / S),再执行对应的交易。--testnet 走 BSC 测试网 2.0 和第 10 套(只有 GangLaunchpad)
|
|
59
|
+
# V2 / Soft / U / S),再执行对应的交易。--testnet 走 BSC 测试网 3.0、2.0 和第 10 套(只有 GangLaunchpad)
|
|
58
60
|
gang list [--limit 20] [--kind v3|fair|fly [--status …]] # 链上读 V2 / Soft / U / S,每个盘最新 20 个;--kind v3|fair:从 gang.fun 列,fly:从发射台读
|
|
59
61
|
gang info --token <addr> # 任意内盘的一个币(gang token 是旧名)
|
|
60
62
|
gang status --token <addr> # 我的持仓:余额;V3 分红 / 打新奖励、还能卖多少;poolSellAll
|
|
61
|
-
gang portfolio [--from <addr>] # 全部持仓:余额、价值、成本 / 浮盈、可领、美元;押金;creator 分成(2.0)
|
|
62
|
-
gang creator-fee [--token <addr>] [--from <creator>] [--claim [--to <addr>]] # GangLaunchpad 2.0:内盘 1% 手续费的 70% 归 creator
|
|
63
|
+
gang portfolio [--from <addr>] # 全部持仓:余额、价值、成本 / 浮盈、可领、美元;押金;creator 分成(2.0 / 3.0)
|
|
64
|
+
gang creator-fee [--token <addr>] [--from <creator>] [--claim [--to <addr>]] # GangLaunchpad 2.0 / 3.0:内盘 1% 手续费的 70% 归 creator
|
|
63
65
|
gang quote --token <addr> --amount <n> # 只算 V2 / Soft / U / S 内盘(Soft:BNB;V2:报价币 ERC-20)
|
|
64
66
|
gang buy --token <addr> --amount <n> [--slippage 1] [--follow <附言 tx>] [--note "<理由>" [--conf 0-100] [--reveal-after 1-72h]]
|
|
65
67
|
# --amount 是要花的报价币数量(--bnb 是旧名)。V3:含内盘 1% 手续费(内盘不收税;WBNB 报价经 GangRouter 直接付 BNB)。
|
|
@@ -74,7 +76,7 @@ gang follow <附言 tx> --amount <n> [--slippage 1] [--note …] # 跟单:
|
|
|
74
76
|
gang upload-logo (--file ./avatar.png | --url <图片地址>)
|
|
75
77
|
# 建币:GangLaunchpad。默认是 V3 币(买 / 卖税各 1–5%,只在外盘收,用报价币打给接收地址:发币人自己,或白名单里的
|
|
76
78
|
# 合作方;不带 --buy-tax / --sell-tax 即无税);加 --fair 是同一个内盘上的打新。
|
|
77
|
-
# --vault
|
|
79
|
+
# --vault <金库>:绑定平台登记的这个金库,只能由平台为它指定的钱包发(不能带 --fair 和一键发射参数);3.0 有金库模式就发到 3.0,否则发到 2.0 金库版内盘;不能交押金
|
|
78
80
|
gang create --name <n> --symbol <s> [--buy-tax 2 --sell-tax 2 [--dividend 0] [--recipient 0x…]] [--logo ./avatar.png | --logo-uri URL] [--website URL] [--twitter @handle] [--description "…"] [--testnet]
|
|
79
81
|
gang create --fair --name <n> --symbol <s> [--raise 15] [--cap 0.5] [--hold 60] [--mint-fee 1] [--exit-fee 1] [--shares 1] [--logo …] [--website URL] [--twitter @handle] [--description "…"] [--testnet]
|
|
80
82
|
# --cap 单地址上限 0.25–1%(1% 时至少 50 个地址),--hold 出局线 60–90%
|
|
@@ -108,10 +110,10 @@ gang combo status|distribute|release|set-payee|bind|chunk --token 0x… [--asset
|
|
|
108
110
|
gang create --fair … [--shares <n>] --bond <数量> [--bond-hold …] --bond-days <7-90> # 打新:发币(含 dev 份额)→ 押金
|
|
109
111
|
gang execute --request-id <id>
|
|
110
112
|
gang tx --pending # 在 Binance App 里批准过的交易:按预览时的调用自动找到交易,再按下面这条处理
|
|
111
|
-
#
|
|
113
|
+
# 铸币飞轮(在 GangLaunchpad 3.0 上;主网,--testnet 走 BSC 测试网)。--preset j(默认,J 模板)或 steady,每一项都能单独改:
|
|
112
114
|
# --raise 3-50 --quota 5-100 --invite-bonus 0-3 --max-per-tx 1-10 --hold 60-90 --mint-fee 1-3 --exit-fee 1-2 --dev-cut 0-10
|
|
113
115
|
# --buy-pct 0-50 --sell-tax 1-2 --launch-delay 0-300 --window 300-1800 --cap-mul 1-2 --post-mint|--no-post-mint
|
|
114
|
-
#
|
|
116
|
+
# --guard off|15|20|30(默认 off:价格下跌时不暂停 mint)--twap-window 15|30(默认 30);开池后 mint 打开时 --quota ≤ 10
|
|
115
117
|
# --tier flat|standard|linear [--step-pct --step-shares --max-mul] --supply-cap 10-500
|
|
116
118
|
gang create --fly --name <n> --symbol <s> [--preset j|steady] [设置…] [--dev-shares 1] [--logo …] [--testnet]
|
|
117
119
|
gang mint --token <addr> --shares <n> [--ref <邀请人>] [--slippage 2] # 开池前按发售价;开池后 mintPost(不低于池子价格)
|
|
@@ -252,7 +254,7 @@ Claude Code:`claude mcp add gang -- gang mcp`。同一台机器上 `baw` 要
|
|
|
252
254
|
## 规则(短)
|
|
253
255
|
|
|
254
256
|
- 内盘每钱包 1%;多付同笔退回。
|
|
255
|
-
- **新**发币(GangLaunchpad):1.0 上 15 BNB 毕业,2.0 上按 creator 的 `--grad`(6 / 9 / 12 / 15,默认 9)。LaunchpadV2 只剩存量币。Soft 存量归档:20 BNB,仅买卖。
|
|
257
|
+
- **新**发币(GangLaunchpad):1.0 上 15 BNB 毕业,2.0 / 3.0 上按 creator 的 `--grad`(6 / 9 / 12 / 15,默认 9)。LaunchpadV2 只剩存量币。Soft 存量归档:20 BNB,仅买卖。
|
|
256
258
|
- 毕业前不可转账;毕业(或打新发射)后走 PancakeSwap:`gang buy` / `gang sell`
|
|
257
259
|
经 GangRouter 在外盘成交。先只授权本次用量,再发 `poolBuy` / `poolBuyBNB` / `poolSell` / `poolSellForBNB`;最少到手:买入按
|
|
258
260
|
`getAmountsOut` 扣买入税,卖出按税 handler 的 `previewSellNextBlock`,再扣 `--slippage`。`--use-quote` / `--pay-bnb` 选买入用什么付,
|
|
@@ -271,15 +273,15 @@ Claude Code:`claude mcp add gang -- gang mcp`。同一台机器上 `baw` 要
|
|
|
271
273
|
| `GANG_TELEMETRY` | 设为 `0` 关闭匿名使用统计(0.24.0+;`DO_NOT_TRACK=1` 同样关闭),见[使用统计](#使用统计) |
|
|
272
274
|
| `GANG_UPDATE_CHECK` | 设为 `0` 关闭每天一次的新版本检查(查 npm,缓存在 `~/.gang/update.json`) |
|
|
273
275
|
| `GANG_UPDATE_URL` | 新版本检查查询的地址,默认 `https://registry.npmjs.org/@gangfun/cli/latest`;npmjs 慢或打不开时,可以换成 npm 镜像的 `…/@gangfun/cli/latest` |
|
|
274
|
-
| `GANG_PAD` / `GANG_TESTNET_PAD` | 覆盖合并后的内盘合约 GangLaunchpad(主网 / 测试网),V3 和打新共用(默认:主网 2.0 `0x7703…E557
|
|
276
|
+
| `GANG_PAD` / `GANG_TESTNET_PAD` | 覆盖合并后的内盘合约 GangLaunchpad(主网 / 测试网),V3 和打新共用(默认:主网 3.0 `0x2bEb…AB29`(2.0 `0x7703…E557`、1.0 `0x15CF…4365` 留给各自的币),测试网 3.0 `0x0508…ceE2`;测试网 2.0 `0xb14d…3B3E`、第一版 2.0 `0x6381…39be` 和第 10 套 `0xFebF…5BB1` 留给各自的币)。旧名 `GANG_V3_PAD` / `GANG_FAIR_PAD`、`GANG_V3_TESTNET_PAD` / `GANG_FAIR_TESTNET_PAD` 仍可用(别名) |
|
|
275
277
|
| `GANG_TESTNET_RPC_URL` | 测试网 RPC,可填一个或逗号分隔的多个(不设时先用 PublicNode,再用 BNB Chain 的测试网节点);旧名 `GANG_V3_TESTNET_RPC_URL` / `GANG_FAIR_TESTNET_RPC_URL` 仍可用 |
|
|
276
|
-
| `GANG_FLY_PAD_V2` / `GANG_TESTNET_FLY_PAD_V2` | GangFlywheelPad V2
|
|
278
|
+
| `GANG_FLY_PAD_V2` / `GANG_TESTNET_FLY_PAD_V2` | GangFlywheelPad V2(铸币飞轮);新币发在 GangLaunchpad 3.0。默认:主网 `0x2818…8a5a`,测试网 `0x7069…E3d6` |
|
|
277
279
|
| `GANG_FLY_PAD` / `GANG_TESTNET_FLY_PAD` | GangFlywheelPad V1(铸币飞轮)。默认:主网 `0x631e…B029`(2026-10-30 起开放),测试网第 2 套 `0xD648…951c` |
|
|
278
|
-
| `GANG_BOND` / `GANG_TESTNET_BOND` | 发币目标那一代的 GangBond(押金承诺,`gang bond`;已有的币用它自己那一代的)。默认:主网 2.0 `0x2313…E0D8
|
|
279
|
-
| `GANG_SPLIT_FACTORY` / `GANG_TESTNET_SPLIT_FACTORY` | 发币目标那一代的 GangSplitModuleFactory(`--split`)。默认:主网 2.0 `0xa73d…ec59
|
|
280
|
-
| `GANG_LP_FACTORY` / `GANG_TESTNET_LP_FACTORY` | 发币目标那一代的 GangLiquiditySplitterFactory(`--lp`)。默认(CLI 0.20.0+):主网 2.0 `0x8ac8…c0E4
|
|
281
|
-
| `GANG_COMBO_FACTORY` / `GANG_TESTNET_COMBO_FACTORY` | 发币目标那一代的 GangComboSplitterFactory(同时给 `--buyback` / `--lp` / `--split` 中的几个;已有的币用它自己那一代的)。默认(CLI 0.22.0+):主网 2.0 `0xcCeA…98Be
|
|
282
|
-
| `GANG_ROUTER` / `GANG_TESTNET_ROUTER` | 发币目标那一代的 GangRouter 代理(用原生 BNB 买 V3 / 打新,以及已毕业币的所有外盘买卖;已有的币用它自己那一代的);旧名 `GANG_ROUTER_TESTNET` 仍可用。默认:主网 2.0 `0xa832…844a
|
|
280
|
+
| `GANG_BOND` / `GANG_TESTNET_BOND` | 发币目标那一代的 GangBond(押金承诺,`gang bond`;已有的币用它自己那一代的)。默认:主网 3.0 `0x830b…E9D6`(2.0 `0x2313…E0D8`,1.0 `0xe92d…14E4`,2026-10-29 起,CLI 0.16.2+),测试网 3.0 `0xa877…9fc1`(2.0 `0x3974…51F9`,第一版 2.0 `0x9139…F97f`,1.0 `0xd6a8…1086`) |
|
|
281
|
+
| `GANG_SPLIT_FACTORY` / `GANG_TESTNET_SPLIT_FACTORY` | 发币目标那一代的 GangSplitModuleFactory(`--split`)。默认:主网 3.0 `0x904D…71f2`(2.0 `0xa73d…ec59`,1.0 `0x27e0…067c`,2026-10-30 起,CLI 0.19.0+),测试网 3.0 `0xf8d4…06dc`(2.0 `0xb9ab…3513`,第一版 2.0 `0x860D…0879`,1.0 `0x5F7d…567E`) |
|
|
282
|
+
| `GANG_LP_FACTORY` / `GANG_TESTNET_LP_FACTORY` | 发币目标那一代的 GangLiquiditySplitterFactory(`--lp`)。默认(CLI 0.20.0+):主网 3.0 `0x98C5…1752`(2.0 `0x8ac8…c0E4`,1.0 `0xE043…C248`,2026-10-31 起),测试网 3.0 `0x4A3a…6B07`(2.0 `0xAEec…36E4`,第一版 2.0 `0x4f15…1619`,1.0 `0xA729…1591`) |
|
|
283
|
+
| `GANG_COMBO_FACTORY` / `GANG_TESTNET_COMBO_FACTORY` | 发币目标那一代的 GangComboSplitterFactory(同时给 `--buyback` / `--lp` / `--split` 中的几个;已有的币用它自己那一代的)。默认(CLI 0.22.0+):主网 3.0 `0x2018…eA39`(2.0 `0xcCeA…98Be`,1.0 `0xd33C…1DBd`,2026-10-31 起),测试网 3.0 `0xdc16…543C`(2.0 `0x312c…84BD`,1.0 `0x52a8…4CFE`;第一版 2.0 没有) |
|
|
284
|
+
| `GANG_ROUTER` / `GANG_TESTNET_ROUTER` | 发币目标那一代的 GangRouter 代理(用原生 BNB 买 V3 / 打新,以及已毕业币的所有外盘买卖;已有的币用它自己那一代的);旧名 `GANG_ROUTER_TESTNET` 仍可用。默认:主网 3.0 `0xec97…61e7`(2.0 `0xa832…844a`,1.0 `0xE040…79C4`),测试网 3.0 `0x0954…87b9`(2.0 `0x5a4F…dDAA`,第一版 2.0 `0xb218…FC08`,1.0 `0x6bB6…C9F6`) |
|
|
283
285
|
|
|
284
286
|
## 使用统计
|
|
285
287
|
|
|
@@ -294,4 +296,4 @@ Claude Code:`claude mcp add gang -- gang mcp`。同一台机器上 `baw` 要
|
|
|
294
296
|
|
|
295
297
|
## 版本
|
|
296
298
|
|
|
297
|
-
`0.
|
|
299
|
+
`0.30.0` · [gangfun/cli](https://github.com/gangfun/cli) · push 到 `main` 自动发布到 [npm](https://www.npmjs.com/package/@gangfun/cli)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gangfun/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.30.0",
|
|
4
4
|
"mcpName": "io.github.gangfun/gang",
|
|
5
5
|
"description": "Gang launchpad CLI for Binance Agentic Wallet agents: create on GangLaunchpad (untaxed or tax tokens), 打新 fair mint, PancakeSwap pool trades, LaunchpadV2 and legacy Soft/U/S trade.",
|
|
6
6
|
"type": "module",
|
package/src/bond.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { createPublicClient, parseAbi, encodeFunctionData, decodeEventLog, formatUnits, parseUnits, isAddress, zeroAddress } from 'viem'
|
|
2
2
|
import { decimalsOf, fundingStep as fund, parseAmount, parseIntIn, parseNum, revertOf as revertIn, step, units, GAS_RESERVE } from './steps.js'
|
|
3
|
-
import { atTokenPad, GANG_GENS, gangGens, KIND_UNREAD, MERGED_ERRORS_ABI, MERGED_HINTS, NOT_ON_MAINNET, padNets, rpcTransport } from './gangpad.js'
|
|
3
|
+
import { atTokenPad, GANG_GENS, gangGens, KIND_UNREAD, MERGED_ERRORS_ABI, MERGED_HINTS, NOT_ON_MAINNET, padNets, rpcTransport, tokenVaultOf, VAULT_NO_BOND } from './gangpad.js'
|
|
4
4
|
import { bawAddress } from './baw.js'
|
|
5
5
|
import { get as apiGet } from './discover.js'
|
|
6
6
|
|
|
@@ -364,6 +364,14 @@ export async function runBond(sub, { opt, flag, out, fail, summarize }) {
|
|
|
364
364
|
if (!ctx.bond) return fail('this token\'s GangLaunchpad generation has no GangBond in this CLI version', { token, chainId, padGen: ctx.gen })
|
|
365
365
|
const m = await marketOf(ctx, token)
|
|
366
366
|
if (!m) return fail('not a GangLaunchpad token (V3 or 打新) on this network: bonds cover only those', { token, chainId })
|
|
367
|
+
// a token bound to a lock vault (3.0 --vault) takes no bond: a lock empties the wallet the bond watches
|
|
368
|
+
let vault = null
|
|
369
|
+
if (sub === 'post' || sub === 'status') {
|
|
370
|
+
try { vault = await tokenVaultOf(ctx, token) } catch (e) {
|
|
371
|
+
if (sub === 'post') return fail('could not read whether this token is bound to a lock vault (RPC error)', { token, detail: e.shortMessage || e.message.split('\n')[0], retry: 'same command again' })
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
if (vault && sub === 'post') return fail(VAULT_NO_BOND, { token, chainId, vault, padGen: ctx.gen })
|
|
367
375
|
const view = await bondView(ctx, token, m, ['status', 'topup', 'raise-hold'].includes(sub))
|
|
368
376
|
const { _raw: raw, ...pub } = view
|
|
369
377
|
const b = raw.bond
|
|
@@ -375,9 +383,13 @@ export async function runBond(sub, { opt, flag, out, fail, summarize }) {
|
|
|
375
383
|
|
|
376
384
|
if (sub === 'status') {
|
|
377
385
|
// no bond yet on a token before its pair: say a bond can be posted now (the view's own notes win otherwise)
|
|
378
|
-
const before = view.state === 'none' && !m.live
|
|
386
|
+
const before = !vault && view.state === 'none' && !m.live
|
|
379
387
|
&& { note: `the token is not on PancakeSwap yet (${m.kind === 'v3' ? 'not graduated' : 'not launched'}): its creator can post a bond now; the --days clock starts when it ${m.kind === 'v3' ? 'graduates' : 'launches'}` }
|
|
380
|
-
|
|
388
|
+
// vault-bound: never suggest a bond; a bond that exists anyway (posted outside this CLI) is at risk from any lock
|
|
389
|
+
const vaultNote = vault && (view.state === 'none'
|
|
390
|
+
? { vault, note: `no bond can be posted: ${VAULT_NO_BOND}` }
|
|
391
|
+
: { vault, warning: `${VAULT_NO_BOND}. Locking any of the promised holding into the vault before settle loses this bond` })
|
|
392
|
+
return out({ success: true, chainId, bondContract: ctx.bond, ...pub, ...before, ...vaultNote })
|
|
381
393
|
}
|
|
382
394
|
|
|
383
395
|
if (sub === 'report') {
|
package/src/chain.js
CHANGED
|
@@ -35,6 +35,7 @@ const PADS = [
|
|
|
35
35
|
const GANG_POINTER = {
|
|
36
36
|
v3: (t) => `a GangLaunchpad V3 (bonding-curve) token: gang info|buy|sell|status --token ${t} trade it (re-run if this was an RPC hiccup)`,
|
|
37
37
|
fair: (t) => `a GangLaunchpad 打新 (fair-mint) token: gang info|status --token ${t}; before launch gang mint / withdraw, after it gang buy / sell (re-run if this was an RPC hiccup)`,
|
|
38
|
+
fly: (t) => `a GangLaunchpad 3.0 铸币飞轮 (Mint Flywheel) token: gang info|status --token ${t}; gang mint / withdraw, after launch also gang buy / sell (re-run if this was an RPC hiccup)`,
|
|
38
39
|
}
|
|
39
40
|
|
|
40
41
|
/** Resolve which pad hosts `token` by probing curves(token).creator != 0; a GangLaunchpad token is pointed at its command. */
|
package/src/combo.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createPublicClient, parseAbi, encodeFunctionData, formatUnits, getAddress, hexToString, isAddress, maxUint128, maxUint256, parseUnits, zeroAddress } from 'viem'
|
|
2
|
-
import { atTokenPad, GANG_GENS, gangGens, KIND_UNREAD, padNets, NOT_ON_MAINNET, rpcTransport } from './gangpad.js'
|
|
2
|
+
import { atPad, atTokenPad, GANG_GENS, gangGens, KIND_UNREAD, padNets, NOT_ON_MAINNET, rpcTransport } from './gangpad.js'
|
|
3
3
|
import { walletFor } from './fair.js'
|
|
4
4
|
import { parseAmount, parseNum, revertOf as revertIn, step } from './steps.js'
|
|
5
5
|
import { parseSplitSpec } from './split.js'
|
|
@@ -76,6 +76,7 @@ export const COMBO_FACTORY_ABI = parseAbi([
|
|
|
76
76
|
|
|
77
77
|
export const COMBO_ABI = parseAbi([
|
|
78
78
|
'function moduleType() view returns (bytes32)',
|
|
79
|
+
'function pad() view returns (address)',
|
|
79
80
|
'function dev() view returns (address)',
|
|
80
81
|
'function token() view returns (address)',
|
|
81
82
|
'function quote() view returns (address)',
|
|
@@ -414,11 +415,14 @@ export async function runCombo(sub, { opt, flag, out, fail, summarize }) {
|
|
|
414
415
|
const chainId = Number(ctx.chainId)
|
|
415
416
|
const tn = testnet ? ' --testnet' : ''
|
|
416
417
|
if (flag('token') && flag('module')) fail('give --token (its tax recipient is the combined recipient) or --module, not both')
|
|
417
|
-
let token = null, module, tokenQuote = null
|
|
418
|
+
let token = null, module, tokenQuote = null, padKnown = true
|
|
418
419
|
if (flag('module')) {
|
|
419
420
|
if (sub === 'bind') fail('gang combo bind needs --token <the token> (it binds the token\'s own recipient)')
|
|
420
421
|
module = opt('module')
|
|
421
422
|
if (!isAddress(module ?? '')) fail('--module must be a combined recipient address (0x…)', { got: module ?? null })
|
|
423
|
+
// the module's own generation: any other pad answers curves() of its token with zeros, which reads as "not graduated"
|
|
424
|
+
const pad = await ctx.read(module, COMBO_ABI, 'pad').catch(() => null)
|
|
425
|
+
padKnown = !!pad && atPad(ctx, pad, testnet)
|
|
422
426
|
} else {
|
|
423
427
|
token = opt('token')
|
|
424
428
|
if (!isAddress(token ?? '')) fail('--token must be a V3 token address (0x…), or name the module with --module <addr>', { got: token ?? null })
|
|
@@ -436,7 +440,7 @@ export async function runCombo(sub, { opt, flag, out, fail, summarize }) {
|
|
|
436
440
|
// status --asset <addr>: read that asset too (a stray one the default list doesn't cover)
|
|
437
441
|
const extra = sub === 'status' && flag('asset') && isAddress(opt('asset') ?? '') ? [getAddress(opt('asset'))] : []
|
|
438
442
|
const s = await comboOf(ctx.read, module, {
|
|
439
|
-
wbnb: ctx.wbnb, pad: ctx.pad, extraAssets: [...(tokenQuote && tokenQuote !== zeroAddress ? [tokenQuote] : []), ...extra], ref,
|
|
443
|
+
wbnb: ctx.wbnb, pad: padKnown ? ctx.pad : null, extraAssets: [...(tokenQuote && tokenQuote !== zeroAddress ? [tokenQuote] : []), ...extra], ref,
|
|
440
444
|
})
|
|
441
445
|
if (!s) {
|
|
442
446
|
return fail(token ? 'this token\'s tax recipient is not a combined recipient (combo-v1)' : 'not a combined recipient (combo-v1)',
|
package/src/creatorfee.js
CHANGED
|
@@ -128,8 +128,8 @@ export async function curveCreatorFee(ctx, token, { creator, quote }, net = '')
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
/**
|
|
131
|
-
* Every 2.0 curve token `creator` created on this network, newest first, with what it can claim: { tokens, totals,
|
|
132
|
-
* scanned }. Read on chain (each
|
|
131
|
+
* Every 2.0 / 3.0 curve token `creator` created on this network, newest first, with what it can claim: { tokens, totals,
|
|
132
|
+
* scanned }. Read on chain (each such pad's allTokens, in multicall batches), so it works without gang.fun's index.
|
|
133
133
|
*/
|
|
134
134
|
export async function creatorFeeList(ctx, creator) {
|
|
135
135
|
const tokens = []
|
|
@@ -203,7 +203,7 @@ export async function runCreatorFee({ opt, flag, out, fail, summarize }) {
|
|
|
203
203
|
return out({
|
|
204
204
|
success: true, chainId, creator: me, ...r,
|
|
205
205
|
...(r.scanned.some((s) => s.read < s.tokens) && { scanNote: `only the newest ${MAX_SCAN} tokens of a pad were read` }),
|
|
206
|
-
note: 'GangLaunchpad 2.0
|
|
206
|
+
note: 'GangLaunchpad 2.0 and 3.0 keep 70% of the 1% curve fee of each curve buy and sell for the token\'s creator; 1.0 tokens and 打新 sales have none',
|
|
207
207
|
...(due.length && { next: due.map((x) => claimCmd(x.token, net)) }),
|
|
208
208
|
})
|
|
209
209
|
}
|
|
@@ -213,13 +213,14 @@ export async function runCreatorFee({ opt, flag, out, fail, summarize }) {
|
|
|
213
213
|
const kind = await atTokenPad(ctx, token)
|
|
214
214
|
if (kind === null) return fail('could not read the token\'s kind from GangLaunchpad (kindOf; RPC error)', { token, retry: 'same command again' })
|
|
215
215
|
if (kind === 'none') return fail(`not a GangLaunchpad token on ${testnet ? 'the BSC testnet' : 'BSC mainnet'}${testnet ? '' : ' (add --testnet for a testnet token)'}`, { token, chainId })
|
|
216
|
-
if (kind === 'fair') return fail('a 打新 (fair-mint) sale has no creator fee: only V3 curve trades on GangLaunchpad 2.0 pay one', { token, kind })
|
|
216
|
+
if (kind === 'fair') return fail('a 打新 (fair-mint) sale has no creator fee: only V3 curve trades on GangLaunchpad 2.0 / 3.0 pay one', { token, kind })
|
|
217
|
+
if (kind === 'fly') return fail('a 铸币飞轮 (Mint Flywheel) token has no creator fee: only V3 curve trades on GangLaunchpad 2.0 / 3.0 pay one (its creator gets the dev cut and a share of the pool tax: gang info)', { token, kind })
|
|
217
218
|
const c = await ctx.read(ctx.pad, CURVES_ABI, 'curves', [token])
|
|
218
219
|
const [creator, quote, , , , , graduated] = c
|
|
219
220
|
const symbol = await ctx.read(token, SYMBOL_ABI, 'symbol').catch(() => null)
|
|
220
221
|
const view = await curveCreatorFee(ctx, token, { creator, quote }, net)
|
|
221
222
|
if (!view.creatorFee) {
|
|
222
|
-
return fail(`this token is on GangLaunchpad ${view.padGen}, which has no creator fee: its whole 1% curve fee goes to the platform (the creator fee is on tokens created on 2.0)`,
|
|
223
|
+
return fail(`this token is on GangLaunchpad ${view.padGen}, which has no creator fee: its whole 1% curve fee goes to the platform (the creator fee is on tokens created on 2.0 or 3.0)`,
|
|
223
224
|
{ token, padGen: view.padGen, pad: ctx.pad })
|
|
224
225
|
}
|
|
225
226
|
const base = { chainId, token, symbol, graduated, padGen: view.padGen, pad: ctx.pad, ...view.creatorFee }
|
package/src/fair.js
CHANGED
|
@@ -3,7 +3,7 @@ import { bawAddress } from './baw.js'
|
|
|
3
3
|
import { defaultRefPool, dividendOf, fundingStep as fund, parseAmount, parseIntIn, parseNum, poolSellQuote, POOL_SELL_HINT, revertOf as revertIn, ROUTER_ABI, ROUTER_HINTS, routerDeadline, step, swapBackState, units, viaRouter, GAS_RESERVE } from './steps.js'
|
|
4
4
|
import { API } from './discover.js'
|
|
5
5
|
import { UA } from './version.js'
|
|
6
|
-
import { atTokenPad, KIND_UNREAD, MERGED_ERRORS_ABI, MERGED_HINTS, NOT_ON_MAINNET, notThisKind, padNets, rpcTransport } from './gangpad.js'
|
|
6
|
+
import { atTokenPad, KIND_UNREAD, MERGED_ERRORS_ABI, MERGED_HINTS, NOT_ON_MAINNET, notThisKind, PAD3_GEN, padNets, rpcTransport } from './gangpad.js'
|
|
7
7
|
import { poolPayBnb, poolTrade } from './pool.js'
|
|
8
8
|
import { bondGuard } from './bond.js'
|
|
9
9
|
|
|
@@ -15,6 +15,7 @@ import { bondGuard } from './bond.js'
|
|
|
15
15
|
*/
|
|
16
16
|
export const FAIR_NETS = padNets('fair')
|
|
17
17
|
|
|
18
|
+
const TOKEN_VERSION_ABI = parseAbi(['function tokenVersionOf(address token) view returns (uint8)'])
|
|
18
19
|
const PAD_ABI = parseAbi([
|
|
19
20
|
'function create(string name, string symbol, string logoURI, string metaURI, address quote, address refPool, (uint256 raiseBnb, uint16 capBps, uint16 holdBps, uint16 mintFeeBps, uint16 exitFeeBps) cfg, uint256 devShares) returns (address)',
|
|
20
21
|
'function mint(address token, uint256 shares, uint256 minShares) returns (uint256)',
|
|
@@ -260,12 +261,15 @@ export async function runFair(sub, { opt, flag, out, fail, summarize, resolveLog
|
|
|
260
261
|
let ctx
|
|
261
262
|
try { ctx = fairCtx(testnet) } catch (e) { return fail(e.message) }
|
|
262
263
|
// a token is served by the GangLaunchpad generation that has it (its pad, router, GangBond); a create goes to the newest
|
|
263
|
-
|
|
264
|
+
const onPad = sub !== 'create' && sub !== 'tx' ? await atTokenPad(ctx, opt('token')) : undefined
|
|
265
|
+
if (onPad === null) return fail(KIND_UNREAD.error, { token: opt('token'), retry: KIND_UNREAD.retry })
|
|
264
266
|
// not a sale on this pad: on the merged pad it may be a V3 token (kindOf), so point at `gang v3`
|
|
265
267
|
const notFair = async (token) => {
|
|
266
268
|
const { error, kind } = await notThisKind(ctx, token, 'fair', testnet ? ' --testnet' : '')
|
|
267
269
|
return fail(error, { token, chainId: ctx.chainId, ...(kind && { kind }) })
|
|
268
270
|
}
|
|
271
|
+
// 3.0's sales() answers a 铸币飞轮 token with another struct: never read it as a 打新 sale
|
|
272
|
+
if (onPad === 'fly') return notFair(opt('token'))
|
|
269
273
|
|
|
270
274
|
if (sub === 'info' || sub === 'status') {
|
|
271
275
|
const token = tokenArg(opt, fail)
|
|
@@ -277,7 +281,9 @@ export async function runFair(sub, { opt, flag, out, fail, summarize, resolveLog
|
|
|
277
281
|
const swapBack = sale.launched && sale.pair
|
|
278
282
|
? await swapBackState(ctx, await ctx.read(ctx.pad, PAD_ABI, 'taxHandler'), token, (await poolReserves(ctx, token, sale.pair))[0])
|
|
279
283
|
: null
|
|
280
|
-
|
|
284
|
+
// 3.0: the rule set the sale was created under (fixed for good)
|
|
285
|
+
const tokenVersion = ctx.gen === PAD3_GEN ? await ctx.read(ctx.pad, TOKEN_VERSION_ABI, 'tokenVersionOf', [token]).then(Number).catch(() => null) : null
|
|
286
|
+
return out({ success: true, chainId: Number(ctx.chainId), ...pub, ...(ctx.gen && { padGen: ctx.gen }), ...(tokenVersion != null && { tokenVersion }), ...(swapBack && { swapBack }) })
|
|
281
287
|
}
|
|
282
288
|
const slippage = parseNum(fail, 'slippage', opt('slippage', '1'), 0, 50)
|
|
283
289
|
const me = walletFor(ctx, opt('from'))
|
|
@@ -290,7 +296,7 @@ export async function runFair(sub, { opt, flag, out, fail, summarize, resolveLog
|
|
|
290
296
|
checkMeta() // a bad --website / --twitter / --description fails here, before any wrap / approve round or upload
|
|
291
297
|
const raise = parseNum(fail, 'raise', opt('raise', '15'), 5, 50)
|
|
292
298
|
if (flag('hours')) fail('--hours was removed: a fair-mint sale has no deadline and stays open until it fills')
|
|
293
|
-
if (flag('grad')) fail('--grad is a V3 curve setting (the graduation target, 2.0): a 打新 sale fills at its --raise instead, so leave --grad out')
|
|
299
|
+
if (flag('grad')) fail('--grad is a V3 curve setting (the graduation target, 2.0 / 3.0): a 打新 sale fills at its --raise instead, so leave --grad out')
|
|
294
300
|
const capPct = parseNum(fail, 'cap', opt('cap', '0.5'), 0.25, 1)
|
|
295
301
|
const holdPct = parseNum(fail, 'hold', opt('hold', '60'), 60, 90)
|
|
296
302
|
const mintFeePct = parseNum(fail, 'mint-fee', opt('mint-fee', '1'), 1, 3)
|