@gangfun/cli 0.38.0 → 0.39.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 CHANGED
@@ -20,6 +20,8 @@ Operate [gang.fun](https://gang.fun) from a Binance **Agentic Wallet**. Curve bu
20
20
 
21
21
  **Capped recipient (0.35.0+):** `--tax-cap <amount>` on a taxed launch makes a V3 token's tax recipient one GangCappedSplitter (`capped-v1`): `gang create … --buy-tax 3 --sell-tax 3 --tax-cap 20 --tax-cap-share 50 --split self:70,0x…:30 --after-cap buyback:70,lp:30` pushes 50% of the recipient's part to the payees (`--split` shares of that part; default: all to the dev) until they have been credited 20 of the launch's quote in all (WBNB for a BNB launch, else `--quote`, counted in its own decimals); the rest, and after the cap all of it, is 70% bought back and burned and 30% added to the pair as liquidity (LP to 0xdead). `--tax-cap-share` defaults to 100, `--after-cap` to `buyback:100`. The split that crosses the cap pays exactly what is left of it, and the preview gives the rough pool volume at which the cap is reached. The cap covers only this recipient's part of the pool tax: not the creator fee, not the dev's own tokens (the dev can still sell), not the holders' dividend. **Everything is permanent**: the cap, its quote, the ratios, payees and shares can never change; a payee can only move its own slot. Any other asset sent to it goes to 0xdead in full when it is distributed (one that can't be sent there stays in the module). Not with `--buyback` / `--lp` / `--buyback-to` / `--lp-to` / `--recipient`. `gang capped status|distribute|release|set-payee|bind|chunk` shows and drives it. Live on BSC mainnet (factory `0x294E901ecb66af280C1cDD26fD871601d89a2Dca`, allowed by the platform's Safe on 2026-11-08; built in) and the BSC testnet (`0xe3f61865d98993dd39c136Af19651C6F6686498A`).
22
22
 
23
+ **Floor module (0.39.0+, BSC mainnet and testnet):** `--floor` on a taxed launch makes a V3 token's tax recipient one GangFloorModule (`floor-v1`): `gang create … --buy-tax 3 --sell-tax 3 --floor [--redeem-fee 2] [--tax-cap 20 --tax-cap-share 50 --split self:70,0x…:30]`. The recipient's part of the pool tax is kept as a treasury — nothing is bought back or added. After graduation any holder can give up tokens for their share of it (`gang floor redeem`: the tokens go to 0xdead, for good), less `--redeem-fee` % (0–5, default 2) that stays for the holders who remain. With `--tax-cap` the `--split` payees take `--tax-cap-share` % until they have been credited the cap, as a capped recipient pays them; without it nobody takes a share. The floor is not a price promise: it starts at 0, grows only with pool volume and is usually far below the market price — `gang floor redeem` shows what selling the same tokens in the pool would pay and warns when that is more. The module is cloned for the one address its token will have, so the launch fixes the token's name, symbol, tax rates and metadata at its first step, and checks with the pad that the create lands at that address before building it. `gang floor status` says whether GangFloorModuleFactory made the module and whether it was cloned for this token; if not, the token has no floor and no `gang floor` call is built.
24
+
23
25
  **Call bond and follow binding (0.37.0+):** an agent can back its own call — a buy note on a GangLaunchpad 3.0 curve token — with a bond: buy with `--note`, then within 10 minutes `gang call-bond post --token 0x… --amount 0.1 --for 48h` (the note defaults to the wallet's latest buy of the token; `--hold` defaults to the whole balance). Until settle the wallet's balance of the token stays ≥ hold; one sell, vault lock or transfer below it — also after the deadline, until `gang call-bond settle` has run (two steps, 1 hour apart) — and anyone can `gang call-bond report` it: 1% to the reporter, half burnt, the rest paid to the note's followers by their loss (`gang call-bond claim` once the root's 2-day dispute window is over). Nothing of a broken bond comes back to the caller. Quotes: WBNB, USDT, USDC, USD1. A caller's `gang v3 sell` below its hold is refused unless `--break-call-bond`. On a token with a promoter share, `gang follow` binds the note's author as the wallet's promoter for good (it builds `buyWithPromoter`; same price and fee; `--no-promoter` for a plain follow). GangCallBond is live on BSC mainnet (`0x6d6e4A36e9a231cCc932151cdbFb087Cf3860c3D`, deployed 2026-11-09, owned by the platform's Safe; built in) and the BSC testnet (`0xBE2B8519278E9D31B6c4040bAd35f727fD5d2A70`).
24
26
 
25
27
  **GangLaunchpad 2.0, the creator fee and the graduation target (0.23.0+):** 2.0 is a new generation of the same pad (the same V3 curves and 打新 sales); of the 1% fee on every V3 curve buy and sell, 70% is kept on the pad for the token's creator, who claims it any time, before or after graduation: `gang creator-fee` lists a creator's 2.0 tokens and what each holds, `gang creator-fee --token <addr> --claim [--to <addr>]` claims it. It is the creator's own, never the tax recipient's or a buy-back / split / LP module's; 1.0 tokens and 打新 sales have none. 2.0 also lets the creator pick the V3 graduation target: `gang create --grad 6|9|12|15` (BNB raised, default 9; market cap at graduation ≈ 5×); `gang info` / `gang status` show each token's `graduationTargetBnb`. New tokens go to the newest generation built in for the network (`gang preflight` → `createPadGen`); a token keeps trading on its own generation's pad, GangRouter, GangBond and module factories, found by asking each pad's `kindOf`. On the BSC testnet 2.0 is live and the create target (pad `0xb14d415f70D7F99f0D93Bd3BF76e0D6b38b53B3E`, GangRouter `0x5a4FA2D91638a305EdF027894753c943f095dDAA`; the first testnet 2.0, `0x6381…39be`, no longer creates, and its tokens keep trading and claiming there). On BSC mainnet 2.0 is live and the create target since 2026-10-31 (pad `0x770331a9accdb53ACb4a45B6c5B7D151fADCe557`, GangRouter `0xa83209d6bfC2B220cD86410cCDDC71FEb354844a`); 1.0 tokens keep trading on 1.0 (pad `0x15CF…4365`).
@@ -142,6 +144,8 @@ gang create … --buy-tax 3 --sell-tax 3 --buyback 30 --lp 30 [--split self:70,0
142
144
  gang combo status|distribute|release|set-payee|bind|chunk --token 0x… [--asset 0x…] [--index <i>] [--to 0x…] [--slippage 1] # the combined recipient: ratios, payees, set aside, owed, the next chunk and the keeper's plan; chunk = one chunk now (anyone)
143
145
  gang create … --buy-tax 3 --sell-tax 3 --tax-cap 20 [--tax-cap-share 50] [--split self:70,0x…:30] [--after-cap buyback:70,lp:30] # V3, capped recipient: the payees get --tax-cap-share % until --tax-cap in all, the rest (and then all) bought back / added. PERMANENT
144
146
  gang capped status|distribute|release|set-payee|bind|chunk --token 0x… [--asset 0x…] [--index <i>] [--to 0x…] [--slippage 1] # the capped recipient: cap, paid / left / progress, ratios, payees, set aside, owed, the next chunk; other assets go to 0xdead
147
+ gang create … --buy-tax 3 --sell-tax 3 --floor [--redeem-fee 2] [--tax-cap 20 [--tax-cap-share 50] [--split self:70,0x…:30]] # V3, floor module: the recipient's part of the tax is kept as a treasury holders can redeem; with --tax-cap the payees take their share until the cap
148
+ gang floor status|redeem|distribute|release|set-payee|bind --token 0x… [--amount <tokens>|all] [--to 0x…] [--asset 0x…] [--index <i>] [--break-bond] [--break-call-bond] [--settle-first] # the floor module: treasury, what a token redeems for, fee, cap and payees; redeem burns the tokens (0xdead) for their share of the treasury
145
149
  gang create --fair … [--shares <n>] --bond <quote> [--bond-hold …] --bond-days <7-90> # 打新: create (dev shares) → bond
146
150
  gang execute --request-id <id>
147
151
  gang tx --pending # trades approved in the Binance App: found by the exact call previewed, then as below
@@ -280,7 +284,7 @@ take MCP servers instead of a shell (Claude Desktop / Code, Cursor, …). Each t
280
284
 
281
285
  | Tool | Runs |
282
286
  |---|---|
283
- | `gang_help` | this CLI's whole help (every command, every flag) and the full rules (0.17.2+): what an agent with no skill installed reads before a create, launch, bond, buyback, split, lp, combo, capped, mint or withdraw |
287
+ | `gang_help` | this CLI's whole help (every command, every flag) and the full rules (0.17.2+): what an agent with no skill installed reads before a create, launch, bond, buyback, split, lp, combo, capped, floor, mint or withdraw |
284
288
  | `gang_preflight`, `gang_trending`, `gang_hot`, `gang_new`, `gang_near_grad`, `gang_info`, `gang_status`, `gang_portfolio`, `gang_notes`, `gang_agents` | the read commands of the same name (`gang_portfolio`: 0.17.6+; `gang_trending`: 0.24.0+) |
285
289
  | `gang_tx` | `gang tx --hash …`: decode a tx, publish its queued note; `pending: true` = `gang tx --pending`, the trades approved in the Binance App (no hash needed) |
286
290
  | `gang_watch` | `gang watch` until `maxEvents` (default 1) or `timeout` (default 50s, at most 30m): returns `{ events, meta }`, `timedOut: true` when nothing came; call it again to keep waiting |
@@ -351,6 +355,7 @@ timed-out `gang_execute`, check `gang_status` / the wallet history instead of ex
351
355
  | `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`) |
352
356
  | `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) |
353
357
  | `GANG_CAPPED_FACTORY` / `GANG_TESTNET_CAPPED_FACTORY` | GangCappedSplitterFactory of the create target (`--tax-cap` on a taxed V3 launch). CLI 0.35.0+; built in: mainnet `0x294E901ecb66af280C1cDD26fD871601d89a2Dca`, testnet `0xe3f61865d98993dd39c136Af19651C6F6686498A` |
358
+ | `GANG_FLOOR_FACTORY` / `GANG_TESTNET_FLOOR_FACTORY` | GangFloorModuleFactory of the create target (`--floor` on a taxed V3 launch). Built in: mainnet `0x057d2C1557a0E8298a1E00834D6064497f5DC2fC`, testnet `0x0804C018201D8fFe378b873b41B67f136dbdc3F8` |
354
359
  | `GANG_CALL_BOND` / `GANG_TESTNET_CALL_BOND` | GangCallBond of GangLaunchpad 3.0 (`gang call-bond`). CLI 0.37.0+; built in: mainnet `0x6d6e4A36e9a231cCc932151cdbFb087Cf3860c3D`, testnet `0xBE2B8519278E9D31B6c4040bAd35f727fD5d2A70` |
355
360
  | `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`) |
356
361
  | `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`) |
package/README.zh-CN.md CHANGED
@@ -20,6 +20,8 @@
20
20
 
21
21
  **税收封顶(0.35.0+):** 有税发射时给 `--tax-cap <数量>`,V3 币的税收接收地址就是一个封顶合约(GangCappedSplitter,`capped-v1`):`gang create … --buy-tax 3 --sell-tax 3 --tax-cap 20 --tax-cap-share 50 --split self:70,0x…:30 --after-cap buyback:70,lp:30` 把接收地址那份税的 50% 推给收款人(`--split` 的比例是这一部分里的比例;不给时全给 dev),直到收款人累计拿满 20 个发射报价币(BNB 发射就是 WBNB,否则是 `--quote`,按它自己的小数位计);其余部分,以及封顶之后的全部,70% 回购销毁、30% 加进池子做流动性(LP 打进 0xdead)。`--tax-cap-share` 默认 100,`--after-cap` 默认 `buyback:100`。跨过上限的那一笔只给到剩余额度,预览会给出大约多少池子成交量会封顶。封顶只管这个接收地址那份税:不管创建者的曲线手续费分成,不管 dev 自己的币(照样能卖),也不管持有人分红。**全部永久不可改**:上限、计价币、比例、收款人和份额以后都不能改;收款人只能把自己那一份换到新地址。打进来的其他资产在分配(distribute)时全部打进 0xdead(打不进去的留在合约里)。不能和 `--buyback` / `--lp` / `--buyback-to` / `--lp-to` / `--recipient` 同用。`gang capped status|distribute|release|set-payee|bind|chunk` 查看和操作。BSC 主网已上线(工厂 `0x294E901ecb66af280C1cDD26fD871601d89a2Dca`,平台多签于 2026-11-08 批准;已内置),测试网也有(`0xe3f61865d98993dd39c136Af19651C6F6686498A`)。
22
22
 
23
+ **底价赎回(0.39.0+,BSC 主网和测试网):** 有税发射时给 `--floor`,V3 币的税收接收地址就是一个底价模块(GangFloorModule,`floor-v1`):`gang create … --buy-tax 3 --sell-tax 3 --floor [--redeem-fee 2] [--tax-cap 20 --tax-cap-share 50 --split self:70,0x…:30]`。接收地址那一份池子税不回购、不加池,留在模块里当金库。毕业后任何持有人都可以把代币交出去,按比例取走金库里的报价币(`gang floor redeem`,代币进 0xdead,不可逆),扣掉 `--redeem-fee` %(0–5,默认 2),这部分留给还持有的人。带 `--tax-cap` 时,`--split` 里的收款人先拿 `--tax-cap-share` %,累计拿满上限为止,规则和税收封顶一样;不带则没有人分走。底价不是价格承诺:它从 0 开始,只随池子成交增长,通常远低于市价——`gang floor redeem` 会显示同样的代币在池子里卖出能拿多少,卖出更多时给出警告。模块是为代币将来的那一个地址克隆的,所以发射的第一步就把代币的名称、符号、税率和元数据定死,建币前还会向 pad 核对这笔建币确实落在那个地址上。`gang floor status` 会说明这个模块是不是 GangFloorModuleFactory 创建的、是不是为这个币克隆的;不是的话这个币没有底价,CLI 也不会生成任何 `gang floor` 调用。
24
+
23
25
  **喊单保证金和跟单绑定(0.37.0+):** agent 可以给自己的喊单(GangLaunchpad 3.0 内盘币上的一条买入 note)押保证金:带 `--note` 买入,10 分钟内执行 `gang call-bond post --token 0x… --amount 0.1 --for 48h`(note 默认取这个钱包最近一次买这个币的交易;`--hold` 默认是全部余额)。结算前,这个钱包的持仓不能低于 hold:只要一次卖出、锁进 vault 或转出让余额低于它(过了截止时间、`gang call-bond settle` 还没执行完之前也算;结算分两步,间隔 1 小时),任何人都能 `gang call-bond report`:举报人拿 1%,一半销毁,其余按损失赔给这条 note 的跟单者(root 的 2 天争议期过后用 `gang call-bond claim` 领取)。违约的保证金一分都不会回到喊单者。报价币:WBNB、USDT、USDC、USD1。喊单者用 `gang v3 sell` 卖到低于 hold 会被拒,除非加 `--break-call-bond`。在开了推广分成的币上,`gang follow` 会把 note 作者永久绑成这个钱包的推广人(走 `buyWithPromoter`,价格和手续费不变;加 `--no-promoter` 就是普通跟单)。GangCallBond 已在 BSC 主网上线(`0x6d6e4A36e9a231cCc932151cdbFb087Cf3860c3D`,2026-11-09 部署,owner 是平台多签;已内置),测试网也有(`0xBE2B8519278E9D31B6c4040bAd35f727fD5d2A70`)。
24
26
 
25
27
  **GangLaunchpad 2.0、creator 分成和毕业目标(0.23.0+):** 2.0 是同一个内盘的新一代(V3 曲线和打新都一样)。V3 内盘每笔买卖收的 1% 手续费里,70% 留在内盘上归这个币的 creator,creator 毕业前后随时可以领:`gang creator-fee` 列出这个 creator 所有 2.0 币各自可领多少,`gang creator-fee --token <addr> --claim [--to <addr>]` 领取。这笔钱只归 creator 本人,不给税收接收地址,也不经过回购 / 分账 / 加池模块;1.0 的币和打新没有这项。2.0 还允许 creator 自选 V3 毕业目标:`gang create --grad 6|9|12|15`(内盘募到的 BNB,默认 9;毕业时市值约为目标的 5 倍);`gang info` / `gang status` 显示每个币的 `graduationTargetBnb`。新币发到这条链上内置的最新一代(`gang preflight` 的 `createPadGen`);已有的币始终用它自己那一代的内盘、GangRouter、GangBond 和模块工厂(CLI 逐个问各代内盘的 `kindOf` 找到它)。BSC 测试网上 2.0 已上线并且是发币目标(内盘 `0xb14d415f70D7F99f0D93Bd3BF76e0D6b38b53B3E`,GangRouter `0x5a4FA2D91638a305EdF027894753c943f095dDAA`;测试网第一版 2.0 `0x6381…39be` 不再发新币,上面的币照常交易和领取)。BSC 主网 2026-10-31 起 2.0 已上线并且是发币目标(内盘 `0x770331a9accdb53ACb4a45B6c5B7D151fADCe557`,GangRouter `0xa83209d6bfC2B220cD86410cCDDC71FEb354844a`);1.0 的币照常在 1.0(内盘 `0x15CF…4365`)上交易。
@@ -121,6 +123,8 @@ gang create … --buy-tax 3 --sell-tax 3 --buyback 30 --lp 30 [--split self:70,0
121
123
  gang combo status|distribute|release|set-payee|bind|chunk --token 0x… [--asset 0x…] [--index <i>] [--to 0x…] [--slippage 1] # 组合合约:比例、收款人、待回购 / 待加池、欠款、下一块和 keeper 的计划;chunk = 现在手动做一块(任何人)
122
124
  gang create … --buy-tax 3 --sell-tax 3 --tax-cap 20 [--tax-cap-share 50] [--split self:70,0x…:30] [--after-cap buyback:70,lp:30] # V3 税收封顶:收款人拿 --tax-cap-share %,累计拿满 --tax-cap 为止,其余(封顶后全部)回购 / 加池。永久不可改
123
125
  gang capped status|distribute|release|set-payee|bind|chunk --token 0x… [--asset 0x…] [--index <i>] [--to 0x…] [--slippage 1] # 封顶合约:上限、已付 / 剩余 / 进度、比例、收款人、待回购 / 待加池、欠款、下一块;其他资产打进 0xdead
126
+ gang create … --buy-tax 3 --sell-tax 3 --floor [--redeem-fee 2] [--tax-cap 20 [--tax-cap-share 50] [--split self:70,0x…:30]] # V3 底价赎回:接收地址那一份税留作金库,持有人可以赎回;带 --tax-cap 时收款人先拿到上限为止
127
+ gang floor status|redeem|distribute|release|set-payee|bind --token 0x… [--amount <数量>|all] [--to 0x…] [--asset 0x…] [--index <i>] [--break-bond] [--break-call-bond] [--settle-first] # 底价模块:金库、每枚能赎回多少、手续费、上限和收款人;redeem 把代币打进 0xdead,换回金库里按比例的一份
124
128
  gang create --fair … [--shares <n>] --bond <数量> [--bond-hold …] --bond-days <7-90> # 打新:发币(含 dev 份额)→ 押金
125
129
  gang execute --request-id <id>
126
130
  gang tx --pending # 在 Binance App 里批准过的交易:按预览时的调用自动找到交易,再按下面这条处理
@@ -301,6 +305,7 @@ Claude Code:`claude mcp add gang -- gang mcp`。同一台机器上 `baw` 要
301
305
  | `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`) |
302
306
  | `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 没有) |
303
307
  | `GANG_CAPPED_FACTORY` / `GANG_TESTNET_CAPPED_FACTORY` | 发币目标那一代的 GangCappedSplitterFactory(有税 V3 发射的 `--tax-cap`)。CLI 0.35.0+;已内置:主网 `0x294E901ecb66af280C1cDD26fD871601d89a2Dca`,测试网 `0xe3f61865d98993dd39c136Af19651C6F6686498A` |
308
+ | `GANG_FLOOR_FACTORY` / `GANG_TESTNET_FLOOR_FACTORY` | 发币目标那一代的 GangFloorModuleFactory(有税 V3 发射的 `--floor`)。已内置:主网 `0x057d2C1557a0E8298a1E00834D6064497f5DC2fC`,测试网 `0x0804C018201D8fFe378b873b41B67f136dbdc3F8` |
304
309
  | `GANG_CALL_BOND` / `GANG_TESTNET_CALL_BOND` | GangLaunchpad 3.0 的 GangCallBond(`gang call-bond`)。CLI 0.37.0+;已内置:主网 `0x6d6e4A36e9a231cCc932151cdbFb087Cf3860c3D`,测试网 `0xBE2B8519278E9D31B6c4040bAd35f727fD5d2A70` |
305
310
  | `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`) |
306
311
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gangfun/cli",
3
- "version": "0.38.0",
3
+ "version": "0.39.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",
@@ -95,6 +95,10 @@ export const COMMANDS = [
95
95
  c('capped distribute', 'preview', 'low', '0.35.0', 'Anyone: split the bound quote (payees up to the cap), or send another asset to 0xdead'),
96
96
  c('capped chunk', 'preview', 'low', '0.35.0', 'Anyone: one buy-back or liquidity chunk'),
97
97
  ]),
98
+ ...baseModule('floor', '0.39.0', "That slot's payee only", [
99
+ c('floor redeem', 'preview', 'high', '0.39.0', 'Holder: give up tokens (to 0xdead, for good) for their share of the floor treasury, less the fee'),
100
+ c('floor distribute', 'preview', 'low', '0.39.0', 'Anyone: split the bound quote and push the payees their part, or send another asset to 0xdead'),
101
+ ]),
98
102
  c('promote buy', 'preview', 'medium', '0.34.0', "Buy naming a promoter: a wallet's first trade of the token binds it for good, on the curve"),
99
103
  c('promote status', 'read', 'none', '0.34.0', "A token's promoter terms, a wallet's binding and what it can claim"),
100
104
  c('promote earnings', 'read', 'none', '0.34.0', 'A promoter wallet: shares to claim on the curve and in the pool'),
package/src/chain.js CHANGED
@@ -1,4 +1,4 @@
1
- import { createPublicClient, formatEther, parseAbi, parseEther, encodeFunctionData, decodeEventLog, isAddress, zeroAddress } from 'viem'
1
+ import { createPublicClient, formatEther, hexToString, parseAbi, parseEther, encodeFunctionData, decodeEventLog, isAddress, zeroAddress } from 'viem'
2
2
  import { bsc } from 'viem/chains'
3
3
  import { SOFT_ABI, V2_ABI, S_ABI, ERC20_ABI, WBNB_ABI } from './abi.js'
4
4
  import { genOf, padNets, rpcTransport } from './gangpad.js'
@@ -292,13 +292,18 @@ export const calldata = {
292
292
  * reads beside the V2 / Soft / U / S pads'. Integers stay as on chain (strings), marked `units: 'raw'`: amounts are in wei
293
293
  * (18 decimals), bps / shares / counts as they are; the V2 / Soft events are formatted (no `units`).
294
294
  */
295
- export function decodeLogs(logs, abis) {
295
+ export function decodeLogs(logs, abis, firstFor = null) {
296
296
  const events = []
297
297
  for (const log of logs) {
298
- for (const abi of abis) {
298
+ // an event signature several module kinds share (Split with three amounts): the emitting module's own ABI first
299
+ const first = firstFor ? firstFor(log) : null
300
+ for (const abi of first ? [...first, ...abis] : abis) {
299
301
  try {
300
302
  const ev = decodeEventLog({ abi, data: log.data, topics: log.topics })
301
- events.push({ event: ev.eventName, contract: log.address, units: 'raw', ...Object.fromEntries(Object.entries(ev.args).map(([k, v]) => [k, typeof v === 'bigint' ? v.toString() : v])) })
303
+ events.push({
304
+ event: ev.eventName, contract: log.address, units: 'raw', ...(first === UNKNOWN_KIND_ABI && { kindUnread: true }),
305
+ ...Object.fromEntries(Object.entries(ev.args).map(([k, v]) => [k, typeof v === 'bigint' ? v.toString() : v])),
306
+ })
302
307
  break
303
308
  } catch { /* other contract / event */ }
304
309
  }
@@ -306,15 +311,35 @@ export function decodeLogs(logs, abis) {
306
311
  return events
307
312
  }
308
313
 
309
- /** `extraAbis`: decoders for logs not from the V2 / Soft / U / S pads (see decodeLogs). */
310
- export async function decodeTx(hash, extraAbis = []) {
314
+ const MODULE_TYPE_ABI = parseAbi(['function moduleType() view returns (bytes32)'])
315
+ /** What a shared-signature event decodes to when its module's kind could not be read: no kind's field names are guessed. */
316
+ const UNKNOWN_KIND_ABI = [parseAbi(['event Split(uint256 incoming, uint256 firstPart, uint256 secondPart)'])]
317
+
318
+ /**
319
+ * For logs whose topic0 is `topic` — an event signature several module kinds share, whose fields mean different things
320
+ * in each — the decoder of the emitting module's own kind, asked of its moduleType(): `byType(kind)`. A module whose
321
+ * kind is unread or unknown decodes with neutral field names and `kindUnread: true`, never with another kind's.
322
+ */
323
+ export async function firstByModuleType(c, logs, topic, byType) {
324
+ const addrs = [...new Set(logs.filter((l) => l.topics[0] === topic).map((l) => l.address.toLowerCase()))]
325
+ const types = new Map(await Promise.all(addrs.map(async (a) => [a, await c.readContract({ address: a, abi: MODULE_TYPE_ABI, functionName: 'moduleType' })
326
+ .then((t) => hexToString(t, { size: 32 }).replace(/\0+$/, '')).catch(() => null)])))
327
+ return (log) => (log.topics[0] === topic ? byType(types.get(log.address.toLowerCase())) ?? UNKNOWN_KIND_ABI : null)
328
+ }
329
+
330
+ /**
331
+ * `extraAbis`: decoders for logs not from the V2 / Soft / U / S pads (see decodeLogs). `shared`: { topic, byType } for
332
+ * an event signature several module kinds share (firstByModuleType).
333
+ */
334
+ export async function decodeTx(hash, extraAbis = [], shared = null) {
311
335
  const r = await client.waitForTransactionReceipt({ hash, timeout: 120_000 })
336
+ const firstFor = shared ? await firstByModuleType(client, r.logs, shared.topic, shared.byType) : null
312
337
  const events = []
313
338
  const known = new Map(PADS.map((p) => [p.address.toLowerCase(), p]))
314
339
  for (const log of r.logs) {
315
340
  const pad = known.get(log.address.toLowerCase())
316
341
  if (!pad) {
317
- events.push(...decodeLogs([log], extraAbis))
342
+ events.push(...decodeLogs([log], extraAbis, firstFor))
318
343
  continue
319
344
  }
320
345
  try {
package/src/creatorfee.js CHANGED
@@ -3,6 +3,7 @@ import { revertOf as revertIn, step, units } from './steps.js'
3
3
  import { atTokenPad, CREATOR_FEE_ABI, creatorFeeShareOf, NOT_ON_MAINNET, padNets, rpcTransport } from './gangpad.js'
4
4
  import { walletFor } from './fair.js'
5
5
  import { promoteTermsOf } from './promote.js'
6
+ import { floorVerified } from './floor.js'
6
7
 
7
8
  /**
8
9
  * `gang creator-fee` — the GangLaunchpad 2.0 creator fee (docs/SPEC-CURVE-CREATOR-FEE-2026-10-31.md): of the 1% fee on
@@ -23,7 +24,7 @@ const CURVES_ABI = parseAbi([
23
24
  const SYMBOL_ABI = parseAbi(['function symbol() view returns (string)'])
24
25
  const MODULE_TYPE_ABI = parseAbi(['function moduleType() view returns (bytes32)'])
25
26
  const QUOTE_ABI = parseAbi(['function quote() view returns (address)'])
26
- const CAP_QUOTE_ABI = parseAbi(['function capQuote() view returns (address)'])
27
+ const CAP_QUOTE_ABI = parseAbi(['function capQuote() view returns (address)', 'function floorQuote() view returns (address)', 'function floorToken() view returns (address)'])
27
28
  const ABIS = [CREATOR_FEE_ABI, CURVES_ABI]
28
29
  const HINTS = {
29
30
  NotCreator: 'only the token\'s creator (the wallet that created it) can claim its creator fee; pass that wallet with --from',
@@ -68,7 +69,7 @@ export async function createNote(ctx, net = '') {
68
69
  export function payOutCmd(moduleType, at, net = '', { asset, assetSymbol } = {}) {
69
70
  const t = String(moduleType ?? '')
70
71
  const base = t.startsWith('buyback-burn-') ? 'gang buyback' : t === 'lp-burn-v1' ? 'gang lp'
71
- : t === 'split-v1' ? 'gang split' : t === 'combo-v1' ? 'gang combo' : t === 'capped-v1' ? 'gang capped' : null
72
+ : t === 'split-v1' ? 'gang split' : t === 'combo-v1' ? 'gang combo' : t === 'capped-v1' ? 'gang capped' : t === 'floor-v1' ? 'gang floor' : null
72
73
  if (!base) return null
73
74
  const splitter = base === 'gang buyback' || base === 'gang lp'
74
75
  const m = `--module ${at ?? '<module>'}`
@@ -77,6 +78,11 @@ export function payOutCmd(moduleType, at, net = '', { asset, assetSymbol } = {})
77
78
  ? `${base} distribute ${m} --asset ${asset}${net} (anyone) sends ALL of it to 0xdead: ${assetSymbol ?? 'this asset'} is not the module's quote, so it is burned, paid to nobody`
78
79
  : `${base} distribute ${m}${net} (anyone) then splits it as the tax: the payees' part is pushed and counted against the cap (so it only uses the cap up sooner), the rest set aside for buy-back and liquidity`
79
80
  }
81
+ if (base === 'gang floor') {
82
+ return asset
83
+ ? `${base} distribute ${m} --asset ${asset}${net} (anyone) sends ALL of it to 0xdead: ${assetSymbol ?? 'this asset'} is not the module's quote, so it is burned, paid to nobody`
84
+ : `${base} distribute ${m}${net} (anyone) then splits it as the tax: the payees' part (if the module has payees and their cap is not reached) is pushed and counted against the cap, the rest joins the treasury every holder can redeem`
85
+ }
80
86
  // a fee in another quote than the module's own: split / distribute of the bound quote never moves it
81
87
  if (asset) {
82
88
  return splitter
@@ -95,13 +101,15 @@ export function claimToModule({ moduleType, at, net = '', bound, quote, quoteSym
95
101
  const other = !!bound && !!quote && bound.toLowerCase() !== quote.toLowerCase()
96
102
  const unbound = !bound || /^0x0{40}$/.test(bound)
97
103
  // a capped recipient burns every asset but its quote: unbound, its quote is already fixed (capQuote)
98
- const burned = moduleType === 'capped-v1' && !!quote && (unbound ? !!capQuote && capQuote.toLowerCase() !== quote.toLowerCase() : other)
104
+ const burns = moduleType === 'capped-v1' || moduleType === 'floor-v1'
105
+ const noun = moduleType === 'floor-v1' ? 'floor module' : 'capped recipient'
106
+ const burned = burns && !!quote && (unbound ? !!capQuote && capQuote.toLowerCase() !== quote.toLowerCase() : other)
99
107
  const payOut = payOutCmd(moduleType, at, net, (other && !unbound) || burned ? { asset: quote, assetSymbol: quoteSymbol } : {})
100
108
  if (!payOut) return { payOut: null, warning: null }
101
- if (burned) return { payOut, warning: `the capped recipient's quote is ${(unbound ? capSymbol : boundSymbol) ?? (unbound ? capQuote : bound)}, this fee is in ${quoteSymbol ?? quote}: it sends any other asset to 0xdead in full, so a fee claimed there is burned` }
109
+ if (burned) return { payOut, warning: `the ${noun}'s quote is ${(unbound ? capSymbol : boundSymbol) ?? (unbound ? capQuote : bound)}, this fee is in ${quoteSymbol ?? quote}: it sends any other asset to 0xdead in full, so a fee claimed there is burned` }
102
110
  // its quote unknown (capQuote() unread): never stay silent about a burn that may follow
103
- if (moduleType === 'capped-v1' && unbound && !capQuote) {
104
- return { payOut, warning: `could not read the capped recipient's quote (capQuote): if it is not ${quoteSymbol ?? quote}, this fee's quote, a fee claimed there is burned (it sends any other asset to 0xdead in full). Check gang capped status --module ${at ?? '<module>'}${net} first` }
111
+ if (burns && unbound && !capQuote) {
112
+ return { payOut, warning: `could not read the ${noun}'s quote (${moduleType === 'floor-v1' ? 'floorQuote' : 'capQuote'}): if it is not ${quoteSymbol ?? quote}, this fee's quote, a fee claimed there is burned (it sends any other asset to 0xdead in full). Check gang ${moduleType === 'floor-v1' ? 'floor' : 'capped'} status --module ${at ?? '<module>'}${net} first` }
105
113
  }
106
114
  if (unbound) return { payOut, warning: 'the module is not bound to a token yet: it pays this out only once it is bound (its launch binds it)' }
107
115
  if (!other) return { payOut, warning: null }
@@ -110,7 +118,23 @@ export function claimToModule({ moduleType, at, net = '', bound, quote, quoteSym
110
118
  warning: `the module's own quote is ${boundSymbol ?? bound}, this fee is in ${quoteSymbol ?? quote}: split / distribute of the module's quote leave it where it is`,
111
119
  }
112
120
  }
113
- const LAUNCH_TYPES = { buyback: 'buyback-burn-v4', lp: 'lp-burn-v1', split: 'split-v1', combo: 'combo-v1', capped: 'capped-v1' }
121
+ /**
122
+ * `--to` a contract that says it is a floor module and is not known to be one (`verified`: false, or null when the
123
+ * check could not be read; `hasFactory`: whether the token's pad generation has a floor factory to check against). Pure.
124
+ */
125
+ export function unverifiedFloorNote(verified, hasFactory) {
126
+ if (verified === null) return 'could not check whether GangFloorModuleFactory made this contract (RPC error): run the command again before claiming there'
127
+ if (!hasFactory) return 'this contract says it is a floor module, but this token\'s GangLaunchpad generation has no floor factory to check it against: a fee claimed there is in that contract\'s hands, and nothing here confirms it is a treasury holders can redeem'
128
+ return 'this contract says it is a floor module, but GangFloorModuleFactory did not make it: a fee claimed there is in its hands, not in a treasury holders can redeem'
129
+ }
130
+
131
+ /** `--to` a floor module that was not cloned for `token` (or whose token could not be read): what to say. Pure. */
132
+ export function floorModuleOfAnother(floorToken, token) {
133
+ if (!floorToken) return 'could not read which token this floor module was cloned for: if it is not this token, the fee goes to another token\'s holders and payees. Check gang floor status --module first'
134
+ if (floorToken.toLowerCase() === String(token).toLowerCase()) return null
135
+ return `this floor module was cloned for another token (${floorToken}), not this one: a fee claimed there goes to that token's payees and holders, and this token's holders get nothing of it`
136
+ }
137
+ const LAUNCH_TYPES = { buyback: 'buyback-burn-v4', lp: 'lp-burn-v1', split: 'split-v1', combo: 'combo-v1', capped: 'capped-v1', floor: 'floor-v1' }
114
138
 
115
139
  /** Added to the create's note when the tax recipient is one of the dev's modules (`module`: its name; `kind`: buyback | lp | split | combo | capped). */
116
140
  export const notThroughModule = (module, { token, at, net = '', kind } = {}) =>
@@ -266,10 +290,23 @@ export async function runCreatorFee({ opt, flag, out, fail, summarize }) {
266
290
  let toModule = { payOut: null, warning: null }
267
291
  if (toType && payOutCmd(toType, to)) {
268
292
  const bound = await ctx.read(to, QUOTE_ABI, 'quote').catch(() => null)
269
- const capQuote = toType === 'capped-v1' ? await ctx.read(to, CAP_QUOTE_ABI, 'capQuote').catch(() => null) : null
293
+ const capQuote = toType === 'capped-v1' ? await ctx.read(to, CAP_QUOTE_ABI, 'capQuote').catch(() => null)
294
+ : toType === 'floor-v1' ? await ctx.read(to, CAP_QUOTE_ABI, 'floorQuote').catch(() => null) : null
270
295
  const sym = (a) => (a && !/^0x0{40}$/.test(a) ? ctx.read(a, SYMBOL_ABI, 'symbol').catch(() => null) : null)
271
296
  const [quoteSymbol, boundSymbol, capSymbol] = await Promise.all([sym(quote), sym(bound), sym(capQuote)])
272
297
  toModule = claimToModule({ moduleType: toType, at: to, net, bound, quote, quoteSymbol, boundSymbol, capQuote, capSymbol })
298
+ // a floor module serves one token: a fee claimed into another token's module goes to that token's holders and payees
299
+ if (toType === 'floor-v1') {
300
+ // only a module GangFloorModuleFactory made does what a floor module does: nothing is promised about any other
301
+ const verified = await floorVerified(ctx.read, to, ctx.floorFactory ?? null)
302
+ if (verified !== true) {
303
+ toModule = { payOut: 'what this contract does with a fee sent to it is unknown', warning: unverifiedFloorNote(verified, !!ctx.floorFactory) }
304
+ } else {
305
+ const floorToken = await ctx.read(to, CAP_QUOTE_ABI, 'floorToken').catch(() => null)
306
+ const note = floorModuleOfAnother(floorToken, token)
307
+ if (note) toModule = { ...toModule, warning: toModule.warning ? `${note}. Also: ${toModule.warning}` : note }
308
+ }
309
+ }
273
310
  }
274
311
  const { payOut, warning } = toModule
275
312
  return out(step(ctx, { from: me, to: ctx.pad, data }, {