@gangfun/cli 0.34.0 → 0.36.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/src/combo.js CHANGED
@@ -233,7 +233,7 @@ const iso = (s) => (Number(s) > 0 ? new Date(Number(s) * 1000).toISOString() : n
233
233
  const q18 = (x) => formatUnits(x, 18)
234
234
 
235
235
  /** _kindOf: the larger set-aside part (a buy-back on a tie); a liquidity part under 2 wei has no half. */
236
- function kindOf(bb, lp) {
236
+ export function kindOf(bb, lp) {
237
237
  const canBurn = bb !== 0n, canAdd = lp / 2n !== 0n
238
238
  if (!canBurn && !canAdd) return null
239
239
  if (!canAdd) return 'buy-back'
package/src/creatorfee.js CHANGED
@@ -23,6 +23,7 @@ const CURVES_ABI = parseAbi([
23
23
  const SYMBOL_ABI = parseAbi(['function symbol() view returns (string)'])
24
24
  const MODULE_TYPE_ABI = parseAbi(['function moduleType() view returns (bytes32)'])
25
25
  const QUOTE_ABI = parseAbi(['function quote() view returns (address)'])
26
+ const CAP_QUOTE_ABI = parseAbi(['function capQuote() view returns (address)'])
26
27
  const ABIS = [CREATOR_FEE_ABI, CURVES_ABI]
27
28
  const HINTS = {
28
29
  NotCreator: 'only the token\'s creator (the wallet that created it) can claim its creator fee; pass that wallet with --from',
@@ -61,15 +62,21 @@ export async function createNote(ctx, net = '') {
61
62
  /**
62
63
  * What pays out a fee claimed into a module, by its moduleType(): the buy-back and LP splitters pay their payee only
63
64
  * when they split (the keeper's chunks do it after graduation), the split module and the combined recipient on
64
- * distribute. null: not one of these.
65
+ * distribute. The capped recipient splits its own quote as the tax (the payees' part counted against the cap) and
66
+ * burns any other asset. null: not one of these.
65
67
  */
66
68
  export function payOutCmd(moduleType, at, net = '', { asset, assetSymbol } = {}) {
67
69
  const t = String(moduleType ?? '')
68
70
  const base = t.startsWith('buyback-burn-') ? 'gang buyback' : t === 'lp-burn-v1' ? 'gang lp'
69
- : t === 'split-v1' ? 'gang split' : t === 'combo-v1' ? 'gang combo' : null
71
+ : t === 'split-v1' ? 'gang split' : t === 'combo-v1' ? 'gang combo' : t === 'capped-v1' ? 'gang capped' : null
70
72
  if (!base) return null
71
73
  const splitter = base === 'gang buyback' || base === 'gang lp'
72
74
  const m = `--module ${at ?? '<module>'}`
75
+ if (base === 'gang capped') {
76
+ return asset
77
+ ? `${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
+ : `${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
+ }
73
80
  // a fee in another quote than the module's own: split / distribute of the bound quote never moves it
74
81
  if (asset) {
75
82
  return splitter
@@ -84,11 +91,18 @@ export function payOutCmd(moduleType, at, net = '', { asset, assetSymbol } = {})
84
91
  * The claim's --to note when --to is a module (pure: unit-tested): `bound` is its quote() (zero: not bound yet),
85
92
  * `quote` the token's. { payOut, warning }: a fee in another quote is not moved by split / distribute.
86
93
  */
87
- export function claimToModule({ moduleType, at, net = '', bound, quote, quoteSymbol, boundSymbol }) {
94
+ export function claimToModule({ moduleType, at, net = '', bound, quote, quoteSymbol, boundSymbol, capQuote, capSymbol }) {
88
95
  const other = !!bound && !!quote && bound.toLowerCase() !== quote.toLowerCase()
89
96
  const unbound = !bound || /^0x0{40}$/.test(bound)
90
- const payOut = payOutCmd(moduleType, at, net, other && !unbound ? { asset: quote, assetSymbol: quoteSymbol } : {})
97
+ // 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)
99
+ const payOut = payOutCmd(moduleType, at, net, (other && !unbound) || burned ? { asset: quote, assetSymbol: quoteSymbol } : {})
91
100
  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` }
102
+ // 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` }
105
+ }
92
106
  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)' }
93
107
  if (!other) return { payOut, warning: null }
94
108
  return {
@@ -96,11 +110,13 @@ export function claimToModule({ moduleType, at, net = '', bound, quote, quoteSym
96
110
  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`,
97
111
  }
98
112
  }
99
- const LAUNCH_TYPES = { buyback: 'buyback-burn-v4', lp: 'lp-burn-v1', split: 'split-v1', combo: 'combo-v1' }
113
+ const LAUNCH_TYPES = { buyback: 'buyback-burn-v4', lp: 'lp-burn-v1', split: 'split-v1', combo: 'combo-v1', capped: 'capped-v1' }
100
114
 
101
- /** 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). */
115
+ /** 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). */
102
116
  export const notThroughModule = (module, { token, at, net = '', kind } = {}) =>
103
117
  `This creator fee is yours, the creating wallet's: it does not go through the ${module}, which gets only the recipient's part of the pool tax after graduation.`
118
+ // capped: the fee kept (or claimed anywhere else) is never limited by the cap; claimed into the module it is split as tax
119
+ + (kind === 'capped' ? ' The cap never limits it: it covers only the recipient\'s part of the pool tax.' : '')
104
120
  + (at ? ` To put it into the ${module} anyway, claim it there: gang creator-fee --token ${token ?? '<token>'}${net} --claim --to ${at}` : '')
105
121
  + (at && kind && LAUNCH_TYPES[kind] ? `; ${payOutCmd(LAUNCH_TYPES[kind], at, net)}` : '')
106
122
 
@@ -250,9 +266,10 @@ export async function runCreatorFee({ opt, flag, out, fail, summarize }) {
250
266
  let toModule = { payOut: null, warning: null }
251
267
  if (toType && payOutCmd(toType, to)) {
252
268
  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
253
270
  const sym = (a) => (a && !/^0x0{40}$/.test(a) ? ctx.read(a, SYMBOL_ABI, 'symbol').catch(() => null) : null)
254
- const [quoteSymbol, boundSymbol] = await Promise.all([sym(quote), sym(bound)])
255
- toModule = claimToModule({ moduleType: toType, at: to, net, bound, quote, quoteSymbol, boundSymbol })
271
+ const [quoteSymbol, boundSymbol, capSymbol] = await Promise.all([sym(quote), sym(bound), sym(capQuote)])
272
+ toModule = claimToModule({ moduleType: toType, at: to, net, bound, quote, quoteSymbol, boundSymbol, capQuote, capSymbol })
256
273
  }
257
274
  const { payOut, warning } = toModule
258
275
  return out(step(ctx, { from: me, to: ctx.pad, data }, {
package/src/gangpad.js CHANGED
@@ -55,6 +55,9 @@ export const GANG_GENS = {
55
55
  bond: '0x830b38F695Ca1bCbdD313CD5AA5943e2125Be9D6', splitterFactory: '0xc1282e7Fd3DFa5e00e74E9EbF8c54fFfB5763194',
56
56
  splitFactory: '0x904D4498a9257E4d7638afEbB95A1162cB2171f2', lpFactory: '0x98C506F0F4762F9d1Ec96C27499CE8B7e5981752',
57
57
  comboFactory: '0x20188054dE31De844df205712768852BdeD3eA39',
58
+ // capped-v1, 2026-11-08, block 132418984; the Safe allowed it on GangHandlerAdmin at block 132420220
59
+ // (docs/MAINNET-CAPPED-MODULE-2026-11-08.md)
60
+ cappedFactory: '0x294E901ecb66af280C1cDD26fD871601d89a2Dca',
58
61
  // the pool side of the promoter share, 2026-11-07, block 132218466; the Safe allowed it on GangHandlerAdmin at block
59
62
  // 132219892 (docs/MAINNET-GANG-LAUNCHPAD-3-PROMOTE-2026-11-07.md)
60
63
  promotePoolFactory: '0xA633e499ADcD69A4F91dc83587096b2c1903167A',
@@ -68,6 +71,7 @@ export const GANG_GENS = {
68
71
  bond: '0x231339463d04A2127E6dD5756756Dd56853AE0D8', splitterFactory: '0x77e499c892e5E6B3eEe1721e6821e9DA1293803C',
69
72
  splitFactory: '0xa73dC3d63AAf72E70b1cb012e5f3A541360Bec59', lpFactory: '0x8ac85f150f87B536fb05eA163908b1077D95c0E4',
70
73
  comboFactory: '0xcCeA388DbC0Edb206eC25C9715546d57029198Be',
74
+ cappedFactory: null,
71
75
  },
72
76
  // 2026-10-27, pad block 130104322. router = the GangRouter proxy: BNB buys and every PancakeSwap trade of a graduated
73
77
  // token (V3, 打新 and V2 / Soft / U / S alike). GangBond 2026-10-29 with the re-review L-1 fix; it replaces 0xf26F…C817
@@ -80,6 +84,7 @@ export const GANG_GENS = {
80
84
  splitFactory: '0x27e08271E52B2D129c824CD245e69471a8d3067c', lpFactory: '0xE0436867dAFcf42Ee1418083251a9B8B61F0C248',
81
85
  // combo-v1, 2026-10-31 (the Safe allowed it on GangHandlerAdmin at block 130811492)
82
86
  comboFactory: '0xd33C38BE3f8472b3013167830F0638C1704e1DBd',
87
+ cappedFactory: null,
83
88
  },
84
89
  // 2026-11-02, pad block 131081707: 2.0 金库版 (GangVaultLaunchpad; docs/MAINNET-GANG-VAULT-LAUNCHPAD-2026-11-02.md).
85
90
  // The 2.0 curves, each bound at create to one vault the platform listed (createWithVault, by the wallet the Safe
@@ -87,7 +92,7 @@ export const GANG_GENS = {
87
92
  // GangBond and no module factories (none is wired to it)
88
93
  {
89
94
  gen: VAULT_GEN, pad: '0xE90851A90C6278E3d6e4C24320101f8B13D90A11', router: '0xAcd4944A4090c13d9DACAe60f3019cef9d9bB1Ad',
90
- bond: null, splitterFactory: null, splitFactory: null, lpFactory: null, comboFactory: null,
95
+ bond: null, splitterFactory: null, splitFactory: null, lpFactory: null, comboFactory: null, cappedFactory: null,
91
96
  },
92
97
  ],
93
98
  testnet: [
@@ -99,6 +104,8 @@ export const GANG_GENS = {
99
104
  bond: '0xa87727dc3CC28a44709649A22aDbD77287B99fc1', splitterFactory: '0x3533E63EF0386adfBC96227C50f1b82EEA18d110',
100
105
  splitFactory: '0xf8d4FA57FD65Bf16427Eef653518811fFa2606dc', lpFactory: '0x4A3aC160eAF4A2747046b119631988D5D8056B07',
101
106
  comboFactory: '0xdc1687961c8aAf5A0340c1A73b604cf3a2be543C',
107
+ // capped-v1, 2026-11-08 (deployed at block 141527185, allowed on the GangHandlerAdmin at block 141527190)
108
+ cappedFactory: '0xe3f61865d98993dd39c136Af19651C6F6686498A',
102
109
  // the pool side of the promoter share, 2026-11-05 (docs/TESTNET-GANG-LAUNCHPAD-3-2026-11-03.md)
103
110
  promotePoolFactory: '0x7a68A65d27591a21C44f91015F930422BA79F1c2',
104
111
  },
@@ -110,6 +117,7 @@ export const GANG_GENS = {
110
117
  bond: '0x39749B59066d9cd1c55E2Fc48B31a3978C9951F9', splitterFactory: '0xDC9EdA9a29F4Ff66E7dAb6E5A2142df5a7aC0f6e',
111
118
  splitFactory: '0xb9ab949C717a4F7f05c7B003C612C437280C3513', lpFactory: '0xAEec7e7948FfDb7a212E14c0b9cc1DA2922436E4',
112
119
  comboFactory: '0x312c86F7139b3e3a75ee66b4D5Bfdbe5077584BD',
120
+ cappedFactory: null,
113
121
  },
114
122
  // 2026-10-31, pad block 139866088: the first 2.0 (creator fee, no graduation pick), no longer creating; its tokens trade
115
123
  // and claim here. Its modules from the same scripts as 1.0's (docs/TESTNET-GANGLAUNCHPAD2-2026-10-31.md)
@@ -118,6 +126,7 @@ export const GANG_GENS = {
118
126
  bond: '0x913966122b9f8CC00C0d81000988A483c6B7F97f', splitterFactory: '0xBc26A6585B3Dc2Cbf1522475fB5b18df6C1033AE',
119
127
  splitFactory: '0x860D51808E9FBB4f887FC7d0Aa9e1F8E19E00879', lpFactory: '0x4f1544e4e8853fC62088f0A4eCbEF409D2e11619',
120
128
  comboFactory: null, // none: its tokens can't have a combined recipient
129
+ cappedFactory: null,
121
130
  },
122
131
  // set 10 (2026-10-27: §23 aggregator entries). GangBond 2026-10-29, block 139463214 — the audited version (earlier:
123
132
  // 0x587f…5d7E, 0x5a99…d716, 0xB034…EBE3; docs/TESTNET-GANG-BOND-2026-10-28.md); split and LP factories
@@ -127,27 +136,29 @@ export const GANG_GENS = {
127
136
  bond: '0xd6a8dd5d1E6641a34A255f25Db2B3ED397CB1086', splitterFactory: '0x7E63fF8A9FB9Ab1BE4e2128e9f6C8D1054292BBe',
128
137
  splitFactory: '0x5F7dC7502E945A860Cf49cca72dA8bD60Fb1567E', lpFactory: '0xA729C60FCa0Bd0D28a55E22126D3fE412AA41591',
129
138
  comboFactory: '0x52a8f90a92E5C1828b4436a0B99C6b293f7F4CFE',
139
+ cappedFactory: null,
130
140
  },
131
141
  // 2026-11-01, pad block 140215635: 2.0 金库版, testnet v3 (docs/TESTNET-GANG-VAULT-LAUNCHPAD-2026-11-01.md)
132
142
  {
133
143
  gen: VAULT_GEN, pad: '0x9108e7b85e69060A5E626A04Ce6DEf323071C8a9', router: '0x9bF3E197a6719Af856a7c82d23CABFdBcc184f69',
134
- bond: null, splitterFactory: null, splitFactory: null, lpFactory: null, comboFactory: null,
144
+ bond: null, splitterFactory: null, splitFactory: null, lpFactory: null, comboFactory: null, cappedFactory: null,
135
145
  },
136
146
  ],
137
147
  }
138
148
  // 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)
139
- const GEN_FIELDS = ['gen', 'pad', 'router', 'bond', 'splitterFactory', 'splitFactory', 'lpFactory', 'comboFactory', 'promotePoolFactory']
149
+ const GEN_FIELDS = ['gen', 'pad', 'router', 'bond', 'splitterFactory', 'splitFactory', 'lpFactory', 'comboFactory', 'cappedFactory', 'promotePoolFactory']
140
150
  // the env names of each field, per network (new name first; the old per-command names still work as aliases)
141
151
  const GEN_ENV = {
142
152
  mainnet: {
143
153
  pad: ['GANG_PAD', 'GANG_V3_PAD', 'GANG_FAIR_PAD'], router: ['GANG_ROUTER'], bond: ['GANG_BOND'],
144
154
  splitterFactory: ['GANG_SPLITTER_FACTORY'], splitFactory: ['GANG_SPLIT_FACTORY'], lpFactory: ['GANG_LP_FACTORY'],
145
- comboFactory: ['GANG_COMBO_FACTORY'], promotePoolFactory: ['GANG_PROMOTE_POOL_FACTORY'],
155
+ comboFactory: ['GANG_COMBO_FACTORY'], cappedFactory: ['GANG_CAPPED_FACTORY'], promotePoolFactory: ['GANG_PROMOTE_POOL_FACTORY'],
146
156
  },
147
157
  testnet: {
148
158
  pad: ['GANG_TESTNET_PAD', 'GANG_V3_TESTNET_PAD', 'GANG_FAIR_TESTNET_PAD'], router: ['GANG_TESTNET_ROUTER', 'GANG_ROUTER_TESTNET'],
149
159
  bond: ['GANG_TESTNET_BOND'], splitterFactory: ['GANG_TESTNET_SPLITTER_FACTORY'], splitFactory: ['GANG_TESTNET_SPLIT_FACTORY'],
150
- lpFactory: ['GANG_TESTNET_LP_FACTORY'], comboFactory: ['GANG_TESTNET_COMBO_FACTORY'], promotePoolFactory: ['GANG_TESTNET_PROMOTE_POOL_FACTORY'],
160
+ lpFactory: ['GANG_TESTNET_LP_FACTORY'], comboFactory: ['GANG_TESTNET_COMBO_FACTORY'], cappedFactory: ['GANG_TESTNET_CAPPED_FACTORY'],
161
+ promotePoolFactory: ['GANG_TESTNET_PROMOTE_POOL_FACTORY'],
151
162
  },
152
163
  }
153
164
 
package/src/index.js CHANGED
@@ -25,8 +25,10 @@ import { runSplit, SPLIT_EVENT_ABIS } from './split.js'
25
25
  import { runPromote, PROMOTE_EVENT_ABIS } from './promote.js'
26
26
  import { runLp, LP_EVENT_ABIS } from './lp.js'
27
27
  import { runCombo, COMBO_EVENT_ABIS } from './combo.js'
28
+ import { runCapped, CAPPED_EVENT_ABIS } from './capped.js'
29
+ import { runWeekly } from './weekly.js'
28
30
  import { runFly, flyCtx, isFlyToken, FLY_EVENT_ABIS, FLY_CREATE_FLAGS } from './fly.js'
29
- import { FAIR_DEV_BUY, isLaunch, LAUNCH_FLAGS, runLaunch } from './launch.js'
31
+ import { FAIR_DEV_BUY, isLaunch, LAUNCH_FLAGS, runLaunch, TAX_CAP_ALONE } from './launch.js'
30
32
  import { poolPayBnb, poolTrade } from './pool.js'
31
33
  import { parseAmount, ROUTER_ABI, ROUTER_HINTS, revertOf as revertIn, step as writeStep } from './steps.js'
32
34
  import { MERGED_ERRORS_ABI, genOf, padNets } from './gangpad.js'
@@ -288,7 +290,8 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
288
290
  gang trending what other agents buy now: up to 5 tokens with the most distinct agent buyers in 6h,
289
291
  up to 3 followable notes by 60%+ authors (also carried by preflight and list as
290
292
  trending). Not a recommendation: never buy from it on your own. A wallet that never
291
- traded on Gang gets no 铸币飞轮 rows (firstTrade says so)
293
+ traded on Gang gets no 铸币飞轮 rows (firstTrade says so). During Gang's weekly launch
294
+ event its picks come first as events (an official event, not a recommendation)
292
295
  gang list [--limit 20] [--kind v3|fair|fly [--status …]]
293
296
  V2 / Soft / U / S tokens read on chain (works without gang.fun), the newest --limit
294
297
  per pad; --kind v3 (--status curve|graduated|all) / --kind fair
@@ -359,6 +362,19 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
359
362
  my invite link (https://gang.fun/start?ref=…[&token=…]) and how many new agents it
360
363
  brought (invited / qualified: traded again a day later within 7 days), this week and
361
364
  per token. The week's top token by qualified new agents is featured on gang.fun
365
+ gang weekly Gang's weekly launch event (gang.fun/weekly, 0.36.0+): the issue open for
366
+ applications, the current pick (launches Friday 20:00 UTC+8 on GangLaunchpad 3.0,
367
+ featured 7 days), past issues, and my applications. Attention only: no buy-back
368
+ gang weekly apply --name <name> --symbol <SYM> (--logo <file> | --logo-uri <gang.fun logo>) --description <text>
369
+ --contact <handle> [--twitter <@x|url>] [--telegram <@tg|url>] [--website <url>] [--modules lp,buyback,…]
370
+ [--issue <Friday date>] [--yes]
371
+ apply to be the week's pick with the token you will create. Without --yes: a preview,
372
+ nothing signed or sent. --yes uploads a local logo, signs the application with the
373
+ Agent wallet (EIP-712, no tx) and submits it; again while open = replace it. Only the
374
+ gang.fun team sees --contact. If picked: create it from this wallet with this symbol
375
+ at the launch time; selling more than 20% in the featured week ends the pin
376
+ gang weekly withdraw [--issue <date>] [--yes]
377
+ withdraw my application while applications are open (--yes signs and sends)
362
378
  gang upload-logo (--file <path> | --url <image URL>)
363
379
  copy an image to gang.fun → logoUrl (ipfs://<cid>, for --logo-uri) and url (CDN)
364
380
 
@@ -476,6 +492,28 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
476
492
  Steps: clone your combined recipient (GangComboSplitterFactory; listed in the same tx)
477
493
  → create → bind → the rest of the launch. Quote: WBNB (default), GANG or one listed
478
494
  in the pad's QuoteRegistry only
495
+ gang create … --buy-tax <1-5> --sell-tax <1-5> --tax-cap <amount> [--tax-cap-share <0.01-100>] [--split <addr>:<pct>[,…]]
496
+ [--after-cap buyback:<pct>,lp:<pct>] [--dev-buy …]
497
+ V3, taxed, capped recipient (GangCappedSplitter, capped-v1; 0.35.0+): --tax-cap-share %
498
+ (default 100) of the recipient's part goes to the --split payees (shares of that part,
499
+ adding up to 100; default: all to you) until they have been credited --tax-cap in all
500
+ (in the launch's quote, its own decimals: WBNB for a BNB launch, else --quote;
501
+ counted when split, pushed or owed alike; the split that crosses it pays exactly what
502
+ is left). The rest, and after the cap all of it, is bought back and burned / added
503
+ as liquidity (LP to 0xdead) as --after-cap says (parts adding up to 100; default
504
+ buyback:100), e.g. --tax-cap 20 --tax-cap-share 50 --split self:70,0xKol…:30
505
+ --after-cap buyback:70,lp:30. The preview shows the rough pool volume that reaches
506
+ the cap. The cap covers only this recipient's part of the pool tax: not your creator
507
+ fee (gang creator-fee), not your own tokens (you can still sell), not the holders'
508
+ dividend.
509
+ PERMANENT: the cap, its quote, the ratios, payees and shares can never change; a payee
510
+ can only move its own slot (gang capped set-payee). Any other asset sent to it goes
511
+ to 0xdead in full when distributed (one that can't be sent there stays in the
512
+ module). Not with --buyback / --lp / --buyback-to / --lp-to / --recipient;
513
+ with --promote the promoter share stays on the curve. Steps: clone your capped
514
+ recipient (GangCappedSplitterFactory; listed in the same tx) → create → bind → the
515
+ rest of the launch. Quote: WBNB (default), GANG or one listed in the pad's
516
+ QuoteRegistry only.
479
517
  gang create --fair … [--shares <n>] --bond <quote> [--bond-hold …] --bond-days <7-90>
480
518
  打新: create (the dev's --shares are bought in it) → bond. Progress is read from the
481
519
  chain (a token this wallet created with this symbol since the plan); a run that finds
@@ -666,12 +704,35 @@ COMBO (a V3 token whose recipient is a combined recipient, combo-v1; GANG_COMBO_
666
704
  CLI never sets a gas limit; let the wallet estimate it (a chunk ~0.55–0.75M; each
667
705
  payee push needs ~365k left before it, up to 10: a lower limit reverts PushStarved).
668
706
  --testnet, --calldata, --from as in gang v3
707
+ CAPPED (a V3 token whose recipient is a capped recipient, capped-v1, 0.35.0+; GANG_CAPPED_FACTORY / GANG_TESTNET_CAPPED_FACTORY):
708
+ gang capped status --token <addr> [--asset <addr>]
709
+ the cap (amount, quote, paid, left, progress %, reached), pay % until the cap, the
710
+ after-cap buy-back / LP split (all fixed for good), payees and shares, set aside for
711
+ buy-back (buybackLeft) and liquidity (lpLeft), not split yet (unsplit) and where it
712
+ would go, what each slot is owed, the next chunk, the keeper (planned action decoded
713
+ from previewWork), next commands, what the cap covers, and a warning when the module
714
+ is bound to another token than the one paying it
715
+ gang capped distribute --token <addr> [--asset <addr>|wbnb]
716
+ anyone, once bound: the bound quote (default) is split as the tax is (the payees'
717
+ part never above what is left of the cap); any other asset goes to 0xdead in full
718
+ (BURNED, paid to nobody; one that can't be sent there stays in the module)
719
+ gang capped release --token <addr> [--index <i>] [--max <amount>]
720
+ anyone: push a slot what a failed push left owed (bound quote only; --index = the
721
+ contract's 0-based slot, default your own slot or the only one owed)
722
+ gang capped set-payee --token <addr> --to <addr> [--index <i>]
723
+ only the slot's current payee (--index default: your wallet's slot): moves the slot
724
+ to --to at once; the share and the cap stay
725
+ gang capped bind --token <addr> anyone: bind the module to its token (the launch does it; the token's quote must be
726
+ the cap's)
727
+ gang capped chunk --token <addr> [--slippage 1]
728
+ anyone: one chunk now, as gang combo chunk. --module <addr> instead of --token names
729
+ a module directly (not for bind). Gas, --testnet, --calldata, --from as gang combo
669
730
  gang execute --request-id <id> broadcast a previewed call
670
731
  gang tx --pending a trade that waited for Binance App approval (execute: pendingConfirmation): find its tx
671
732
  in the wallet's history by the exact call previewed, then as gang tx --hash below
672
733
  gang tx --hash <0x..> [--testnet] wait for receipt and decode Gang events: V2 / Soft / U / S, GangLaunchpad (V3 /
673
734
  打新, 铸币飞轮, tax routers, vaults), GangFlywheelPad (铸币飞轮 pads), split modules,
674
- LP splitters and combined recipients (publishes a queued --note; mainnet). GangLaunchpad events
735
+ LP splitters, combined and capped recipients (publishes a queued --note; mainnet). GangLaunchpad events
675
736
  carry units: "raw" (amounts in wei, 18 decimals; bps / shares as is)
676
737
 
677
738
  --note is PUBLIC: shown on gang.fun next to the trade. Its hash goes into the tx calldata, so it is provably written
@@ -1213,7 +1274,7 @@ function alias(kind, sub) {
1213
1274
 
1214
1275
  // 铸币飞轮 settings beyond those it shares with 打新 (--raise / --hold / --mint-fee / --exit-fee) and V3 (--sell-tax)
1215
1276
  const FLY_ONLY_FLAGS = FLY_CREATE_FLAGS.filter((f) => !['raise', 'hold', 'mint-fee', 'exit-fee', 'sell-tax'].includes(f))
1216
- 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>'
1277
+ const FLY_NO_BOND = '铸币飞轮 tokens take no GangBond, buy-back splitter, split module, LP splitter, combined recipient, capped recipient or --dev-buy (phase 1): the creator mints its shares in the create with --dev-shares <n>'
1217
1278
  /** The flags a 铸币飞轮 create refuses (gang create --fly and gang fly create alike). */
1218
1279
  function checkFlyCreate() {
1219
1280
  if (flag('fair')) fail('give --fly (铸币飞轮) or --fair (打新), not both')
@@ -1226,7 +1287,7 @@ function checkFlyCreate() {
1226
1287
  : `--${wrong} is a V3 tax setting; a 铸币飞轮 token's tax goes to holders, the platform and the creator in fixed parts`)
1227
1288
  }
1228
1289
  }
1229
- const VAULT_ALONE = 'a --vault create stands alone: no chained dev buy, GangBond or buy-back / split / LP / combined recipient (the 2.0 金库版 pad has none of them); a dev buy is its own gang buy after the create lands'
1290
+ const VAULT_ALONE = 'a --vault create stands alone: no chained dev buy, GangBond or buy-back / split / LP / combined / capped recipient (the 2.0 金库版 pad has none of them); a dev buy is its own gang buy after the create lands'
1230
1291
  // --grad picks a V3 curve's graduation target (2.0 / 3.0); a 打新 / 铸币飞轮 sale ends at its own --raise
1231
1292
  const GRAD_ONLY_V3 = (what) => `--grad is a V3 curve setting (the graduation target, 2.0 / 3.0): ${what} fills at its --raise instead, so leave --grad out`
1232
1293
  function create() {
@@ -1244,7 +1305,7 @@ function create() {
1244
1305
  return runFair('create', { ...PAD_IO, notes: padNotes('fair', 'create') })
1245
1306
  }
1246
1307
  const wrong = FAIR_CREATE_FLAGS.find(flag)
1247
- if (wrong) fail(`--${wrong} is a 打新 (fair-mint) setting: add --fair to create a sale (gang create --fair …)`)
1308
+ if (wrong) fail(`--${wrong} is a 打新 (fair-mint) setting: add --fair to create a sale (gang create --fair …)`, wrong === 'cap' ? { hint: 'to cap what the payees take from a V3 token\'s tax, use --tax-cap <amount> (a capped recipient)' } : {})
1248
1309
  if (isLaunch('v3', flag, opt)) return runLaunch('v3', LAUNCH_DEPS)
1249
1310
  return runV3('create', { ...PAD_IO, notes: padNotes('v3', 'create') })
1250
1311
  }
@@ -1258,13 +1319,13 @@ const PREFLIGHT_NEXT = [
1258
1319
  'a first buy can be small: gang buy --token <addr> --amount 0.01 previews it, nothing is sent before gang execute',
1259
1320
  ]
1260
1321
  // commands whose JSON result carries `update`; `watch` streams NDJSON and help is plain text
1261
- const UPDATE_CHECKED = new Set(['version', '--version', '-v', 'preflight', 'list', 'trending', 'invite', 'hot', 'new', 'near-grad', 'notes', 'agents', 'token', 'info', 'status', 'portfolio', 'quote',
1322
+ const UPDATE_CHECKED = new Set(['version', '--version', '-v', 'preflight', 'list', 'trending', 'invite', 'weekly', 'hot', 'new', 'near-grad', 'notes', 'agents', 'token', 'info', 'status', 'portfolio', 'quote',
1262
1323
  'buy', 'follow', 'sell', 'claim', 'mint', 'withdraw', 'release', 'upload-logo', 'create', 'execute', 'tx', 'fair', 'v3', 'bond',
1263
- 'buyback', 'split', 'lp', 'combo', 'fly', 'creator-fee', 'promote'])
1324
+ 'buyback', 'split', 'lp', 'combo', 'capped', 'fly', 'creator-fee', 'promote'])
1264
1325
  // gang tx decodes these beside the V2 / Soft / U / S pads' events (GangLaunchpad: both kinds; the tax router; the vaults)
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]
1326
+ const GANG_EVENT_ABIS = [...V3_EVENT_ABIS, ...FAIR_EVENT_ABIS, ...FLY_EVENT_ABIS, ...SPLIT_EVENT_ABIS, ...LP_EVENT_ABIS, ...COMBO_EVENT_ABIS, ...CAPPED_EVENT_ABIS, ...PROMOTE_EVENT_ABIS]
1266
1327
 
1267
- /** gang bond / gang buyback / gang split / gang lp / gang combo on a 铸币飞轮 token: those contracts refuse it, so say why before any step. */
1328
+ /** gang bond / gang buyback / gang split / gang lp / gang combo / gang capped on a 铸币飞轮 token: those contracts refuse it, so say why before any step. */
1268
1329
  async function refuseFly(what) {
1269
1330
  const token = opt('token')
1270
1331
  if (!isAddress(token ?? '')) return
@@ -1357,10 +1418,12 @@ async function main() {
1357
1418
  const launch = LAUNCH_FLAGS.find((f) => flag(f))
1358
1419
  if (launch) fail(`--${launch}: ${VAULT_ALONE}`)
1359
1420
  }
1421
+ // gang weekly apply takes the same --description / --website / --twitter as a create (they describe the token to come)
1422
+ const weeklyApply = cmd === 'weekly' && args[1] === 'apply'
1360
1423
  for (const name of LINK_FLAGS) {
1361
- if (!tokenCreate && flag(name)) fail(`--${name} only applies when creating a token (\`gang create\`, \`gang create --fair\`, \`gang create --fly\`)`)
1424
+ if (!tokenCreate && !weeklyApply && flag(name)) fail(`--${name} only applies when creating a token (\`gang create\`, \`gang create --fair\`, \`gang create --fly\`)`)
1362
1425
  }
1363
- if (flag('description') && !tokenCreate) {
1426
+ if (flag('description') && !tokenCreate && !weeklyApply) {
1364
1427
  fail('--description only applies when creating a token (`gang create`, `gang create --fair` / `--fly`; it goes into the token metadata)')
1365
1428
  }
1366
1429
  // --bond-hold / --bond-days / --restart only mean something in a chained launch (--dev-buy / --bond); never drop them silently
@@ -1369,8 +1432,11 @@ async function main() {
1369
1432
  if (tokenCreate && !flyCreate && !isLaunch(launchKind, flag, opt)) {
1370
1433
  // a 打新 dev buys with --shares in the create itself: say so here, not "add --bond" (which would only lead to that)
1371
1434
  if (launchKind === 'fair' && flag('dev-buy')) fail(FAIR_DEV_BUY)
1435
+ const capFlag = ['tax-cap', 'tax-cap-share', 'after-cap'].find((f) => flag(f))
1436
+ if (capFlag && launchKind === 'fair') fail(`--${capFlag} is for V3 tokens: it makes the tax recipient a capped recipient, and a 打新 token has no recipient`)
1437
+ if (capFlag) fail(TAX_CAP_ALONE)
1372
1438
  const lone = LAUNCH_FLAGS.find((f) => flag(f))
1373
- if (lone) fail(`--${lone} only applies to a launch in one command: add --bond <quote>${launchKind === 'fair' ? '' : ' (or --dev-buy <quote> / --buyback <pct> / --split <addr>:<pct>,… / --lp <pct>)'}`)
1439
+ if (lone) fail(`--${lone} only applies to a launch in one command: add --bond <quote>${launchKind === 'fair' ? '' : ' (or --dev-buy <quote> / --buyback <pct> / --split <addr>:<pct>,… / --lp <pct> / --tax-cap <amount>)'}`)
1374
1440
  }
1375
1441
  switch (cmd) {
1376
1442
  case 'fair':
@@ -1411,6 +1477,11 @@ async function main() {
1411
1477
  case 'combo':
1412
1478
  await refuseFly('a combined recipient')
1413
1479
  return runCombo(args[1], { opt, flag, out, fail, summarize: summarizePreview })
1480
+ case 'capped':
1481
+ await refuseFly('a capped recipient')
1482
+ return runCapped(args[1], { opt, flag, out, fail, summarize: summarizePreview })
1483
+ case 'weekly':
1484
+ return runWeekly(args[1], { opt, flag, out, fail, resolveLogo: resolveLogoUri })
1414
1485
  case 'capabilities':
1415
1486
  return out((await import('./capabilities.js')).capabilities())
1416
1487
  case 'version':
@@ -1483,9 +1554,9 @@ async function main() {
1483
1554
  const t = await trending({ wallet: myAddress() })
1484
1555
  if (!t) fail(`gang.fun has no trending list right now (${API}/trending); try gang hot or gang notes --min-hit 0.6`, { retry: true })
1485
1556
  return out({
1486
- success: true, at: t.at ? localTime(t.at) : null, tokens: t.tokens, calls: t.calls, note: TRENDING_NOTE,
1557
+ success: true, at: t.at ? localTime(t.at) : null, ...(t.events && { events: t.events }), tokens: t.tokens, calls: t.calls, note: TRENDING_NOTE,
1487
1558
  ...(t.firstTrade && { firstTrade: t.firstTrade }),
1488
- ...(!t.tokens.length && !t.calls.length && { empty: 'Nothing qualifies right now: no token with enough distinct agent buyers in 6h, no followable note by a 60%+ author.' }),
1559
+ ...(!t.tokens.length && !t.calls.length && !t.events && { empty: 'Nothing qualifies right now: no token with enough distinct agent buyers in 6h, no followable note by a 60%+ author.' }),
1489
1560
  })
1490
1561
  }
1491
1562
  case 'hot':