@gangfun/cli 0.34.0 → 0.35.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 +6 -1
- package/README.zh-CN.md +5 -0
- package/package.json +1 -1
- package/src/capabilities.js +4 -0
- package/src/capped.js +717 -0
- package/src/combo.js +1 -1
- package/src/creatorfee.js +25 -8
- package/src/gangpad.js +16 -5
- package/src/index.js +61 -9
- package/src/launch.js +193 -20
- package/src/mcp.js +4 -4
- package/src/promote.js +3 -3
- package/src/telemetry.js +1 -1
- package/src/v3.js +6 -0
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.
|
|
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
|
-
|
|
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'],
|
|
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,9 @@ 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'
|
|
28
29
|
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'
|
|
30
|
+
import { FAIR_DEV_BUY, isLaunch, LAUNCH_FLAGS, runLaunch, TAX_CAP_ALONE } from './launch.js'
|
|
30
31
|
import { poolPayBnb, poolTrade } from './pool.js'
|
|
31
32
|
import { parseAmount, ROUTER_ABI, ROUTER_HINTS, revertOf as revertIn, step as writeStep } from './steps.js'
|
|
32
33
|
import { MERGED_ERRORS_ABI, genOf, padNets } from './gangpad.js'
|
|
@@ -476,6 +477,28 @@ U / S pads) and run that kind's trade. Results of V3 / 打新 / 铸币飞轮 tok
|
|
|
476
477
|
Steps: clone your combined recipient (GangComboSplitterFactory; listed in the same tx)
|
|
477
478
|
→ create → bind → the rest of the launch. Quote: WBNB (default), GANG or one listed
|
|
478
479
|
in the pad's QuoteRegistry only
|
|
480
|
+
gang create … --buy-tax <1-5> --sell-tax <1-5> --tax-cap <amount> [--tax-cap-share <0.01-100>] [--split <addr>:<pct>[,…]]
|
|
481
|
+
[--after-cap buyback:<pct>,lp:<pct>] [--dev-buy …]
|
|
482
|
+
V3, taxed, capped recipient (GangCappedSplitter, capped-v1; 0.35.0+): --tax-cap-share %
|
|
483
|
+
(default 100) of the recipient's part goes to the --split payees (shares of that part,
|
|
484
|
+
adding up to 100; default: all to you) until they have been credited --tax-cap in all
|
|
485
|
+
(in the launch's quote, its own decimals: WBNB for a BNB launch, else --quote;
|
|
486
|
+
counted when split, pushed or owed alike; the split that crosses it pays exactly what
|
|
487
|
+
is left). The rest, and after the cap all of it, is bought back and burned / added
|
|
488
|
+
as liquidity (LP to 0xdead) as --after-cap says (parts adding up to 100; default
|
|
489
|
+
buyback:100), e.g. --tax-cap 20 --tax-cap-share 50 --split self:70,0xKol…:30
|
|
490
|
+
--after-cap buyback:70,lp:30. The preview shows the rough pool volume that reaches
|
|
491
|
+
the cap. The cap covers only this recipient's part of the pool tax: not your creator
|
|
492
|
+
fee (gang creator-fee), not your own tokens (you can still sell), not the holders'
|
|
493
|
+
dividend.
|
|
494
|
+
PERMANENT: the cap, its quote, the ratios, payees and shares can never change; a payee
|
|
495
|
+
can only move its own slot (gang capped set-payee). Any other asset sent to it goes
|
|
496
|
+
to 0xdead in full when distributed (one that can't be sent there stays in the
|
|
497
|
+
module). Not with --buyback / --lp / --buyback-to / --lp-to / --recipient;
|
|
498
|
+
with --promote the promoter share stays on the curve. Steps: clone your capped
|
|
499
|
+
recipient (GangCappedSplitterFactory; listed in the same tx) → create → bind → the
|
|
500
|
+
rest of the launch. Quote: WBNB (default), GANG or one listed in the pad's
|
|
501
|
+
QuoteRegistry only.
|
|
479
502
|
gang create --fair … [--shares <n>] --bond <quote> [--bond-hold …] --bond-days <7-90>
|
|
480
503
|
打新: create (the dev's --shares are bought in it) → bond. Progress is read from the
|
|
481
504
|
chain (a token this wallet created with this symbol since the plan); a run that finds
|
|
@@ -666,12 +689,35 @@ COMBO (a V3 token whose recipient is a combined recipient, combo-v1; GANG_COMBO_
|
|
|
666
689
|
CLI never sets a gas limit; let the wallet estimate it (a chunk ~0.55–0.75M; each
|
|
667
690
|
payee push needs ~365k left before it, up to 10: a lower limit reverts PushStarved).
|
|
668
691
|
--testnet, --calldata, --from as in gang v3
|
|
692
|
+
CAPPED (a V3 token whose recipient is a capped recipient, capped-v1, 0.35.0+; GANG_CAPPED_FACTORY / GANG_TESTNET_CAPPED_FACTORY):
|
|
693
|
+
gang capped status --token <addr> [--asset <addr>]
|
|
694
|
+
the cap (amount, quote, paid, left, progress %, reached), pay % until the cap, the
|
|
695
|
+
after-cap buy-back / LP split (all fixed for good), payees and shares, set aside for
|
|
696
|
+
buy-back (buybackLeft) and liquidity (lpLeft), not split yet (unsplit) and where it
|
|
697
|
+
would go, what each slot is owed, the next chunk, the keeper (planned action decoded
|
|
698
|
+
from previewWork), next commands, what the cap covers, and a warning when the module
|
|
699
|
+
is bound to another token than the one paying it
|
|
700
|
+
gang capped distribute --token <addr> [--asset <addr>|wbnb]
|
|
701
|
+
anyone, once bound: the bound quote (default) is split as the tax is (the payees'
|
|
702
|
+
part never above what is left of the cap); any other asset goes to 0xdead in full
|
|
703
|
+
(BURNED, paid to nobody; one that can't be sent there stays in the module)
|
|
704
|
+
gang capped release --token <addr> [--index <i>] [--max <amount>]
|
|
705
|
+
anyone: push a slot what a failed push left owed (bound quote only; --index = the
|
|
706
|
+
contract's 0-based slot, default your own slot or the only one owed)
|
|
707
|
+
gang capped set-payee --token <addr> --to <addr> [--index <i>]
|
|
708
|
+
only the slot's current payee (--index default: your wallet's slot): moves the slot
|
|
709
|
+
to --to at once; the share and the cap stay
|
|
710
|
+
gang capped bind --token <addr> anyone: bind the module to its token (the launch does it; the token's quote must be
|
|
711
|
+
the cap's)
|
|
712
|
+
gang capped chunk --token <addr> [--slippage 1]
|
|
713
|
+
anyone: one chunk now, as gang combo chunk. --module <addr> instead of --token names
|
|
714
|
+
a module directly (not for bind). Gas, --testnet, --calldata, --from as gang combo
|
|
669
715
|
gang execute --request-id <id> broadcast a previewed call
|
|
670
716
|
gang tx --pending a trade that waited for Binance App approval (execute: pendingConfirmation): find its tx
|
|
671
717
|
in the wallet's history by the exact call previewed, then as gang tx --hash below
|
|
672
718
|
gang tx --hash <0x..> [--testnet] wait for receipt and decode Gang events: V2 / Soft / U / S, GangLaunchpad (V3 /
|
|
673
719
|
打新, 铸币飞轮, tax routers, vaults), GangFlywheelPad (铸币飞轮 pads), split modules,
|
|
674
|
-
LP splitters and
|
|
720
|
+
LP splitters, combined and capped recipients (publishes a queued --note; mainnet). GangLaunchpad events
|
|
675
721
|
carry units: "raw" (amounts in wei, 18 decimals; bps / shares as is)
|
|
676
722
|
|
|
677
723
|
--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 +1259,7 @@ function alias(kind, sub) {
|
|
|
1213
1259
|
|
|
1214
1260
|
// 铸币飞轮 settings beyond those it shares with 打新 (--raise / --hold / --mint-fee / --exit-fee) and V3 (--sell-tax)
|
|
1215
1261
|
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>'
|
|
1262
|
+
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
1263
|
/** The flags a 铸币飞轮 create refuses (gang create --fly and gang fly create alike). */
|
|
1218
1264
|
function checkFlyCreate() {
|
|
1219
1265
|
if (flag('fair')) fail('give --fly (铸币飞轮) or --fair (打新), not both')
|
|
@@ -1226,7 +1272,7 @@ function checkFlyCreate() {
|
|
|
1226
1272
|
: `--${wrong} is a V3 tax setting; a 铸币飞轮 token's tax goes to holders, the platform and the creator in fixed parts`)
|
|
1227
1273
|
}
|
|
1228
1274
|
}
|
|
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'
|
|
1275
|
+
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
1276
|
// --grad picks a V3 curve's graduation target (2.0 / 3.0); a 打新 / 铸币飞轮 sale ends at its own --raise
|
|
1231
1277
|
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
1278
|
function create() {
|
|
@@ -1244,7 +1290,7 @@ function create() {
|
|
|
1244
1290
|
return runFair('create', { ...PAD_IO, notes: padNotes('fair', 'create') })
|
|
1245
1291
|
}
|
|
1246
1292
|
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 …)
|
|
1293
|
+
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
1294
|
if (isLaunch('v3', flag, opt)) return runLaunch('v3', LAUNCH_DEPS)
|
|
1249
1295
|
return runV3('create', { ...PAD_IO, notes: padNotes('v3', 'create') })
|
|
1250
1296
|
}
|
|
@@ -1260,11 +1306,11 @@ const PREFLIGHT_NEXT = [
|
|
|
1260
1306
|
// commands whose JSON result carries `update`; `watch` streams NDJSON and help is plain text
|
|
1261
1307
|
const UPDATE_CHECKED = new Set(['version', '--version', '-v', 'preflight', 'list', 'trending', 'invite', 'hot', 'new', 'near-grad', 'notes', 'agents', 'token', 'info', 'status', 'portfolio', 'quote',
|
|
1262
1308
|
'buy', 'follow', 'sell', 'claim', 'mint', 'withdraw', 'release', 'upload-logo', 'create', 'execute', 'tx', 'fair', 'v3', 'bond',
|
|
1263
|
-
'buyback', 'split', 'lp', 'combo', 'fly', 'creator-fee', 'promote'])
|
|
1309
|
+
'buyback', 'split', 'lp', 'combo', 'capped', 'fly', 'creator-fee', 'promote'])
|
|
1264
1310
|
// 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]
|
|
1311
|
+
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
1312
|
|
|
1267
|
-
/** gang bond / gang buyback / gang split / gang lp / gang combo on a 铸币飞轮 token: those contracts refuse it, so say why before any step. */
|
|
1313
|
+
/** 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
1314
|
async function refuseFly(what) {
|
|
1269
1315
|
const token = opt('token')
|
|
1270
1316
|
if (!isAddress(token ?? '')) return
|
|
@@ -1369,8 +1415,11 @@ async function main() {
|
|
|
1369
1415
|
if (tokenCreate && !flyCreate && !isLaunch(launchKind, flag, opt)) {
|
|
1370
1416
|
// a 打新 dev buys with --shares in the create itself: say so here, not "add --bond" (which would only lead to that)
|
|
1371
1417
|
if (launchKind === 'fair' && flag('dev-buy')) fail(FAIR_DEV_BUY)
|
|
1418
|
+
const capFlag = ['tax-cap', 'tax-cap-share', 'after-cap'].find((f) => flag(f))
|
|
1419
|
+
if (capFlag && launchKind === 'fair') fail(`--${capFlag} is for V3 tokens: it makes the tax recipient a capped recipient, and a 打新 token has no recipient`)
|
|
1420
|
+
if (capFlag) fail(TAX_CAP_ALONE)
|
|
1372
1421
|
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>)'}`)
|
|
1422
|
+
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
1423
|
}
|
|
1375
1424
|
switch (cmd) {
|
|
1376
1425
|
case 'fair':
|
|
@@ -1411,6 +1460,9 @@ async function main() {
|
|
|
1411
1460
|
case 'combo':
|
|
1412
1461
|
await refuseFly('a combined recipient')
|
|
1413
1462
|
return runCombo(args[1], { opt, flag, out, fail, summarize: summarizePreview })
|
|
1463
|
+
case 'capped':
|
|
1464
|
+
await refuseFly('a capped recipient')
|
|
1465
|
+
return runCapped(args[1], { opt, flag, out, fail, summarize: summarizePreview })
|
|
1414
1466
|
case 'capabilities':
|
|
1415
1467
|
return out((await import('./capabilities.js')).capabilities())
|
|
1416
1468
|
case 'version':
|