@gangfun/cli 0.26.0 → 0.27.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
@@ -18,6 +18,8 @@ Operate [gang.fun](https://gang.fun) from a Binance **Agentic Wallet**. Curve bu
18
18
 
19
19
  **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`).
20
20
 
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
+
21
23
  ## Install
22
24
 
23
25
  Node ≥ 18. Also install Binance Agentic Wallet CLI (`baw`):
@@ -81,7 +83,8 @@ gang release --token <addr> # V3: push a tax payment that faile
81
83
  gang follow <note tx> --amount <n> [--slippage 1] [--note …] # buy the token a note is about, as a follow of it
82
84
  gang upload-logo (--file ./avatar.png | --url <image URL>) # → ipfs://<cid> (view at https://cdn.gang.fun/ipfs/<cid>)
83
85
  # create: GangLaunchpad. A V3 token (own buy / sell tax 1–5%, pool only, paid to the creator itself or a whitelisted
84
- # recipient, in the quote; untaxed without --buy-tax / --sell-tax), or with --fair a 打新 (fair mint) sale on the same pad
86
+ # recipient, in the quote; untaxed without --buy-tax / --sell-tax), or with --fair a 打新 (fair mint) sale on the same pad.
87
+ # --vault <vault>: on the 2.0 金库版 pad, bound to that listed vault, from the wallet gang named for it (no --fair / launch flags)
85
88
  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]
86
89
  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]
87
90
  # --cap 0.25–1% of supply per wallet (1% → at least 50 wallets), --hold 60–90% (the hold line)
@@ -148,7 +151,9 @@ Website, X link and description (optional): `--website mycoin.xyz --twitter @myc
148
151
  handle or an x.com / twitter.com link (profile, post, community) and stores it as `https://x.com/…`; `--website` takes an
149
152
  http(s) link (`mycoin.xyz` becomes `https://mycoin.xyz/`; no IP address or port). They go into the token's metadata JSON,
150
153
  uploaded to gang.fun and fixed on-chain as its `contractURI()` / `metaURI()`; like `logoURI` they can't be changed after
151
- the launch. The preview shows `metaURI` and the uploaded `metadata`.
154
+ the launch. The preview shows `metaURI` and the uploaded `metadata`. A create refuses any flag it doesn't take (`--x`,
155
+ `--website-url`, `--website=…`) and names the right one, before anything is uploaded or sent: a misspelled link flag is
156
+ never silently dropped.
152
157
 
153
158
  `logoURI` is written on-chain and can't be changed, so the logo must stay online for good. `--logo-uri` with an image hosted
154
159
  anywhere other than gang.fun is downloaded and copied to gang.fun first (png / jpeg / webp / gif, ≤512 KB), and the copy goes on-chain
@@ -336,4 +341,4 @@ a background process, so a command never waits on it. `GANG_TELEMETRY=0` (or `DO
336
341
 
337
342
  ## Version
338
343
 
339
- `0.26.0` · repo [gangfun/cli](https://github.com/gangfun/cli) · published to [npm](https://www.npmjs.com/package/@gangfun/cli) on push to `main`
344
+ `0.27.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
@@ -18,6 +18,8 @@
18
18
 
19
19
  **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`)上交易。
20
20
 
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
+
21
23
  ## 安装
22
24
 
23
25
  Node ≥ 18。另需 `baw`:
@@ -71,7 +73,8 @@ gang release --token <addr> # V3:补转之前打款失败的
71
73
  gang follow <附言 tx> --amount <n> [--slippage 1] [--note …] # 跟单:买附言里的币,并标明跟的是哪条
72
74
  gang upload-logo (--file ./avatar.png | --url <图片地址>)
73
75
  # 建币:GangLaunchpad。默认是 V3 币(买 / 卖税各 1–5%,只在外盘收,用报价币打给接收地址:发币人自己,或白名单里的
74
- # 合作方;不带 --buy-tax / --sell-tax 即无税);加 --fair 是同一个内盘上的打新
76
+ # 合作方;不带 --buy-tax / --sell-tax 即无税);加 --fair 是同一个内盘上的打新。
77
+ # --vault <金库>:发到 2.0 金库版内盘,绑定平台登记的这个金库,只能由平台为它指定的钱包发(不能带 --fair 和一键发射参数)
75
78
  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]
76
79
  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]
77
80
  # --cap 单地址上限 0.25–1%(1% 时至少 50 个地址),--hold 出局线 60–90%
@@ -138,6 +141,8 @@ gang execute --request-id …
138
141
  x.com / twitter.com 链接(主页、帖子、社区),统一存成 `https://x.com/…`;`--website` 填 http(s) 链接
139
142
  (`mycoin.xyz` 会变成 `https://mycoin.xyz/`,不能用 IP 地址或端口)。它们写进代币的 metadata JSON,上传到 gang.fun,
140
143
  地址作为 `contractURI()` / `metaURI()` 固定在链上;和 `logoURI` 一样,发币后不能再改。preview 会显示 `metaURI` 和上传的 `metadata`。
144
+ 发币命令遇到不认识的参数(`--x`、`--website-url`、`--website=…`)会直接报错并给出正确写法,不会上传或发送任何东西,
145
+ 写错的链接参数不会被悄悄丢掉。
141
146
 
142
147
  `logoURI` 写在链上,发币后改不了,所以 logo 必须长期能打开。`--logo-uri` 填的不是 gang.fun 的图片时,CLI 会先下载这张图,
143
148
  转存到 gang.fun(png / jpeg / webp / gif,≤512 KB),上链的是转存后的 `ipfs://<cid>`(已经在 gang.fun 的文件——`ipfs://<cid>` 或 `https://cdn.gang.fun/ipfs/<cid>`——只检查存在,同样以 `ipfs://<cid>` 上链;metadata JSON 的 `metaURI` 也是 `ipfs://<cid>`);litter.catbox.moe 这类临时图床几天内就会删图。
@@ -288,4 +293,4 @@ Claude Code:`claude mcp add gang -- gang mcp`。同一台机器上 `baw` 要
288
293
 
289
294
  ## 版本
290
295
 
291
- `0.26.0` · [gangfun/cli](https://github.com/gangfun/cli) · push 到 `main` 自动发布到 [npm](https://www.npmjs.com/package/@gangfun/cli)
296
+ `0.27.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.26.0",
3
+ "version": "0.27.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/flags.js ADDED
@@ -0,0 +1,69 @@
1
+ /**
2
+ * The flags a create takes (gang create, gang v3 / fair / fly create, a launch in one command). Anything else is refused
3
+ * before any wrap / approve round or upload: a token's links and metadata can never change after the create, and a
4
+ * misspelled --website (--x, --website-url, --website=…) used to be dropped without a word.
5
+ */
6
+ import { FLY_CREATE_FLAGS } from './fly.js'
7
+ import { LAUNCH_FLAGS } from './launch.js'
8
+
9
+ export const LINK_FLAGS = ['website', 'twitter']
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']
12
+ export const FAIR_CREATE_FLAGS = ['raise', 'cap', 'hold', 'mint-fee', 'exit-fee', 'shares']
13
+
14
+ export const CREATE_ACCEPTS = new Set([
15
+ 'name', 'symbol', 'logo', 'logo-file', 'file-logo', 'logo-uri', 'keep-logo-uri', ...LINK_FLAGS, 'description',
16
+ 'quote', 'ref-pool', 'grad', 'vault', 'testnet', 'calldata', 'from', 'note', 'conf', 'reveal-after',
17
+ 'fair', 'fly', ...V3_CREATE_FLAGS, ...FAIR_CREATE_FLAGS, ...FLY_CREATE_FLAGS,
18
+ // a launch in one command: its dev buy reads --slippage like gang buy, its bond --use-wbnb like gang bond post
19
+ ...LAUNCH_FLAGS, 'slippage', 'use-wbnb',
20
+ // refused further on, each with its own reason
21
+ 'follow', 'cover', 'taxed', 'pair', 'pair-or-quote', 'hours',
22
+ ])
23
+
24
+ // what people type for the two link flags
25
+ const LINK_TYPOS = {
26
+ website: ['url', 'site', 'web', 'homepage', 'link', 'website-url', 'web-url', 'site-url', 'websiteurl', 'www'],
27
+ twitter: ['x', 'x-url', 'xurl', 'twitter-url', 'twitter-link', 'twitter-handle', 'tw', 'handle'],
28
+ }
29
+ const LINK_HINT = { website: '--website <URL>', twitter: '--twitter @handle (or an x.com link)' }
30
+
31
+ const distance = (a, b) => {
32
+ let prev = Array.from({ length: b.length + 1 }, (_, j) => j)
33
+ for (let i = 1; i <= a.length; i++) {
34
+ const row = [i]
35
+ for (let j = 1; j <= b.length; j++) row[j] = Math.min(prev[j] + 1, row[j - 1] + 1, prev[j - 1] + (a[i - 1] === b[j - 1] ? 0 : 1))
36
+ prev = row
37
+ }
38
+ return prev[b.length]
39
+ }
40
+
41
+ /** The closest flag `accepts` has to a mistyped `name` (2 edits at most, case ignored), or null. */
42
+ export function suggestFlag(name, accepts) {
43
+ const n = name.toLowerCase()
44
+ for (const [to, typos] of Object.entries(LINK_TYPOS)) if (typos.includes(n)) return to
45
+ let best = null, bestD = 3
46
+ for (const f of accepts) {
47
+ const d = distance(n, f)
48
+ if (d < bestD) { best = f; bestD = d }
49
+ }
50
+ return best
51
+ }
52
+
53
+ /**
54
+ * The error for the first flag in argv (process.argv.slice(2)) that `accepts` lacks, or null when every flag is known.
55
+ * A flag is a word starting with "--" and a letter; values ("--- launch day ---") are left to the flag that reads them.
56
+ */
57
+ export function unknownFlagError(argv, accepts, label) {
58
+ for (const a of argv) {
59
+ if (!/^--[A-Za-z]/.test(a)) continue
60
+ const raw = a.slice(2)
61
+ const [name, eq] = [raw.split('=')[0], raw.includes('=')]
62
+ if (accepts.has(raw)) continue
63
+ if (eq && accepts.has(name)) return `--${raw}: give the value after a space (--${name} ${raw.slice(name.length + 1) || '<value>'})`
64
+ const to = suggestFlag(name, accepts)
65
+ const hint = !to ? 'see gang help for its flags.' : LINK_HINT[to] ? `did you mean ${LINK_HINT[to]}?` : `did you mean --${to}?`
66
+ return `--${raw} is not a flag of ${label}: ${hint} Nothing was uploaded or sent: unknown flags are refused, since a token's links and metadata can never change after the create`
67
+ }
68
+ return null
69
+ }
package/src/gangpad.js CHANGED
@@ -7,7 +7,7 @@ import { bsc, bscTestnet } from 'viem/chains'
7
7
  * on the pad says which kind a token is (0 = not this pad's, 1 = V3 curve, 2 = 打新). The two `create` overloads keep
8
8
  * their old selectors, so each command keeps its own ABI fragment.
9
9
  *
10
- * Each network may have several generations of this pad (GANG_GENS: 1.0, 2.0); kindOf on each tells which one has a token.
10
+ * Each network may have several generations of this pad (GANG_GENS: 1.0, 2.0, 2.0 金库版); kindOf on each tells which one has a token.
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,
@@ -20,10 +20,17 @@ import { bsc, bscTestnet } from 'viem/chains'
20
20
  */
21
21
 
22
22
  /**
23
- * GangLaunchpad generations on each network, newest first. A create goes to the first; a token already out stays on the
24
- * pad that created it and is served with that generation's GangRouter, GangBond and module factories (each of them is
25
- * bound to one pad). 2.0 (docs/SPEC-CURVE-CREATOR-FEE-2026-10-31.md) has the same V3 curves and 打新 sales, and keeps
26
- * 70% of the 1% curve fee for the token's creator (creatorFeeOf / claimCreatorFee); a 1.0 pad has neither.
23
+ * 2.0 金库版 (GangVaultLaunchpad): 2.0 whose only create is createWithVault, binding the token to a listed lock vault.
24
+ * Listed last on each network, so it is never the target of a plain create; gang create --vault picks it.
25
+ */
26
+ export const VAULT_GEN = '2.0-vault'
27
+
28
+ /**
29
+ * GangLaunchpad generations on each network, newest first (2.0 金库版 aside: always last, see VAULT_GEN). A create goes to
30
+ * the first; a token already out stays on the pad that created it and is served with that generation's GangRouter,
31
+ * GangBond and module factories (each of them is bound to one pad). 2.0 (docs/SPEC-CURVE-CREATOR-FEE-2026-10-31.md) has
32
+ * the same V3 curves and 打新 sales, and keeps 70% of the 1% curve fee for the token's creator (creatorFeeOf /
33
+ * claimCreatorFee); a 1.0 pad has neither.
27
34
  */
28
35
  export const GANG_GENS = {
29
36
  mainnet: [
@@ -48,6 +55,14 @@ export const GANG_GENS = {
48
55
  // combo-v1, 2026-10-31 (the Safe allowed it on GangHandlerAdmin at block 130811492)
49
56
  comboFactory: '0xd33C38BE3f8472b3013167830F0638C1704e1DBd',
50
57
  },
58
+ // 2026-11-02, pad block 131081707: 2.0 金库版 (GangVaultLaunchpad; docs/MAINNET-GANG-VAULT-LAUNCHPAD-2026-11-02.md).
59
+ // The 2.0 curves, each bound at create to one vault the platform listed (createWithVault, by the wallet the Safe
60
+ // named for that vault: gang create --vault). Never the create target of a plain create. Its own GangRouter; no
61
+ // GangBond and no module factories (none is wired to it)
62
+ {
63
+ gen: VAULT_GEN, pad: '0xE90851A90C6278E3d6e4C24320101f8B13D90A11', router: '0xAcd4944A4090c13d9DACAe60f3019cef9d9bB1Ad',
64
+ bond: null, splitterFactory: null, splitFactory: null, lpFactory: null, comboFactory: null,
65
+ },
51
66
  ],
52
67
  testnet: [
53
68
  // 2026-10-31, pad block 139940227: 2.0 with the graduation target the creator picks (GRAD_BNB_TIERS, createWithGradTarget;
@@ -75,9 +90,14 @@ export const GANG_GENS = {
75
90
  splitFactory: '0x5F7dC7502E945A860Cf49cca72dA8bD60Fb1567E', lpFactory: '0xA729C60FCa0Bd0D28a55E22126D3fE412AA41591',
76
91
  comboFactory: '0x52a8f90a92E5C1828b4436a0B99C6b293f7F4CFE',
77
92
  },
93
+ // 2026-11-01, pad block 140215635: 2.0 金库版, testnet v3 (docs/TESTNET-GANG-VAULT-LAUNCHPAD-2026-11-01.md)
94
+ {
95
+ gen: VAULT_GEN, pad: '0x9108e7b85e69060A5E626A04Ce6DEf323071C8a9', router: '0x9bF3E197a6719Af856a7c82d23CABFdBcc184f69',
96
+ bond: null, splitterFactory: null, splitFactory: null, lpFactory: null, comboFactory: null,
97
+ },
78
98
  ],
79
99
  }
80
- // what a generation brings to a ctx (gen: '1.0' | '2.0', null for a pad named by the env that this CLI does not know)
100
+ // what a generation brings to a ctx (gen: '1.0' | '2.0' | VAULT_GEN, null for a pad named by the env that this CLI does not know)
81
101
  const GEN_FIELDS = ['gen', 'pad', 'router', 'bond', 'splitterFactory', 'splitFactory', 'lpFactory', 'comboFactory']
82
102
  // the env names of each field, per network (new name first; the old per-command names still work as aliases)
83
103
  const GEN_ENV = {
@@ -176,6 +196,9 @@ export function gangGens(testnet) {
176
196
  return [first, ...list.filter((g) => !sameAddr(g.pad, first.pad))].map(genFields)
177
197
  }
178
198
 
199
+ /** The 2.0 金库版 generation of `gens` (a ctx's gens or gangGens(testnet)), or null when the network has none. */
200
+ export const vaultGenOf = (gens) => gens.find((g) => g.gen === VAULT_GEN) ?? null
201
+
179
202
  /** A generation's contracts as ctx fields (missing ones null). */
180
203
  export const genFields = (g) => Object.fromEntries(GEN_FIELDS.map((k) => [k, g?.[k] ?? null]))
181
204
 
package/src/index.js CHANGED
@@ -36,6 +36,7 @@ import { portfolio } from './portfolio.js'
36
36
  import { record } from './telemetry.js'
37
37
  import { trending, trendingBlock, TRENDING_NOTE } from './trending.js'
38
38
  import { shareFor } from './share.js'
39
+ import { CREATE_ACCEPTS, FAIR_CREATE_FLAGS, LINK_FLAGS, V3_CREATE_FLAGS, unknownFlagError } from './flags.js'
39
40
  import { parseAbi } from 'viem'
40
41
 
41
42
  const args = process.argv.slice(2)
@@ -156,7 +157,6 @@ const parseNote = () => {
156
157
  try { return makeNote(raw, opt('conf'), opt('reveal-after')) } catch (e) { fail(e.message) }
157
158
  }
158
159
 
159
- const LINK_FLAGS = ['website', 'twitter']
160
160
  /** --website / --twitter (create only) → canonical { website, twitter }, or null when neither is given. */
161
161
  const parseLinks = () => {
162
162
  for (const name of LINK_FLAGS) {
@@ -327,8 +327,8 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
327
327
  copy an image to gang.fun → logoUrl (ipfs://<cid>, for --logo-uri) and url (CDN)
328
328
 
329
329
  gang create --name <n> --symbol <s> [--buy-tax <1-5> --sell-tax <1-5> [--dividend 0-100] [--recipient <0x…>]]
330
- [--grad 6|9|12|15] [--quote 0x… --ref-pool 0x…] [--logo <file> | --logo-uri URL] [--website URL]
331
- [--twitter @handle] [--description <text>] [--testnet]
330
+ [--grad 6|9|12|15] [--vault <0x…>] [--quote 0x… --ref-pool 0x…] [--logo <file> | --logo-uri URL]
331
+ [--website URL] [--twitter @handle] [--description <text>] [--testnet]
332
332
  a V3 token on GangLaunchpad (LaunchpadV2 / Soft / U / S take no new tokens; --taxed,
333
333
  the old V2 track, is refused). No --buy-tax / --sell-tax: untaxed (no pool tax, no
334
334
  dividend, no recipient). Taxed: own buy / sell tax in % (fixed at create), only in the
@@ -338,6 +338,11 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
338
338
  --grad (GangLaunchpad 2.0): the graduation target in BNB raised, 6 / 9 / 12 / 15
339
339
  (default 9; market cap at graduation ≈ 5×); 1.0 graduates every curve at 15 and
340
340
  refuses --grad. info / status show each token's graduationTargetBnb
341
+ --vault (2.0 金库版): create on the vault pad, the token bound for good to this
342
+ vault gang listed, from the wallet gang named for it (one token per naming). Until
343
+ graduation the vault locks / releases holders' tokens through the pad (locked
344
+ tokens count in the 1% cap: gang status → lockedInVault). Alone: no --fair / --fly,
345
+ no --dev-buy / --bond / --buyback / --split / --lp
341
346
  gang create --fair --name <n> --symbol <s> [--raise 15] [--cap 0.5] [--hold 60] [--mint-fee 1] [--exit-fee 1]
342
347
  [--shares 1] [--quote 0x… --ref-pool 0x…] [--logo …] [--website URL] [--twitter @handle] [--description …]
343
348
  a 打新 (fair mint) sale: one price per share both ways, the last share launches on
@@ -351,7 +356,8 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
351
356
  --twitter / --description and the logo go into the token's metadata JSON (uploaded to
352
357
  gang.fun; the token's contractURI / metaURI, permanent). --logo-uri images are copied
353
358
  to gang.fun first (other hosts expire); --keep-logo-uri puts a permanent URL (e.g.
354
- ipfs://) on-chain as is; gang.fun files always go on as ipfs://<cid>
359
+ ipfs://) on-chain as is; gang.fun files always go on as ipfs://<cid>. A flag no create
360
+ takes (--x, --website-url, --website=…) is refused before any upload, never ignored
355
361
  gang create --fly --name <n> --symbol <s> [--preset j|steady] [--raise 3-50] [--quota 5-100] [--invite-bonus 0-3]
356
362
  [--max-per-tx 1-10] [--hold 60-90] [--mint-fee 1-3] [--exit-fee 1-2] [--dev-cut 0-10] [--buy-pct 0-50]
357
363
  [--sell-tax 1-2] [--launch-delay 0-300] [--window 300-1800] [--cap-mul 1-2] [--post-mint | --no-post-mint]
@@ -1137,9 +1143,6 @@ function alias(kind, sub) {
1137
1143
  return { ...io, out: (o) => out(o && typeof o === 'object' ? { ...o, useInstead: `${use} (same flags)` } : o) }
1138
1144
  }
1139
1145
 
1140
- // gang create: V3 by default, a 打新 sale with --fair; a setting of the other kind is refused, not ignored
1141
- const V3_CREATE_FLAGS = ['buy-tax', 'sell-tax', 'dividend', 'recipient']
1142
- const FAIR_CREATE_FLAGS = ['raise', 'cap', 'hold', 'mint-fee', 'exit-fee', 'shares']
1143
1146
  // 铸币飞轮 settings beyond those it shares with 打新 (--raise / --hold / --mint-fee / --exit-fee) and V3 (--sell-tax)
1144
1147
  const FLY_ONLY_FLAGS = FLY_CREATE_FLAGS.filter((f) => !['raise', 'hold', 'mint-fee', 'exit-fee', 'sell-tax'].includes(f))
1145
1148
  const FLY_NO_BOND = '铸币飞轮 tokens take no GangBond, buy-back splitter, split module, LP splitter, combined recipient or --dev-buy (phase 1): the creator mints its shares in the create with --dev-shares <n>'
@@ -1154,6 +1157,7 @@ function checkFlyCreate() {
1154
1157
  : `--${wrong} is a V3 tax setting; a 铸币飞轮 token's tax goes to holders, the platform and the creator in fixed parts`)
1155
1158
  }
1156
1159
  }
1160
+ const VAULT_ALONE = 'a --vault create stands alone: the 2.0 金库版 pad has no GangBond and no buy-back / split / LP / combined module, and a dev buy is its own gang buy after the create lands'
1157
1161
  // --grad picks a V3 curve's graduation target (2.0); a 打新 / 铸币飞轮 sale ends at its own --raise
1158
1162
  const GRAD_ONLY_V3 = (what) => `--grad is a V3 curve setting (the graduation target, 2.0): ${what} fills at its --raise instead, so leave --grad out`
1159
1163
  function create() {
@@ -1268,10 +1272,20 @@ async function main() {
1268
1272
  // `gang create` (= `gang v3 create`) / `gang fair create` write the links into the token metadata
1269
1273
  const tokenCreate = cmd === 'create' || ((cmd === 'v3' || cmd === 'fair' || cmd === 'fly') && args[1] === 'create')
1270
1274
  const flyCreate = (cmd === 'create' && flag('fly')) || (cmd === 'fly' && args[1] === 'create')
1275
+ // a flag no create reads is refused first, before any check that reads the others (flags.js)
1276
+ const unknown = tokenCreate && unknownFlagError(args, CREATE_ACCEPTS, cmd === 'create' ? 'gang create' : `gang ${cmd} create`)
1277
+ if (unknown) fail(unknown)
1271
1278
  if (flyCreate) {
1272
1279
  const launch = LAUNCH_FLAGS.find((f) => flag(f))
1273
1280
  if (launch) fail(`--${launch}: ${FLY_NO_BOND}`)
1274
1281
  }
1282
+ // --vault (2.0 金库版): a V3 create bound to a listed vault, alone: no 打新 / 铸币飞轮, no chained launch
1283
+ if (flag('vault')) {
1284
+ if (!tokenCreate || cmd === 'fair') fail('--vault only applies to a V3 create: gang create --vault <vault> …')
1285
+ if (flyCreate || flag('fair')) fail(`--vault binds a V3 curve token to a listed vault: leave --${flyCreate ? 'fly' : 'fair'} out`)
1286
+ const launch = LAUNCH_FLAGS.find((f) => flag(f))
1287
+ if (launch) fail(`--${launch}: ${VAULT_ALONE}`)
1288
+ }
1275
1289
  for (const name of LINK_FLAGS) {
1276
1290
  if (!tokenCreate && flag(name)) fail(`--${name} only applies when creating a token (\`gang create\`, \`gang create --fair\`, \`gang create --fly\`)`)
1277
1291
  }
package/src/mcp.js CHANGED
@@ -46,7 +46,7 @@ export const RULES = [
46
46
  'A gang_execute that timed out or was cancelled on your side keeps running here (the wallet may have sent it): never execute it again or build a new preview for the same trade before checking gang_status or gang_tx with pending: true; then gang_tx (hash, or pending: true) for the result and the note.',
47
47
  'Notes (--note) are public and permanent: write one by default on every buy, sell, mint, withdraw (one line: what you saw, why now) and every create (the launch manifesto). Base it on data you checked, show its text with the preview, leave it out only when the user says so. No links. --conf is an honest 0-100.',
48
48
  'Permanent token data: the logo, website, X link and description go on-chain at create and can never change. Use only links the user gave; ask once if they have not said. Never host a logo on a temporary file host. Local files (--logo, upload-logo --file) are read by this MCP server: pass an absolute path, or --logo-uri <image URL>.',
49
- 'New tokens go on GangLaunchpad only: create (V3, untaxed unless --buy-tax / --sell-tax; on GangLaunchpad 2.0 --grad 6|9|12|15 picks the graduation target in BNB, default 9) or create --fair (fair mint), or GangFlywheelPad: create --fly (Mint Flywheel). Never an older pad.',
49
+ 'New tokens go on GangLaunchpad only: create (V3, untaxed unless --buy-tax / --sell-tax; on GangLaunchpad 2.0 --grad 6|9|12|15 picks the graduation target in BNB, default 9; --vault <vault> only from the wallet gang named for that listed vault, alone, never on your own initiative) or create --fair (fair mint), or GangFlywheelPad: create --fly (Mint Flywheel). Never an older pad.',
50
50
  'Bonds: before a bond post, tell the user there is no early withdrawal and any sell below the promised holding before settle, anywhere, loses the whole bond. Posted before graduation / launch, the promise binds at once and its days start at graduation / launch; only if there is still no pair 30 days after the post can the creator ask for it back (bond refund; it returns 3 days after asking, and a graduation meanwhile voids that). Relay warning. breakBond (--break-bond) only when the user, told that, still says sell. bond report only when the user asks.',
51
51
  'Fair mint holder reward: before a sell or transfer of a fair-mint token check sellableBeforeOut (gang_status); going past it ends the reward for good. confirmOut (--confirm-out) only with the user\'s yes.',
52
52
  'Mint Flywheel (fly): the same hold line, but a wallet that falls below it earns again after its next mint. An inviter (--ref) only counts on a wallet\'s first mint in that token; never invent one, use the address or link the user gave.',
package/src/v3.js CHANGED
@@ -3,7 +3,7 @@ import { decimalsOf, defaultRefPool, dividendOf, VAULT_ABI, fundingStep as fund,
3
3
  import { API } from './discover.js'
4
4
  import { UA } from './version.js'
5
5
  import { walletFor } from './fair.js'
6
- import { atTokenPad, CREATOR_FEE_ABI, GRAD_TARGET_ABI, gradTargetBnbOf, gradTiersOf, KIND_UNREAD, MERGED_ERRORS_ABI, MERGED_HINTS, NOT_ON_MAINNET, notThisKind, padNets, rpcTransport } from './gangpad.js'
6
+ import { atTokenPad, CREATOR_FEE_ABI, genFields, GRAD_TARGET_ABI, gradTargetBnbOf, gradTiersOf, KIND_UNREAD, MERGED_ERRORS_ABI, MERGED_HINTS, NOT_ON_MAINNET, notThisKind, padNets, rpcTransport, VAULT_GEN, vaultGenOf } from './gangpad.js'
7
7
  import { createNote, curveCreatorFee } from './creatorfee.js'
8
8
  import { poolPayBnb, poolTrade } from './pool.js'
9
9
  import { bondGuard } from './bond.js'
@@ -25,6 +25,12 @@ const TAX = '(uint16 buyTaxBps, uint16 sellTaxBps, uint16 dividendBps, address r
25
25
  const PAD_ABI = parseAbi([
26
26
  `function create(string name, string symbol, string logoURI, string metaURI, address quote, address refPool, ${TAX} tax) returns (address)`,
27
27
  `function createWithGradTarget(string name, string symbol, string logoURI, string metaURI, address quote, address refPool, ${TAX} tax, uint256 gradBnb) returns (address)`,
28
+ // 2.0 金库版 (GangVaultLaunchpad): its only create, binding the token to a listed vault for good
29
+ `function createWithVault(string name, string symbol, string logoURI, string metaURI, address quote, address refPool, ${TAX} tax, uint256 gradBnb, address vault) returns (address)`,
30
+ 'function isVault(address vault) view returns (bool)',
31
+ 'function vaultOf(address token) view returns (address)',
32
+ 'function vaultCreator(address vault) view returns (address)',
33
+ 'function lockedOf(address token, address user) view returns (uint256)',
28
34
  'function buy(address token, uint256 quoteIn, uint256 minTokensOut) returns (uint256)',
29
35
  'function sell(address token, uint256 tokensIn, uint256 minQuoteOut) returns (uint256)',
30
36
  `function checkTaxConfig(${TAX} tax) view returns (bool ok, string reason)`,
@@ -47,11 +53,19 @@ const PAD_ABI = parseAbi([
47
53
  'error PoolNotFactory()', 'error QuoteNotInPool()', 'error PoolNoLiquidity()', 'error ThinReferencePool()', 'error NotContract()',
48
54
  'error UnknownPoolType()', 'error QuoteNotAllowed()', 'error RouterNeedsGate()', 'error V3FactoryNotSet()', 'error GradAmtZero()',
49
55
  'error VaultFloorTooHigh()',
56
+ 'error NotVault()', 'error VaultDelisted()', 'error VaultNotContract()', 'error VaultIsRouter()', 'error VaultCannotTrade()',
57
+ 'error UseVaultCreate()', 'error NotVaultCreator()', 'error TraderNotOrigin()',
50
58
  'event Created(address indexed token, address indexed creator, string name, string symbol, string logoURI, address indexed quote, address refPair, uint256 gradAmt)',
51
59
  'event TaxConfigured(address indexed token, uint16 buyTaxBps, uint16 sellTaxBps, uint16 dividendBps, address indexed recipient)',
52
60
  'event Buy(address indexed token, address indexed buyer, uint256 quoteIn, uint256 protocolFee, uint256 tax, uint256 tokensOut, uint256 realQuote)',
53
61
  'event Sell(address indexed token, address indexed seller, uint256 tokensIn, uint256 protocolFee, uint256 tax, uint256 quoteOut, uint256 realQuote)',
54
62
  'event Graduated(address indexed token, address indexed pair, address quote, uint256 tokenAmount, uint256 quoteAmount)',
63
+ // 2.0 金库版: the token's vault, and what the vault moves for a holder before graduation (through the pad)
64
+ 'event VaultBound(address indexed token, address indexed vault)',
65
+ 'event VaultLocked(address indexed token, address indexed vault, address indexed user, uint256 amount)',
66
+ 'event VaultReleased(address indexed token, address indexed vault, address indexed user, uint256 amount)',
67
+ 'event VaultSet(address indexed vault, bool enabled)',
68
+ 'event VaultCreatorSet(address indexed vault, address indexed creator)',
55
69
  ])
56
70
  const TAX_ROUTER_ABI = parseAbi([
57
71
  'function owedOf(address token) view returns (uint256)',
@@ -96,10 +110,20 @@ const HINTS = {
96
110
  RouterNeedsGate: 'the router path is off while the Agent gate is off; re-run with --use-wbnb to buy directly',
97
111
  // not a create flag: the shared dividend vault's holding floor for this pad was raised above what V3 allows (10,000 tokens)
98
112
  VaultFloorTooHigh: 'the platform\'s dividend vault requires a larger holding than V3 dividends allow (10,000 tokens), so a dividend token can\'t be created right now; --dividend 0 still works, or ask gang to fix the vault setting',
113
+ // 2.0 金库版 (gang create --vault)
114
+ NotVault: '--vault is not a vault listed on the 2.0 金库版 pad: gang lists each vault before its token is created',
115
+ NotVaultCreator: 'this wallet is not the one gang named for this vault (each named wallet creates one token): create from that wallet, or ask gang to name this one',
116
+ UseVaultCreate: 'the 2.0 金库版 pad creates only tokens bound to a listed vault: gang create --vault <vault> …',
117
+ VaultCannotTrade: 'a token\'s own vault never buys or sells it on the curve',
118
+ VaultDelisted: 'the token\'s vault was delisted: it takes no new locks (releases stay open)',
119
+ TraderNotOrigin: 'before graduation the pad moves tokens only for the wallet that sends the tx',
99
120
  }
121
+ const VAULT_PAD_ONLY = 'the 2.0 金库版 pad creates only with --vault <vault>: gang create --vault <the vault gang listed for you> …'
100
122
 
101
123
  /** What `gang tx` decodes a V3 trade's logs with (the pad and its 2.0 creator fee, the tax router, the dividend vault). */
102
124
  export const V3_EVENT_ABIS = [PAD_ABI, CREATOR_FEE_ABI, GRAD_TARGET_ABI, TAX_ROUTER_ABI, VAULT_ABI]
125
+ /** For test/gens.mjs: the pad ABI (2.0 金库版 entries included) and the hints its errors get. */
126
+ export const _vaultTest = { PAD_ABI, HINTS }
103
127
 
104
128
  export function v3Ctx(testnet) {
105
129
  const net = V3_NETS[testnet ? 'testnet' : 'mainnet']
@@ -164,6 +188,18 @@ async function labelOf(ctx, registry, recipient) {
164
188
  try { return (await ctx.read(registry, REGISTRY_ABI, 'entries', [recipient]))[2] || null } catch { return null }
165
189
  }
166
190
 
191
+ /** 2.0 金库版: the token's vault and what it means for holders (null on any other pad). */
192
+ async function vaultView(ctx, token, c) {
193
+ if (ctx.gen !== VAULT_GEN) return null
194
+ const address = await ctx.read(ctx.pad, PAD_ABI, 'vaultOf', [token])
195
+ return {
196
+ address, padGen: ctx.gen,
197
+ note: c.graduated
198
+ ? 'graduated: a plain token now, the vault moves it like any other contract'
199
+ : 'until graduation the token moves only through the pad: this vault locks a holder\'s tokens (counted in the holder\'s 1% cap, see gang status → lockedInVault) and releases them, for the wallet that sends the tx and holds an Agent ID',
200
+ }
201
+ }
202
+
167
203
  /** A token's curve and tax as the pad stores them, plus the recipient's whitelist label. null when not a V3 token. */
168
204
  export async function curveOf(ctx, token) {
169
205
  const c = await ctx.read(ctx.pad, PAD_ABI, 'curves', [token])
@@ -320,11 +356,12 @@ export async function runV3(sub, { opt, flag, out, fail, summarize, resolveLogo,
320
356
  ? { warning: `this token pays its tax to the split module, but the module is bound to another token (${split.token}): the keeper never splits this token's tax (${c.quote}); it is split only by hand (gang split distribute --token ${token}${net} --asset ${c.quote})` } : null
321
357
  // 2.0: the creator's part of the curve fee, waiting on the pad
322
358
  const gen = await curveCreatorFee(ctx, token, c, net)
359
+ const vault = await vaultView(ctx, token, c)
323
360
  const nonWbnb = c.quote.toLowerCase() !== String(ctx.wbnb).toLowerCase()
324
361
  const graduationNote = c.graduationTargetBnb != null && !c.graduated
325
362
  ? gradLine(c.graduationTargetBnb, nonWbnb ? `${c.graduationAt} ${c.quoteSymbol || 'of the quote'}` : null) : null
326
363
  return out({
327
- success: true, chainId: Number(ctx.chainId), ...fees, ...pub, ...gen, ...(graduationNote && { graduationNote }), taxNote, ...(swapBack && { swapBack }), ...(buyback && { buyback }),
364
+ success: true, chainId: Number(ctx.chainId), ...fees, ...pub, ...gen, ...(vault && { vault }), ...(graduationNote && { graduationNote }), taxNote, ...(swapBack && { swapBack }), ...(buyback && { buyback }),
328
365
  ...(split && { split: { ...split, ...splitWarn } }), ...(lp && { lp: { ...lp, ...lpWarn } }),
329
366
  ...(combo && { combo: { ...combo, ...(comboWarning && { warning: comboWarning }) } }),
330
367
  })
@@ -342,9 +379,11 @@ export async function runV3(sub, { opt, flag, out, fail, summarize, resolveLogo,
342
379
  const q = c.graduated && c.pair && bal > 0n ? await poolSellQuote(ctx, c.taxHandler, token, bal) : null
343
380
  // the creator's own view also shows its creator fee (2.0)
344
381
  const { creatorFee } = me.toLowerCase() === c.creator.toLowerCase() ? await curveCreatorFee(ctx, token, c, net) : {}
382
+ // 2.0 金库版, before graduation: what this wallet has in the vault, counted in its 1% cap
383
+ const locked = ctx.gen === VAULT_GEN && !c.graduated ? await ctx.read(ctx.pad, PAD_ABI, 'lockedOf', [token, me]) : null
345
384
  return out({
346
385
  success: true, chainId: Number(ctx.chainId), wallet: me, token, quote: c.quoteSymbol, graduated: c.graduated,
347
- balance: formatUnits(bal, 18), dividendPct: c.dividendPct, ...(creatorFee && { creatorFee }),
386
+ balance: formatUnits(bal, 18), ...(locked !== null && { lockedInVault: formatUnits(locked, 18) }), dividendPct: c.dividendPct, ...(creatorFee && { creatorFee }),
348
387
  graduationTargetBnb: c.graduationTargetBnb, graduationAt: c.graduationAt, progressPct: c.progressPct,
349
388
  ...(q && {
350
389
  poolSellAll: {
@@ -398,6 +437,8 @@ export async function runV3(sub, { opt, flag, out, fail, summarize, resolveLogo,
398
437
  if (!(n >= 1 && n <= 5)) fail(`--${f} must be a number between 1 and 5 (in %); for an untaxed token leave out both tax flags (or give both as 0)`, { got: opt(f) ?? null })
399
438
  return n
400
439
  }
440
+ // --vault (2.0 金库版): the listed vault the token is bound to for good; the create goes to that pad (createWithVault)
441
+ const vault = flag('vault') ? addrArg(opt, fail, 'vault', 'the vault gang listed for your token') : null
401
442
  // --grad: the graduation target in BNB raised, one of the pad's GRAD_BNB_TIERS (2.0); left out: the pad's default
402
443
  const grad = flag('grad') ? Number(opt('grad')) : null
403
444
  if (grad !== null && !(grad > 0)) fail('--grad must be the graduation target in BNB raised: 6, 9, 12 or 15', { got: opt('grad') ?? null })
@@ -405,6 +446,24 @@ export async function runV3(sub, { opt, flag, out, fail, summarize, resolveLogo,
405
446
  const sellTax = taxed ? taxOf('sell-tax') : 0
406
447
  const dividend = taxed ? parseNum(fail, 'dividend', opt('dividend', '0'), 0, 100) : 0
407
448
  const me = walletFor(ctx, opt('from'))
449
+ if (vault) {
450
+ // the vault pad, whatever the create target is; its own router, tax handler and fees
451
+ const vg = vaultGenOf(ctx.gens ?? [])
452
+ if (!vg) fail(`--vault: this CLI version knows no 2.0 金库版 pad on ${testnet ? 'the BSC testnet' : 'BSC mainnet'}`)
453
+ Object.assign(ctx, genFields(vg))
454
+ delete ctx._tax
455
+ delete ctx.fees
456
+ // asked before any upload: the pad would refuse the create anyway (NotVault / NotVaultCreator)
457
+ const [listed, named] = await Promise.all([ctx.read(ctx.pad, PAD_ABI, 'isVault', [vault]), ctx.read(ctx.pad, PAD_ABI, 'vaultCreator', [vault])])
458
+ if (!listed) fail(HINTS.NotVault, { vault, pad: ctx.pad })
459
+ if (named.toLowerCase() !== String(me).toLowerCase()) {
460
+ fail(named === zeroAddress
461
+ ? 'no wallet is named to create a token on this vault now (each named wallet creates one token, and the create uses it up): ask gang to name yours'
462
+ : HINTS.NotVaultCreator, { vault, wallet: me, ...(named !== zeroAddress && { namedWallet: named }) })
463
+ }
464
+ } else if (ctx.gen === VAULT_GEN) {
465
+ fail(VAULT_PAD_ONLY, { pad: ctx.pad })
466
+ }
408
467
  // everything to holders needs no recipient; otherwise the recipient gets the rest: --recipient (a whitelisted
409
468
  // partner, or yourself), else the creator itself
410
469
  const recipient = !taxed || (dividend === 100 && !flag('recipient')) ? zeroAddress
@@ -437,8 +496,10 @@ export async function runV3(sub, { opt, flag, out, fail, summarize, resolveLogo,
437
496
  } catch (e) {
438
497
  return fail('cannot price the graduation target in this quote', revertOf(e) || { detail: e.shortMessage || e.message })
439
498
  }
440
- const fn = grad !== null ? 'createWithGradTarget' : 'create'
441
- const argsOf = (logoURI, metaURI) => [name, symbol, logoURI, metaURI, quote, refPool, tax, ...(grad !== null ? [parseUnits(String(grad), 18)] : [])]
499
+ // createWithVault always takes the target (the pad's default when --grad is left out)
500
+ const fn = vault ? 'createWithVault' : grad !== null ? 'createWithGradTarget' : 'create'
501
+ const argsOf = (logoURI, metaURI) => [name, symbol, logoURI, metaURI, quote, refPool, tax,
502
+ ...(vault ? [parseUnits(String(targetBnb), 18), vault] : grad !== null ? [parseUnits(String(grad), 18)] : [])]
442
503
  const createData = (logoURI, metaURI) => encodeFunctionData({ abi: PAD_ABI, functionName: fn, args: argsOf(logoURI, metaURI) })
443
504
  // the logo / metadata strings never decide a revert: dry-run without them, so a create that would fail uploads nothing
444
505
  const dry = await simulate(ctx, me, ctx.pad, PAD_ABI, fn, argsOf('', ''))
@@ -466,6 +527,10 @@ export async function runV3(sub, { opt, flag, out, fail, summarize, resolveLogo,
466
527
  + (dividend > 0 ? '; if no holder has 10,000+ tokens when a tax is paid, the holders\' part goes to the recipient too' : '')
467
528
  : 'untaxed: no tax in the PancakeSwap pool after graduation, no dividend, no recipient',
468
529
  ...(creatorFee && { creatorFee }),
530
+ ...(vault && {
531
+ padGen: ctx.gen, pad: ctx.pad, vault,
532
+ vaultNote: 'the token is bound to this vault for good. Until graduation the token moves only through the pad: the vault locks a holder\'s tokens (counted in that holder\'s 1% cap) and releases them through the pad, for the holder that sends the tx and holds an Agent ID; after graduation it is a plain token. This create uses up the wallet\'s naming for the vault: one token per naming',
533
+ }),
469
534
  note: `${taxed ? 'tax rates and recipient are' : 'untaxed is'} fixed at create. Curve trades pay only the ${fees.curveFeePct}% fee, no tax${taxed ? ': the tax starts in the pool after graduation' : ''}. tokenIfNext changes if another create lands first: the real address is the Created event from \`gang tx --hash …\`.`,
470
535
  }, 'create'))
471
536
  }