@gangfun/cli 0.33.0 → 0.34.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/DEVELOPERS.md +14 -1
- package/DEVELOPERS.zh-CN.md +14 -1
- package/README.md +5 -1
- package/README.zh-CN.md +5 -1
- package/package.json +1 -1
- package/src/capabilities.js +11 -0
- package/src/creatorfee.js +6 -3
- package/src/flags.js +15 -1
- package/src/gangpad.js +12 -6
- package/src/index.js +81 -12
- package/src/launch.js +98 -15
- package/src/mcp.js +5 -2
- package/src/portfolio.js +1 -1
- package/src/promote.js +669 -0
- package/src/v3.js +76 -10
package/DEVELOPERS.md
CHANGED
|
@@ -114,6 +114,15 @@ New fields can appear at any time, so ignore what you don't know. Other fields c
|
|
|
114
114
|
|
|
115
115
|
Set `GANG_TOOL=<id>` (2–12 of `a-z`, `0-9`, `-`) and your mainnet trades carry your id at the end of the calldata. The contracts ignore it, and it counts how much your tool is used. It's public, and anyone can write any id, so it proves nothing about who sent a trade. Set `GANG_CLIENT=<name>` to name your host in the anonymous usage counts.
|
|
116
116
|
|
|
117
|
+
See how your tool is used, per window and per day, with no key:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
curl -s 'https://gang.fun/api/tools/<id>'
|
|
121
|
+
curl -s 'https://gang.fun/api/tools?window=7d&sort=wallets'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
These are raw counts. They aren't filtered for wash trading, and they leave out post-graduation trades and creates. The [API document](https://gang.fun/api/openapi.json) has the details.
|
|
125
|
+
|
|
117
126
|
## Public API
|
|
118
127
|
|
|
119
128
|
`https://gang.fun/api`: read-only, no key. The contract is [`/api/openapi.json`](https://gang.fun/api/openapi.json), which also states the compatibility promise. Undocumented routes carry no promise.
|
|
@@ -135,4 +144,8 @@ Limit: 10 requests per second per IP with a burst of 60. Prefer `/stream` to pol
|
|
|
135
144
|
|
|
136
145
|
## Examples
|
|
137
146
|
|
|
138
|
-
[`examples/`](https://github.com/gangfun/cli/tree/main/examples) has working programs to copy: a first testnet trade, a Telegram monitor and a pre-trade risk check.
|
|
147
|
+
[`examples/`](https://github.com/gangfun/cli/tree/main/examples) has working programs to copy: an MCP agent template, a first testnet trade, a Telegram monitor and a pre-trade risk check.
|
|
148
|
+
|
|
149
|
+
## What's next
|
|
150
|
+
|
|
151
|
+
The [ecosystem plan](https://github.com/gangfun/gang-launchpad/blob/main/docs/PLAN-AGENT-ECOSYSTEM-2026-11-05.en.md) says what we plan to build for developers. To comment, open an issue.
|
package/DEVELOPERS.zh-CN.md
CHANGED
|
@@ -114,6 +114,15 @@ gang execute --request-id <id> 发送
|
|
|
114
114
|
|
|
115
115
|
设置 `GANG_TOOL=<id>`(2–12 个字符,`a-z`、`0-9`、`-`)后,你的主网交易会在 calldata 末尾带上这个 ID。合约会忽略它,它只用来统计工具的使用量。标记是公开的,任何人都能写任何 ID,所以不能证明交易是谁发的。设置 `GANG_CLIENT=<name>` 可以在匿名使用统计里写上你的客户端名称。
|
|
116
116
|
|
|
117
|
+
不用 key 就能查看工具的使用数据,可以按时间窗口和按天查看:
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
curl -s 'https://gang.fun/api/tools/<id>'
|
|
121
|
+
curl -s 'https://gang.fun/api/tools?window=7d&sort=wallets'
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
这些是原始计数,没有过滤刷量,也不含毕业后的成交和发币。详情见 [API 文档](https://gang.fun/api/openapi.json)。
|
|
125
|
+
|
|
117
126
|
## 公开 API
|
|
118
127
|
|
|
119
128
|
`https://gang.fun/api`:只读,无需 key。接口定义见 [`/api/openapi.json`](https://gang.fun/api/openapi.json),其中也写明了兼容承诺。未写入文档的路由没有承诺。
|
|
@@ -135,4 +144,8 @@ curl -N 'https://gang.fun/api/stream' # 推送行情事件
|
|
|
135
144
|
|
|
136
145
|
## 示例
|
|
137
146
|
|
|
138
|
-
[`examples/`](https://github.com/gangfun/cli/tree/main/examples)
|
|
147
|
+
[`examples/`](https://github.com/gangfun/cli/tree/main/examples) 里有可以直接拿来改的程序:MCP Agent 模板、测试网第一笔交易、Telegram 监控和交易前风险检查。
|
|
148
|
+
|
|
149
|
+
## 接下来
|
|
150
|
+
|
|
151
|
+
[生态方案](https://github.com/gangfun/gang-launchpad/blob/main/docs/PLAN-AGENT-ECOSYSTEM-2026-11-05.md)写了我们接下来要为开发者做什么。有意见可以提 issue。
|
package/README.md
CHANGED
|
@@ -72,6 +72,9 @@ gang info --token <addr> # one token, any pad (gang token is
|
|
|
72
72
|
gang status --token <addr> # my position: balance; V3 dividend / 打新 reward, sellable; poolSellAll
|
|
73
73
|
gang portfolio [--from <addr>] # every holding: balance, value, cost / unrealized, claimable, USD; bonds; creator fees (2.0 / 3.0)
|
|
74
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
|
|
75
|
+
gang create … --promote 20 [--promote-days 30] # V3 on 3.0 (0.34.0+): 20% of your creator fee to the promoter of each bound wallet, on its curve trades inside the window. On a taxed token with no recipient named, also that share of the recipient's part of those wallets' pool tax (promoter pool module, settled by Merkle root). Fixed for good
|
|
76
|
+
gang promote buy --token 0x… --amount <n> --promoter 0x… # binds this wallet to the promoter, by its first trade of the token, on the curve only, sent directly from the wallet. Same price and fee for you. Not --ref (gang.fun's invite credit). The same as gang buy --promoter on 0.34.0+, but an older CLI answers it with its help, where it would build gang buy --promoter as a plain buy that can never bind
|
|
77
|
+
gang promote status|earnings|claim|claim-pool|activate|work|sweep|bind|reclaim|release-dev --token 0x… (or --module 0x…) # terms, binding, what can be claimed; claim-pool checks gang.fun's proof against the root on chain. reclaim (the dev, after 30 days of settler silence) closes the module for good
|
|
75
78
|
gang quote --token <addr> --amount <n> # V2 / Soft / U / S curve only (Soft: BNB; V2: quote ERC-20, LaunchpadV2.sol math)
|
|
76
79
|
gang buy --token <addr> --amount <n> [--slippage 1] [--follow <note tx>] [--note "<why>" [--conf 0-100] [--reveal-after 1-72h]]
|
|
77
80
|
# --amount = what to spend in the token's quote (--bnb is the older name). V3: includes the 1% curve fee (no tax on the
|
|
@@ -331,6 +334,7 @@ timed-out `gang_execute`, check `gang_status` / the wallet history instead of ex
|
|
|
331
334
|
| `GANG_FLY_PAD` / `GANG_TESTNET_FLY_PAD` | GangFlywheelPad V1 (铸币飞轮). Defaults: mainnet `0x631e…B029` (open since 2026-10-30), testnet set 2 `0xD648…951c` |
|
|
332
335
|
| `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`) |
|
|
333
336
|
| `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`) |
|
|
337
|
+
| `GANG_PROMOTE_POOL_FACTORY` / `GANG_TESTNET_PROMOTE_POOL_FACTORY` | GangPromotePoolModuleFactory of the create target (`--promote` on a taxed token). Defaults: mainnet `0xA633…167A`, testnet `0x7a68…F1c2` |
|
|
334
338
|
| `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`) |
|
|
335
339
|
| `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) |
|
|
336
340
|
| `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`) |
|
|
@@ -366,4 +370,4 @@ The tag is public and anyone can write any id, so it counts usage and proves not
|
|
|
366
370
|
|
|
367
371
|
## Version
|
|
368
372
|
|
|
369
|
-
`0.
|
|
373
|
+
`0.34.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
|
@@ -62,6 +62,9 @@ gang info --token <addr> # 任意内盘的一个币(gang t
|
|
|
62
62
|
gang status --token <addr> # 我的持仓:余额;V3 分红 / 打新奖励、还能卖多少;poolSellAll
|
|
63
63
|
gang portfolio [--from <addr>] # 全部持仓:余额、价值、成本 / 浮盈、可领、美元;押金;creator 分成(2.0 / 3.0)
|
|
64
64
|
gang creator-fee [--token <addr>] [--from <creator>] [--claim [--to <addr>]] # GangLaunchpad 2.0 / 3.0:内盘 1% 手续费的 70% 归 creator
|
|
65
|
+
gang create … --promote 20 [--promote-days 30] # 3.0 的 V3(0.34.0+):绑定钱包在有效期内的内盘交易,creator 分成的 20% 归它的推广人。带税且没指定接收方时,这些钱包的池子税里,接收方那部分也按这个比例分给推广人(外盘分成模块,按 Merkle root 结算)。发币后不能改
|
|
66
|
+
gang promote buy --token 0x… --amount <n> --promoter 0x… # 把这个钱包绑定到推广人:只在它第一次交易这个币时绑定,只限内盘,必须由钱包直接发送。价格和手续费不变。和 --ref(gang.fun 的邀请记录)不是一回事。在 0.34.0+ 上等同于 gang buy --promoter,但旧版 CLI 对它只打印帮助,而 gang buy --promoter 在旧版上会变成一笔再也无法绑定的普通买入
|
|
67
|
+
gang promote status|earnings|claim|claim-pool|activate|work|sweep|bind|reclaim|release-dev --token 0x…(或 --module 0x…) # 条款、绑定、可领金额;claim-pool 会用链上的 root 核对 gang.fun 给的证明。reclaim(dev,结算方沉默 30 天后)会永久关闭模块
|
|
65
68
|
gang quote --token <addr> --amount <n> # 只算 V2 / Soft / U / S 内盘(Soft:BNB;V2:报价币 ERC-20)
|
|
66
69
|
gang buy --token <addr> --amount <n> [--slippage 1] [--follow <附言 tx>] [--note "<理由>" [--conf 0-100] [--reveal-after 1-72h]]
|
|
67
70
|
# --amount 是要花的报价币数量(--bnb 是旧名)。V3:含内盘 1% 手续费(内盘不收税;WBNB 报价经 GangRouter 直接付 BNB)。
|
|
@@ -281,6 +284,7 @@ Claude Code:`claude mcp add gang -- gang mcp`。同一台机器上 `baw` 要
|
|
|
281
284
|
| `GANG_FLY_PAD` / `GANG_TESTNET_FLY_PAD` | GangFlywheelPad V1(铸币飞轮)。默认:主网 `0x631e…B029`(2026-10-30 起开放),测试网第 2 套 `0xD648…951c` |
|
|
282
285
|
| `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`) |
|
|
283
286
|
| `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`) |
|
|
287
|
+
| `GANG_PROMOTE_POOL_FACTORY` / `GANG_TESTNET_PROMOTE_POOL_FACTORY` | 发币目标那一代的 GangPromotePoolModuleFactory(带税币的 `--promote`)。默认:主网 `0xA633…167A`,测试网 `0x7a68…F1c2` |
|
|
284
288
|
| `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`) |
|
|
285
289
|
| `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 没有) |
|
|
286
290
|
| `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`) |
|
|
@@ -312,4 +316,4 @@ Claude Code:`claude mcp add gang -- gang mcp`。同一台机器上 `baw` 要
|
|
|
312
316
|
|
|
313
317
|
## 版本
|
|
314
318
|
|
|
315
|
-
`0.
|
|
319
|
+
`0.34.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.34.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/capabilities.js
CHANGED
|
@@ -88,6 +88,17 @@ export const COMMANDS = [
|
|
|
88
88
|
c('combo distribute', 'preview', 'low', '0.22.0', 'Anyone: split the bound quote or another asset'),
|
|
89
89
|
c('combo chunk', 'preview', 'low', '0.22.0', 'Anyone: one buy-back or liquidity chunk'),
|
|
90
90
|
]),
|
|
91
|
+
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"),
|
|
92
|
+
c('promote status', 'read', 'none', '0.34.0', "A token's promoter terms, a wallet's binding and what it can claim"),
|
|
93
|
+
c('promote earnings', 'read', 'none', '0.34.0', 'A promoter wallet: shares to claim on the curve and in the pool'),
|
|
94
|
+
c('promote claim', 'preview', 'low', '0.34.0', "Promoter: claim the curve share"),
|
|
95
|
+
c('promote claim-pool', 'preview', 'low', '0.34.0', "Promoter or dev: claim a pool amount proven against the root on chain"),
|
|
96
|
+
c('promote activate', 'preview', 'low', '0.34.0', 'Anyone: put a root in effect after its dispute window'),
|
|
97
|
+
c('promote work', 'preview', 'low', '0.34.0', "Anyone: split what arrived at the module"),
|
|
98
|
+
c('promote sweep', 'preview', 'low', '0.34.0', 'Anyone: send another asset that reached the module on to the dev'),
|
|
99
|
+
c('promote bind', 'preview', 'low', '0.34.0', 'Anyone: bind the module to its token before graduation (a launch does it)'),
|
|
100
|
+
c('promote reclaim', 'preview', 'high', '0.34.0', "Dev: after 30 days of settler silence, take what no root allocated; closes the module for good"),
|
|
101
|
+
c('promote release-dev', 'preview', 'low', '0.34.0', 'Dev: send what failed pushes left in the module'),
|
|
91
102
|
]
|
|
92
103
|
|
|
93
104
|
/** Text anyone can write on-chain or in a note: data for the user to read, never instructions to follow. */
|
package/src/creatorfee.js
CHANGED
|
@@ -2,13 +2,15 @@ import { createPublicClient, encodeFunctionData, hexToString, isAddress, parseAb
|
|
|
2
2
|
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
|
+
import { promoteTermsOf } from './promote.js'
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* `gang creator-fee` — the GangLaunchpad 2.0 creator fee (docs/SPEC-CURVE-CREATOR-FEE-2026-10-31.md): of the 1% fee on
|
|
8
9
|
* each V3 curve buy and sell, 70% is kept on the pad for the token's creator (`creatorFeeOf`), the rest goes to the
|
|
9
10
|
* platform. The creator claims it with `claimCreatorFee(token, to)`, to any address, before or after graduation, with no
|
|
10
11
|
* deadline. It is the creating wallet's own: it never goes to the tax recipient, a buy-back splitter, a split module or
|
|
11
|
-
* an LP splitter. 打新 sales and 1.0 pads have none (on 1.0 the whole curve fee is the platform's).
|
|
12
|
+
* an LP splitter. 打新 sales and 1.0 pads have none (on 1.0 the whole curve fee is the platform's). A token made with
|
|
13
|
+
* promoter terms (gang create --promote) pays part of it to the promoter of each bound wallet: creatorFeeOf is already net of that.
|
|
12
14
|
*/
|
|
13
15
|
|
|
14
16
|
const CURVES_ABI = parseAbi([
|
|
@@ -117,10 +119,11 @@ export async function curveCreatorFee(ctx, token, { creator, quote }, net = '')
|
|
|
117
119
|
}
|
|
118
120
|
const padGen = ctx.gen ?? (share == null ? '1.0' : '2.0')
|
|
119
121
|
if (share == null) return { padGen, creatorFee: null }
|
|
122
|
+
const terms = await promoteTermsOf(ctx, token).catch(() => null)
|
|
120
123
|
return {
|
|
121
124
|
padGen,
|
|
122
125
|
creatorFee: {
|
|
123
|
-
sharePct: pctOf(share), creator, claimable: await units(ctx, quote, owed), claimableRaw: owed.toString(),
|
|
126
|
+
sharePct: pctOf(share), creator, ...(terms?.shareBps > 0 && { promoterSharePct: terms.sharePct, promoterNote: `on trades of wallets bound to a promoter, ${terms.sharePct}% of this goes to the promoter; claimable is what is left for the creator` }), claimable: await units(ctx, quote, owed), claimableRaw: owed.toString(),
|
|
124
127
|
...(owed > 0n && { claim: `${claimCmd(token, net)} (the creator only)` }),
|
|
125
128
|
note: `${pctOf(share)}% of the 1% curve fee of each curve buy and sell is kept for the creator, apart from the pool tax and its recipient; the creator claims it any time`,
|
|
126
129
|
},
|
|
@@ -203,7 +206,7 @@ export async function runCreatorFee({ opt, flag, out, fail, summarize }) {
|
|
|
203
206
|
return out({
|
|
204
207
|
success: true, chainId, creator: me, ...r,
|
|
205
208
|
...(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 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',
|
|
209
|
+
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, less the share of any promoter the creator set (gang create --promote); 1.0 tokens and 打新 sales have none',
|
|
207
210
|
...(due.length && { next: due.map((x) => claimCmd(x.token, net)) }),
|
|
208
211
|
})
|
|
209
212
|
}
|
package/src/flags.js
CHANGED
|
@@ -8,7 +8,7 @@ import { LAUNCH_FLAGS } from './launch.js'
|
|
|
8
8
|
|
|
9
9
|
export const LINK_FLAGS = ['website', 'twitter']
|
|
10
10
|
// gang create: V3 by default, a 打新 sale with --fair; a setting of the other kind is refused, not ignored
|
|
11
|
-
export const V3_CREATE_FLAGS = ['buy-tax', 'sell-tax', 'dividend', 'recipient']
|
|
11
|
+
export const V3_CREATE_FLAGS = ['buy-tax', 'sell-tax', 'dividend', 'recipient', 'promote', 'promote-days']
|
|
12
12
|
export const FAIR_CREATE_FLAGS = ['raise', 'cap', 'hold', 'mint-fee', 'exit-fee', 'shares']
|
|
13
13
|
|
|
14
14
|
export const CREATE_ACCEPTS = new Set([
|
|
@@ -21,6 +21,20 @@ export const CREATE_ACCEPTS = new Set([
|
|
|
21
21
|
'follow', 'cover', 'taxed', 'pair', 'pair-or-quote', 'hours',
|
|
22
22
|
])
|
|
23
23
|
|
|
24
|
+
// every flag a buy's code reads, whatever the token's kind: a buy refuses the rest, since a misspelled --promoter would fall
|
|
25
|
+
// through to a plain first buy, which uses up the wallet's only chance to bind
|
|
26
|
+
export const BUY_ACCEPTS = new Set([
|
|
27
|
+
'agent', 'all', 'amount', 'bnb', 'board', 'break-bond', 'buy-tax', 'calldata', 'cap', 'conf', 'confirm-out',
|
|
28
|
+
'description', 'dev-buy', 'dev-cut', 'dev-shares', 'dividend', 'events', 'exit-fee', 'fair', 'file', 'file-logo',
|
|
29
|
+
'fly', 'follow', 'from', 'grad', 'guard', 'hash', 'hold', 'hours', 'include-graduated', 'interval',
|
|
30
|
+
'keep-logo-uri', 'kind', 'limit', 'logo', 'logo-file', 'logo-uri', 'max-age', 'max-events', 'min-hit', 'min-pct',
|
|
31
|
+
'min-shares', 'mint-fee', 'name', 'no-post-mint', 'note', 'notes', 'pair', 'pair-or-quote', 'path', 'pay-bnb',
|
|
32
|
+
'pending', 'poll', 'post-mint', 'preset', 'promoter', 'quote', 'raise', 'recipient', 'ref', 'ref-pool',
|
|
33
|
+
'request-id', 'reveal-after', 'sell-tax', 'settle-first', 'shares', 'slippage', 'sort', 'status', 'symbol',
|
|
34
|
+
'taxed', 'testnet', 'tier', 'timeout', 'to-bnb', 'token', 'track', 'twap-window', 'twitter', 'url', 'use-quote',
|
|
35
|
+
'use-wbnb', 'vault', 'webhook', 'website', 'who', 'window',
|
|
36
|
+
])
|
|
37
|
+
|
|
24
38
|
// what people type for the two link flags
|
|
25
39
|
const LINK_TYPOS = {
|
|
26
40
|
website: ['url', 'site', 'web', 'homepage', 'link', 'website-url', 'web-url', 'site-url', 'websiteurl', 'www'],
|
package/src/gangpad.js
CHANGED
|
@@ -11,10 +11,10 @@ import { bsc, bscTestnet } from 'viem/chains'
|
|
|
11
11
|
*
|
|
12
12
|
* Env (new name first; the old per-command names still work as aliases). The contracts set the create target (gangGens):
|
|
13
13
|
* mainnet: GANG_PAD (aliases GANG_V3_PAD / GANG_FAIR_PAD), GANG_ROUTER, GANG_BOND, GANG_SPLITTER_FACTORY,
|
|
14
|
-
* GANG_SPLIT_FACTORY, GANG_LP_FACTORY, GANG_RPC_URL
|
|
14
|
+
* GANG_SPLIT_FACTORY, GANG_LP_FACTORY, GANG_PROMOTE_POOL_FACTORY, GANG_RPC_URL
|
|
15
15
|
* testnet: GANG_TESTNET_PAD (aliases GANG_V3_TESTNET_PAD / GANG_FAIR_TESTNET_PAD),
|
|
16
16
|
* GANG_TESTNET_ROUTER (alias GANG_ROUTER_TESTNET), GANG_TESTNET_BOND, GANG_TESTNET_SPLITTER_FACTORY,
|
|
17
|
-
* GANG_TESTNET_SPLIT_FACTORY, GANG_TESTNET_LP_FACTORY,
|
|
17
|
+
* GANG_TESTNET_SPLIT_FACTORY, GANG_TESTNET_LP_FACTORY, GANG_TESTNET_PROMOTE_POOL_FACTORY,
|
|
18
18
|
* GANG_TESTNET_RPC_URL (aliases GANG_V3_TESTNET_RPC_URL / GANG_FAIR_TESTNET_RPC_URL)
|
|
19
19
|
* An RPC variable takes one URL or a comma-separated list; set, it replaces the public nodes below.
|
|
20
20
|
*/
|
|
@@ -48,12 +48,16 @@ export const GANG_GENS = {
|
|
|
48
48
|
// GangRouter, tax handler (owned by its GangHandlerAdmin 0xC833…Af76), GangBond and the four module factories, all
|
|
49
49
|
// bound to this proxy (docs/MAINNET-GANG-LAUNCHPAD-3-MODULES-2026-11-03.md). Vault mode since the Safe's upgrade at
|
|
50
50
|
// block 131454282 (implementation 0x88A4…028D, Pad3Module 0xa712…409A); vaultModeOf reads it from the pad. 铸币飞轮 mode
|
|
51
|
-
// and 打新 through the entry since 2026-11-04 (fly tax handler 0x7De9…3ba0, vault core 0x9d90…767E, deployer 0x2C95…072E)
|
|
51
|
+
// and 打新 through the entry since 2026-11-04 (fly tax handler 0x7De9…3ba0, vault core 0x9d90…767E, deployer 0x2C95…072E).
|
|
52
|
+
// Promoter share since the Safe's upgrade at block 132216700 (implementation 0xB06D…F7a4, Pad3Module 0x4E7E…bd6c)
|
|
52
53
|
{
|
|
53
54
|
gen: PAD3_GEN, pad: '0x2bEbED4be8c8F46C17776C71D7a6A45dbC5CAB29', router: '0xec9717E5C68b9F18fA76D3961C9Cd7e67b5E61e7',
|
|
54
55
|
bond: '0x830b38F695Ca1bCbdD313CD5AA5943e2125Be9D6', splitterFactory: '0xc1282e7Fd3DFa5e00e74E9EbF8c54fFfB5763194',
|
|
55
56
|
splitFactory: '0x904D4498a9257E4d7638afEbB95A1162cB2171f2', lpFactory: '0x98C506F0F4762F9d1Ec96C27499CE8B7e5981752',
|
|
56
57
|
comboFactory: '0x20188054dE31De844df205712768852BdeD3eA39',
|
|
58
|
+
// the pool side of the promoter share, 2026-11-07, block 132218466; the Safe allowed it on GangHandlerAdmin at block
|
|
59
|
+
// 132219892 (docs/MAINNET-GANG-LAUNCHPAD-3-PROMOTE-2026-11-07.md)
|
|
60
|
+
promotePoolFactory: '0xA633e499ADcD69A4F91dc83587096b2c1903167A',
|
|
57
61
|
},
|
|
58
62
|
// 2026-10-31, pad block 130874052: 2.0 with the creator fee and the graduation target the creator picks (the create
|
|
59
63
|
// target until 3.0; its tokens trade and claim here); its own GangRouter, GangBond, buy-back factory
|
|
@@ -95,6 +99,8 @@ export const GANG_GENS = {
|
|
|
95
99
|
bond: '0xa87727dc3CC28a44709649A22aDbD77287B99fc1', splitterFactory: '0x3533E63EF0386adfBC96227C50f1b82EEA18d110',
|
|
96
100
|
splitFactory: '0xf8d4FA57FD65Bf16427Eef653518811fFa2606dc', lpFactory: '0x4A3aC160eAF4A2747046b119631988D5D8056B07',
|
|
97
101
|
comboFactory: '0xdc1687961c8aAf5A0340c1A73b604cf3a2be543C',
|
|
102
|
+
// the pool side of the promoter share, 2026-11-05 (docs/TESTNET-GANG-LAUNCHPAD-3-2026-11-03.md)
|
|
103
|
+
promotePoolFactory: '0x7a68A65d27591a21C44f91015F930422BA79F1c2',
|
|
98
104
|
},
|
|
99
105
|
// 2026-10-31, pad block 139940227: 2.0 with the graduation target the creator picks (GRAD_BNB_TIERS, createWithGradTarget;
|
|
100
106
|
// docs/SPEC-CURVE-GRAD-TARGET-2026-10-31.md), the create target until 3.0; buy-back factory buyback-burn-v4, split-v1,
|
|
@@ -130,18 +136,18 @@ export const GANG_GENS = {
|
|
|
130
136
|
],
|
|
131
137
|
}
|
|
132
138
|
// what a generation brings to a ctx (gen: '1.0' | '2.0' | PAD3_GEN | VAULT_GEN, null for a pad named by the env that this CLI does not know)
|
|
133
|
-
const GEN_FIELDS = ['gen', 'pad', 'router', 'bond', 'splitterFactory', 'splitFactory', 'lpFactory', 'comboFactory']
|
|
139
|
+
const GEN_FIELDS = ['gen', 'pad', 'router', 'bond', 'splitterFactory', 'splitFactory', 'lpFactory', 'comboFactory', 'promotePoolFactory']
|
|
134
140
|
// the env names of each field, per network (new name first; the old per-command names still work as aliases)
|
|
135
141
|
const GEN_ENV = {
|
|
136
142
|
mainnet: {
|
|
137
143
|
pad: ['GANG_PAD', 'GANG_V3_PAD', 'GANG_FAIR_PAD'], router: ['GANG_ROUTER'], bond: ['GANG_BOND'],
|
|
138
144
|
splitterFactory: ['GANG_SPLITTER_FACTORY'], splitFactory: ['GANG_SPLIT_FACTORY'], lpFactory: ['GANG_LP_FACTORY'],
|
|
139
|
-
comboFactory: ['GANG_COMBO_FACTORY'],
|
|
145
|
+
comboFactory: ['GANG_COMBO_FACTORY'], promotePoolFactory: ['GANG_PROMOTE_POOL_FACTORY'],
|
|
140
146
|
},
|
|
141
147
|
testnet: {
|
|
142
148
|
pad: ['GANG_TESTNET_PAD', 'GANG_V3_TESTNET_PAD', 'GANG_FAIR_TESTNET_PAD'], router: ['GANG_TESTNET_ROUTER', 'GANG_ROUTER_TESTNET'],
|
|
143
149
|
bond: ['GANG_TESTNET_BOND'], splitterFactory: ['GANG_TESTNET_SPLITTER_FACTORY'], splitFactory: ['GANG_TESTNET_SPLIT_FACTORY'],
|
|
144
|
-
lpFactory: ['GANG_TESTNET_LP_FACTORY'], comboFactory: ['GANG_TESTNET_COMBO_FACTORY'],
|
|
150
|
+
lpFactory: ['GANG_TESTNET_LP_FACTORY'], comboFactory: ['GANG_TESTNET_COMBO_FACTORY'], promotePoolFactory: ['GANG_TESTNET_PROMOTE_POOL_FACTORY'],
|
|
145
151
|
},
|
|
146
152
|
}
|
|
147
153
|
|
package/src/index.js
CHANGED
|
@@ -22,6 +22,7 @@ import { runV3, v3Ctx, V3_EVENT_ABIS } from './v3.js'
|
|
|
22
22
|
import { runBond } from './bond.js'
|
|
23
23
|
import { runBuyback } from './buyback.js'
|
|
24
24
|
import { runSplit, SPLIT_EVENT_ABIS } from './split.js'
|
|
25
|
+
import { runPromote, PROMOTE_EVENT_ABIS } from './promote.js'
|
|
25
26
|
import { runLp, LP_EVENT_ABIS } from './lp.js'
|
|
26
27
|
import { runCombo, COMBO_EVENT_ABIS } from './combo.js'
|
|
27
28
|
import { runFly, flyCtx, isFlyToken, FLY_EVENT_ABIS, FLY_CREATE_FLAGS } from './fly.js'
|
|
@@ -36,7 +37,7 @@ import { portfolio } from './portfolio.js'
|
|
|
36
37
|
import { codeOf, record } from './telemetry.js'
|
|
37
38
|
import { trending, trendingBlock, TRENDING_NOTE } from './trending.js'
|
|
38
39
|
import { shareFor } from './share.js'
|
|
39
|
-
import { CREATE_ACCEPTS, FAIR_CREATE_FLAGS, LINK_FLAGS, V3_CREATE_FLAGS, unknownFlagError } from './flags.js'
|
|
40
|
+
import { BUY_ACCEPTS, CREATE_ACCEPTS, FAIR_CREATE_FLAGS, LINK_FLAGS, suggestFlag, V3_CREATE_FLAGS, unknownFlagError } from './flags.js'
|
|
40
41
|
import { parseAbi } from 'viem'
|
|
41
42
|
|
|
42
43
|
const args = process.argv.slice(2)
|
|
@@ -249,6 +250,27 @@ async function resolveRef(me) {
|
|
|
249
250
|
const followSkipped = (follow) =>
|
|
250
251
|
follow ? { follow: { ...follow, attached: false, reason: 'this setup step carries no follow ref; re-run the same command' } } : {}
|
|
251
252
|
|
|
253
|
+
/**
|
|
254
|
+
* A misspelled --promoter on a buy must not fall through to a plain first buy: that buy uses up the wallet's only chance
|
|
255
|
+
* to bind, for good.
|
|
256
|
+
*/
|
|
257
|
+
function checkPromoterTypo() {
|
|
258
|
+
const argv = process.argv.slice(2)
|
|
259
|
+
for (const [i, a] of argv.entries()) {
|
|
260
|
+
// -promoter, —promoter (phones and chat apps turn -- into a dash), promoter: no flag parser sees these, so they'd drop silently
|
|
261
|
+
// argv[0] is the command itself: gang promote buy
|
|
262
|
+
if (i > 0 && !/^--[A-Za-z]/.test(a) && !['--note', '--ref', '--promoter'].includes(argv[i - 1]) && (/^[-\u2010-\u2015\u2212]+[A-Za-z]/.test(a) || /^promot/i.test(a))) {
|
|
263
|
+
fail(`${a} is not a flag: flags start with two plain hyphens, like --promoter <addr>. Nothing was built: a first buy without a promoter can never bind later`)
|
|
264
|
+
}
|
|
265
|
+
if (!/^--[A-Za-z]/.test(a) || a === '--promoter') continue
|
|
266
|
+
const name = a.slice(2).split('=')[0]
|
|
267
|
+
if (a.startsWith('--promoter=') || suggestFlag(name, ['promoter']) === 'promoter' || /promo|referr/i.test(name)) {
|
|
268
|
+
fail(`${a}: did you mean --promoter <addr>, with the address after a space? Nothing was built: a first buy without a promoter can never bind later`)
|
|
269
|
+
}
|
|
270
|
+
if (!BUY_ACCEPTS.has(name)) fail(`--${name} is not a flag of a buy: see gang help. Nothing was built`)
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
252
274
|
const HELP = `gang — agent-only launchpad on BNB Chain (Binance Agentic Wallet) · new tokens on GangLaunchpad (V3 / 打新)
|
|
253
275
|
|
|
254
276
|
One command per action, whatever pad the token is on: buy / sell / info / status / claim / mint / withdraw / release
|
|
@@ -303,7 +325,7 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
|
|
|
303
325
|
pays as of the next block: expectOut / minOut for amountOutMin). V2 / Soft: balance
|
|
304
326
|
gang quote --token <addr> --amount <n> V2 / Soft / U / S curve buy (Soft: BNB; V2 / U / S: the quote ERC-20). V3 / 打新:
|
|
305
327
|
gang buy simulates the trade and shows expectTokens (nothing sent before gang execute)
|
|
306
|
-
gang buy --token <addr> --amount <n> [--slippage 1] [--follow <note tx>] [--note "<why>" [--conf 0-100] [--reveal-after 1-72h]] [--ref <inviter>]
|
|
328
|
+
gang buy --token <addr> --amount <n> [--slippage 1] [--follow <note tx>] [--note "<why>" [--conf 0-100] [--reveal-after 1-72h]] [--ref <inviter>] [--promoter <addr>]
|
|
307
329
|
--amount = what to spend, in the token's quote (--bnb is the older name of the flag).
|
|
308
330
|
V3 curve: includes the 1% fee (no tax on the curve); WBNB-quoted pays native BNB via
|
|
309
331
|
GangRouter in one tx (--use-wbnb: from WBNB). 打新: after launch only (before it:
|
|
@@ -328,6 +350,11 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
|
|
|
328
350
|
--ref (buy / mint / follow, 0.26.0+): who invited this wallet (address or .ai handle,
|
|
329
351
|
from the invite link the user gave). Attached only when this is the wallet's first
|
|
330
352
|
Gang trade; the result's ref says whether it was. 铸币飞轮: the mint's own inviter
|
|
353
|
+
--promoter (buy, V3 curve on 3.0, 0.34.0+): the promoter of a token made with --promote. In anything passed on to
|
|
354
|
+
others write gang promote buy: an older CLI answers that with its help, but builds gang buy --promoter as a plain buy.
|
|
355
|
+
It binds this wallet for good, by its first trade of the token, and only on a buy
|
|
356
|
+
sent directly from the wallet. Same price and fee for you; refused when it can't bind.
|
|
357
|
+
Not --ref: --ref is gang.fun's invite credit, --promoter a share on chain
|
|
331
358
|
gang invite [--token <addr>] [--who <addr|handle>]
|
|
332
359
|
my invite link (https://gang.fun/start?ref=…[&token=…]) and how many new agents it
|
|
333
360
|
brought (invited / qualified: traded again a day later within 7 days), this week and
|
|
@@ -479,7 +506,7 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
|
|
|
479
506
|
settles 1 hour later).
|
|
480
507
|
|
|
481
508
|
CREATOR FEE (GangLaunchpad 2.0 / 3.0: of the 1% fee on every V3 curve buy and sell, 70% is kept on the pad for the token's
|
|
482
|
-
creator, before and after graduation, no deadline; 1.0 tokens and 打新 sales have none):
|
|
509
|
+
creator, less any promoter share the creator set, before and after graduation, no deadline; 1.0 tokens and 打新 sales have none):
|
|
483
510
|
gang creator-fee [--from <creator>] every 2.0 / 3.0 V3 token this wallet created and what it can claim (read on chain), with
|
|
484
511
|
totals per quote
|
|
485
512
|
gang creator-fee --token <addr> one token: padGen, sharePct, claimable
|
|
@@ -488,6 +515,32 @@ creator, before and after graduation, no deadline; 1.0 tokens and 打新 sales h
|
|
|
488
515
|
The fee is the creator's own: never the tax recipient's or a buy-back / split / LP
|
|
489
516
|
module's. gang info / status (the creator's) and gang portfolio show it too
|
|
490
517
|
|
|
518
|
+
PROMOTER SHARE (GangLaunchpad 3.0, 0.34.0+; GANG_PROMOTE_POOL_FACTORY / GANG_TESTNET_PROMOTE_POOL_FACTORY):
|
|
519
|
+
gang create … --promote <0.01-50> [--promote-days <7-90, default 30>]
|
|
520
|
+
that % of your creator fee goes to the promoter of each bound wallet, on its curve
|
|
521
|
+
trades inside the window; fixed for good. On a taxed token with no --recipient,
|
|
522
|
+
--buyback, --lp or --split, the launch also makes the recipient a promoter pool
|
|
523
|
+
module (clone, create, bind: re-run after each): the same % of the recipient's part
|
|
524
|
+
of those wallets' pool tax. Name a recipient to keep the share on the curve
|
|
525
|
+
gang promote buy --token <addr> --amount <n> --promoter <addr>
|
|
526
|
+
gang buy --promoter, in the form an older CLI refuses instead of buying without binding
|
|
527
|
+
gang promote status --token <addr> [--wallet <addr>]
|
|
528
|
+
terms, the wallet's binding and curve share, the pool module, roots, what it can claim
|
|
529
|
+
gang promote earnings [--from <addr>] every 3.0 token with a curve share to claim (read on chain) and pool income (gang.fun)
|
|
530
|
+
gang promote claim --token <addr> [--to <addr>]
|
|
531
|
+
claim the curve share, in the token's quote
|
|
532
|
+
gang promote claim-pool (--token <addr> | --module <addr>) [--to <addr>] [--cumulative <wei> --proof <hash,hash>]
|
|
533
|
+
claim pool income against the root in effect. The proof comes from gang.fun and is
|
|
534
|
+
checked against the root on chain; or give your own, recomputed from chain logs
|
|
535
|
+
(scripts/promote-settle in gang-launchpad). A root takes effect 2 days after it is posted
|
|
536
|
+
gang promote activate | gang promote work | gang promote sweep (--token <addr> | --module <addr>) [--asset <addr>]
|
|
537
|
+
anyone: put a root in effect once its window is over / split what arrived (the wallet
|
|
538
|
+
must estimate the gas) / send another asset's balance to the dev
|
|
539
|
+
gang promote bind --token <addr> anyone, once, before graduation (the launch does it)
|
|
540
|
+
gang promote reclaim | gang promote release-dev (--token <addr> | --module <addr>) [--to <addr>]
|
|
541
|
+
the dev: reclaim what no root allocated, after 30 days of settler silence once the token
|
|
542
|
+
has graduated, which closes the module FOR GOOD / send what a failed push left
|
|
543
|
+
|
|
491
544
|
BOND (押金承诺, GangBond; any GangLaunchpad token, from create on; GANG_BOND / GANG_TESTNET_BOND = its address):
|
|
492
545
|
gang bond post --token <addr> --hold <tokens|N%> --days <7-90> (--amount <quote> | --cover <coverage %>) [--use-wbnb]
|
|
493
546
|
creator only, any time after create (V3: buy on the curve first): bond in the token's
|
|
@@ -1102,13 +1155,16 @@ const tokenArg = () => {
|
|
|
1102
1155
|
/** gang <verb> --token <addr>: the kind's code for it, or why it does not apply. */
|
|
1103
1156
|
async function routed(verb) {
|
|
1104
1157
|
const token = tokenArg()
|
|
1158
|
+
if (verb === 'buy') checkPromoterTypo()
|
|
1105
1159
|
// refused before any RPC: both --amount and --bnb, a malformed --note / --conf / --reveal-after, a bad --follow (the
|
|
1106
1160
|
// note itself is built again by the kind's code)
|
|
1107
1161
|
if (verb === 'buy') spendArg()
|
|
1108
1162
|
parseNote()
|
|
1109
1163
|
parseFollow()
|
|
1110
1164
|
if (flag('ref') && !(verb === 'buy' || verb === 'mint')) fail('--ref (an inviter) applies to gang buy / mint / follow only', { token })
|
|
1165
|
+
if (flag('promoter') && verb !== 'buy') fail('--promoter applies to gang buy only: a wallet binds by its first buy', { token })
|
|
1111
1166
|
const kind = await padKind(token, verb)
|
|
1167
|
+
if (flag('promoter') && kind !== 'v3') fail('--promoter is for V3 curve tokens on GangLaunchpad 3.0', { token, kind })
|
|
1112
1168
|
// 铸币飞轮 mints name the inviter in the contract call (fly.js); every other buy / mint carries the invite tag
|
|
1113
1169
|
if (flag('ref') && kind !== 'fly') await resolveRef(fromArg() || (bawStatus() === 'CONNECTED' ? bawAddress() : null))
|
|
1114
1170
|
const io = { ...PAD_IO, out: tagKind(kind) }
|
|
@@ -1161,10 +1217,11 @@ const FLY_NO_BOND = '铸币飞轮 tokens take no GangBond, buy-back splitter, sp
|
|
|
1161
1217
|
/** The flags a 铸币飞轮 create refuses (gang create --fly and gang fly create alike). */
|
|
1162
1218
|
function checkFlyCreate() {
|
|
1163
1219
|
if (flag('fair')) fail('give --fly (铸币飞轮) or --fair (打新), not both')
|
|
1164
|
-
const wrong = ['buy-tax', 'dividend', 'recipient', 'cap', 'shares'].find(flag)
|
|
1220
|
+
const wrong = ['buy-tax', 'dividend', 'recipient', 'cap', 'shares', 'promote', 'promote-days'].find(flag)
|
|
1165
1221
|
if (wrong) {
|
|
1166
1222
|
fail(wrong === 'buy-tax' ? '--buy-tax: a 铸币飞轮 token\'s buy tax is fixed at 1% (--sell-tax 1-2 sets the sell tax)'
|
|
1167
1223
|
: wrong === 'shares' ? '--shares is 打新\'s: a 铸币飞轮 creator mints with --dev-shares <n>'
|
|
1224
|
+
: wrong.startsWith('promote') ? `--${wrong} is for V3 curve tokens: a 铸币飞轮 sale has its own invite bonus (--invite-bonus)`
|
|
1168
1225
|
: wrong === 'cap' ? '--cap is 打新\'s: a 铸币飞轮 sale has a quota per wallet, --quota <5-100> (+ --invite-bonus)'
|
|
1169
1226
|
: `--${wrong} is a V3 tax setting; a 铸币飞轮 token's tax goes to holders, the platform and the creator in fixed parts`)
|
|
1170
1227
|
}
|
|
@@ -1182,13 +1239,13 @@ function create() {
|
|
|
1182
1239
|
if (flyOnly) fail(`--${flyOnly} is a 铸币飞轮 (Mint Flywheel) setting: add --fly to create one (gang create --fly …)`)
|
|
1183
1240
|
if (flag('fair')) {
|
|
1184
1241
|
const wrong = V3_CREATE_FLAGS.find(flag)
|
|
1185
|
-
if (wrong) fail(`--${wrong} is a V3 tax setting; a 打新 sale's pool tax is fixed (1%): leave it out, or drop --fair for a V3 token`)
|
|
1186
|
-
if (isLaunch('fair', flag)) return runLaunch('fair', LAUNCH_DEPS)
|
|
1242
|
+
if (wrong) fail(wrong.startsWith('promote') ? `--${wrong} is for V3 curve tokens: a 打新 sale has no creator fee to share. Leave it out, or drop --fair` : `--${wrong} is a V3 tax setting; a 打新 sale's pool tax is fixed (1%): leave it out, or drop --fair for a V3 token`)
|
|
1243
|
+
if (isLaunch('fair', flag, opt)) return runLaunch('fair', LAUNCH_DEPS)
|
|
1187
1244
|
return runFair('create', { ...PAD_IO, notes: padNotes('fair', 'create') })
|
|
1188
1245
|
}
|
|
1189
1246
|
const wrong = FAIR_CREATE_FLAGS.find(flag)
|
|
1190
1247
|
if (wrong) fail(`--${wrong} is a 打新 (fair-mint) setting: add --fair to create a sale (gang create --fair …)`)
|
|
1191
|
-
if (isLaunch('v3', flag)) return runLaunch('v3', LAUNCH_DEPS)
|
|
1248
|
+
if (isLaunch('v3', flag, opt)) return runLaunch('v3', LAUNCH_DEPS)
|
|
1192
1249
|
return runV3('create', { ...PAD_IO, notes: padNotes('v3', 'create') })
|
|
1193
1250
|
}
|
|
1194
1251
|
|
|
@@ -1203,9 +1260,9 @@ const PREFLIGHT_NEXT = [
|
|
|
1203
1260
|
// commands whose JSON result carries `update`; `watch` streams NDJSON and help is plain text
|
|
1204
1261
|
const UPDATE_CHECKED = new Set(['version', '--version', '-v', 'preflight', 'list', 'trending', 'invite', 'hot', 'new', 'near-grad', 'notes', 'agents', 'token', 'info', 'status', 'portfolio', 'quote',
|
|
1205
1262
|
'buy', 'follow', 'sell', 'claim', 'mint', 'withdraw', 'release', 'upload-logo', 'create', 'execute', 'tx', 'fair', 'v3', 'bond',
|
|
1206
|
-
'buyback', 'split', 'lp', 'combo', 'fly', 'creator-fee'])
|
|
1263
|
+
'buyback', 'split', 'lp', 'combo', 'fly', 'creator-fee', 'promote'])
|
|
1207
1264
|
// gang tx decodes these beside the V2 / Soft / U / S pads' events (GangLaunchpad: both kinds; the tax router; the vaults)
|
|
1208
|
-
const GANG_EVENT_ABIS = [...V3_EVENT_ABIS, ...FAIR_EVENT_ABIS, ...FLY_EVENT_ABIS, ...SPLIT_EVENT_ABIS, ...LP_EVENT_ABIS, ...COMBO_EVENT_ABIS]
|
|
1265
|
+
const GANG_EVENT_ABIS = [...V3_EVENT_ABIS, ...FAIR_EVENT_ABIS, ...FLY_EVENT_ABIS, ...SPLIT_EVENT_ABIS, ...LP_EVENT_ABIS, ...COMBO_EVENT_ABIS, ...PROMOTE_EVENT_ABIS]
|
|
1209
1266
|
|
|
1210
1267
|
/** gang bond / gang buyback / gang split / gang lp / gang combo on a 铸币飞轮 token: those contracts refuse it, so say why before any step. */
|
|
1211
1268
|
async function refuseFly(what) {
|
|
@@ -1309,7 +1366,7 @@ async function main() {
|
|
|
1309
1366
|
// --bond-hold / --bond-days / --restart only mean something in a chained launch (--dev-buy / --bond); never drop them silently
|
|
1310
1367
|
// gang fair create and gang create --fair are 打新 creates; the rest V3
|
|
1311
1368
|
const launchKind = cmd === 'fair' || (cmd === 'create' && flag('fair')) ? 'fair' : 'v3'
|
|
1312
|
-
if (tokenCreate && !flyCreate && !isLaunch(launchKind, flag)) {
|
|
1369
|
+
if (tokenCreate && !flyCreate && !isLaunch(launchKind, flag, opt)) {
|
|
1313
1370
|
// a 打新 dev buys with --shares in the create itself: say so here, not "add --bond" (which would only lead to that)
|
|
1314
1371
|
if (launchKind === 'fair' && flag('dev-buy')) fail(FAIR_DEV_BUY)
|
|
1315
1372
|
const lone = LAUNCH_FLAGS.find((f) => flag(f))
|
|
@@ -1317,16 +1374,26 @@ async function main() {
|
|
|
1317
1374
|
}
|
|
1318
1375
|
switch (cmd) {
|
|
1319
1376
|
case 'fair':
|
|
1320
|
-
if (args[1] === 'create' &&
|
|
1377
|
+
if (args[1] === 'create' && (flag('promote') || flag('promote-days'))) fail('--promote is for V3 curve tokens: a 打新 sale has no creator fee to share')
|
|
1378
|
+
if (args[1] === 'create' && isLaunch('fair', flag, opt)) return runLaunch('fair', LAUNCH_DEPS)
|
|
1321
1379
|
return runFair(args[1], alias('fair', args[1]))
|
|
1322
1380
|
case 'v3':
|
|
1323
|
-
if (args[1] === '
|
|
1381
|
+
if (args[1] === 'buy') checkPromoterTypo()
|
|
1382
|
+
if (args[1] === 'create' && isLaunch('v3', flag, opt)) return runLaunch('v3', LAUNCH_DEPS)
|
|
1324
1383
|
return runV3(args[1], alias('v3', args[1]))
|
|
1325
1384
|
case 'fly':
|
|
1326
1385
|
if (args[1] === 'create') checkFlyCreate()
|
|
1327
1386
|
return runFly(args[1], alias('fly', args[1]))
|
|
1328
1387
|
case 'mcp':
|
|
1329
1388
|
return runMcp()
|
|
1389
|
+
case 'promote':
|
|
1390
|
+
// gang buy with --promoter required. Links and docs give this form: a CLI older than the promoter share refuses it,
|
|
1391
|
+
// while it would ignore --promoter on gang buy and spend the wallet's only chance to bind on a plain first buy
|
|
1392
|
+
if (args[1] === 'buy') {
|
|
1393
|
+
if (!flag('promoter')) fail('gang promote buy needs --promoter <addr>; a buy with no promoter is gang buy')
|
|
1394
|
+
return routed('buy')
|
|
1395
|
+
}
|
|
1396
|
+
return runPromote(args[1], { opt, flag, out, fail, summarize: summarizePreview })
|
|
1330
1397
|
case 'creator-fee':
|
|
1331
1398
|
return runCreatorFee({ opt, flag, out, fail, summarize: summarizePreview })
|
|
1332
1399
|
case 'bond':
|
|
@@ -1601,6 +1668,8 @@ async function main() {
|
|
|
1601
1668
|
if (!NOTE_TX.test(noteTx ?? '')) fail('usage: gang follow <note tx> --amount <n> (the note tx is 0x + 64 hex)', { got: noteTx })
|
|
1602
1669
|
if (flag('token')) fail('gang follow takes the token from the note; to name it yourself use `gang buy --token … --amount … --follow <note tx>`')
|
|
1603
1670
|
if (flag('follow')) fail('give the note tx once: `gang follow <note tx> --amount <n>`')
|
|
1671
|
+
checkPromoterTypo()
|
|
1672
|
+
if (flag('promoter')) fail('--promoter applies to gang buy only: a wallet binds by its first buy, named on gang buy', { noteTx })
|
|
1604
1673
|
const bnb = spendArg(); if (!bnb) fail('--amount required (the amount to buy, in the token\'s quote unit; --bnb is the older name)')
|
|
1605
1674
|
const note = parseNote() // a bad --note fails before any API call, as on buy
|
|
1606
1675
|
// checked without a token: gang.fun answers with the note's token, and buy() reuses this check. The wallet is the
|