liqproof 0.0.0-stage → 0.1.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/LICENSE +21 -0
- package/README.md +536 -2
- package/bugs/README.md +144 -0
- package/bugs/coin-gecko-liquidity-report.md +283 -0
- package/bugs/collect-ds-aggregate.mjs +213 -0
- package/bugs/collect-evidence.mjs +458 -0
- package/bugs/collect-gt-aggregate.mjs +215 -0
- package/bugs/collect-raw-rpc.mjs +165 -0
- package/bugs/collect-sweep-context.mjs +162 -0
- package/bugs/dexscreener-fake-liquidity-report.md +310 -0
- package/bugs/evidence/aggregator-liquidity-claims.json +648 -0
- package/bugs/evidence/aggregator-liquidity-claims.md +103 -0
- package/bugs/evidence/bat-native-pool-drained.json +136 -0
- package/bugs/evidence/bat-native-pool-drained.md +51 -0
- package/bugs/evidence/chz-impersonator-pool-drained.json +136 -0
- package/bugs/evidence/chz-impersonator-pool-drained.md +51 -0
- package/bugs/evidence/gt-stale-reserve-after-drain.json +141 -0
- package/bugs/evidence/gt-stale-reserve-after-drain.md +31 -0
- package/bugs/evidence/raw-rpc-transcript.json +683 -0
- package/bugs/evidence/raw-rpc-transcript.md +308 -0
- package/bugs/evidence/sweep-context.json +325 -0
- package/bugs/evidence/sweep-context.md +55 -0
- package/bugs/evidence/verified-aggregate.json +526 -0
- package/bugs/evidence/verified-aggregate.md +24 -0
- package/bugs/evidence/verified-ds-liquidity-usd.json +1197 -0
- package/bugs/evidence/verified-ds-liquidity-usd.md +250 -0
- package/bugs/evidence/verified-gt-reserve-in-usd.json +1002 -0
- package/bugs/evidence/verified-gt-reserve-in-usd.md +218 -0
- package/bugs/fix-bundle-titles.mjs +72 -0
- package/bugs/geckoterminal-stale-reserve-after-drain.md +137 -0
- package/data/dataset-summary.md +103 -0
- package/data/impersonators.json +12888 -0
- package/data/verified-impersonators.json +725 -0
- package/data/wallets.json +23 -0
- package/dist/base58.js +70 -0
- package/dist/base58.js.map +1 -0
- package/dist/canonical.js +372 -0
- package/dist/canonical.js.map +1 -0
- package/dist/cli.js +830 -0
- package/dist/cli.js.map +1 -0
- package/dist/curve.js +255 -0
- package/dist/curve.js.map +1 -0
- package/dist/dashboard.js +485 -0
- package/dist/dashboard.js.map +1 -0
- package/dist/keccak.js +197 -0
- package/dist/keccak.js.map +1 -0
- package/dist/mcp.js +604 -0
- package/dist/mcp.js.map +1 -0
- package/dist/operator.js +180 -0
- package/dist/operator.js.map +1 -0
- package/dist/pda.js +86 -0
- package/dist/pda.js.map +1 -0
- package/dist/receipt.js +897 -0
- package/dist/receipt.js.map +1 -0
- package/dist/render.js +335 -0
- package/dist/render.js.map +1 -0
- package/dist/rpc.js +377 -0
- package/dist/rpc.js.map +1 -0
- package/dist/sources.js +599 -0
- package/dist/sources.js.map +1 -0
- package/dist/store.js +330 -0
- package/dist/store.js.map +1 -0
- package/dist/tokenmeta.js +424 -0
- package/dist/tokenmeta.js.map +1 -0
- package/dist/util.js +273 -0
- package/dist/util.js.map +1 -0
- package/dist/vaults.js +510 -0
- package/dist/vaults.js.map +1 -0
- package/dist/wallet.js +404 -0
- package/dist/wallet.js.map +1 -0
- package/dist/warnings.js +41 -0
- package/dist/warnings.js.map +1 -0
- package/dist/worker.js +857 -0
- package/dist/worker.js.map +1 -0
- package/dist/x402.js +549 -0
- package/dist/x402.js.map +1 -0
- package/docs/HACKATHON-SUBMISSION.md +264 -0
- package/docs/liqproof-plan.md +221 -0
- package/docs/llms.txt +32 -0
- package/docs/mcp-registry.md +165 -0
- package/docs/screenshots/01-dashboard.png +0 -0
- package/docs/screenshots/02-receipt-drained.png +0 -0
- package/docs/screenshots/03-receipt-impersonator.png +0 -0
- package/docs/screenshots/04-receipt-canonical.png +0 -0
- package/docs/x402-pricing.md +171 -0
- package/docs/zero-xyz.md +250 -0
- package/out/6eftxVbSAunVEoxUWdGhPdxg5UdsJ8Wkwy5w5YFuxouw.json +1171 -0
- package/out/6eftxVbSAunVEoxUWdGhPdxg5UdsJ8Wkwy5w5YFuxouw.md +52 -0
- package/out/6eftxVbSAunVEoxUWdGhPdxg5UdsJ8Wkwy5w5YFuxouw.svg +25 -0
- package/out/BTNiaZb6HaEFWeEtND4SXtZ7T6mgtDwSryHTAj6PuPyp.json +3975 -0
- package/out/BTNiaZb6HaEFWeEtND4SXtZ7T6mgtDwSryHTAj6PuPyp.md +90 -0
- package/out/BTNiaZb6HaEFWeEtND4SXtZ7T6mgtDwSryHTAj6PuPyp.svg +25 -0
- package/out/ENGkoidj2jNs73A7GZuseVmnkRg6EVF9tDtViwPz8o85.json +1446 -0
- package/out/ENGkoidj2jNs73A7GZuseVmnkRg6EVF9tDtViwPz8o85.md +66 -0
- package/out/ENGkoidj2jNs73A7GZuseVmnkRg6EVF9tDtViwPz8o85.svg +25 -0
- package/out/dataset.csv +67 -0
- package/out/impersonation-table.md +156 -0
- package/out/index.html +1179 -0
- package/package.json +78 -4
- package/scripts/assert-no-canonical-accusations.mjs +193 -0
- package/scripts/backfill.mjs +1063 -0
- package/scripts/bundle-evidence.mjs +237 -0
- package/scripts/bundle-stale-claim.mjs +417 -0
- package/scripts/capture-bch-evidence.mjs +58 -0
- package/scripts/check-orientation-fix.mjs +40 -0
- package/scripts/check-wallet.mjs +54 -0
- package/scripts/daily-refresh.mjs +451 -0
- package/scripts/decode-clmm-vaults.mjs +180 -0
- package/scripts/falsifiability.mjs +263 -0
- package/scripts/impersonator-mining.mjs +156 -0
- package/scripts/inspect-matches.mjs +73 -0
- package/scripts/operator-sweep.mjs +252 -0
- package/scripts/publish-release.mjs +248 -0
- package/scripts/refresh-store.mjs +78 -0
- package/scripts/survival-miner.mjs +951 -0
- package/scripts/test-keccak.mjs +103 -0
- package/scripts/verify-bch-1p95b.mjs +124 -0
- package/scripts/verify-clmm-1p95b.mjs +127 -0
- package/scripts/verify-clmm-control.mjs +84 -0
- package/scripts/verify-impersonators.mjs +138 -0
- package/scripts/verify-raw.mjs +110 -0
- package/scripts/verify-raw2.mjs +99 -0
- package/server.json +34 -0
- package/src/base58.ts +68 -0
- package/src/canonical.ts +447 -0
- package/src/cli.ts +941 -0
- package/src/curve.ts +349 -0
- package/src/dashboard.ts +504 -0
- package/src/keccak.ts +228 -0
- package/src/mcp.ts +735 -0
- package/src/operator.ts +219 -0
- package/src/receipt.ts +1219 -0
- package/src/render.ts +396 -0
- package/src/rpc.ts +435 -0
- package/src/sources.ts +714 -0
- package/src/store.ts +428 -0
- package/src/tokenmeta.ts +460 -0
- package/src/util.ts +276 -0
- package/src/vaults.ts +574 -0
- package/src/wallet.ts +459 -0
- package/src/warnings.ts +40 -0
- package/src/worker.ts +1086 -0
- package/src/x402.ts +717 -0
package/src/operator.ts
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* operator.ts — link tokens to the wallet that deployed them.
|
|
3
|
+
*
|
|
4
|
+
* ── WHAT THIS IS, AND WHAT IT IS NOT ───────────────────────────────────────
|
|
5
|
+
*
|
|
6
|
+
* Metaplex metadata records who created a token: a list of creator wallets
|
|
7
|
+
* with a share and a "verified" flag. For an honest project that list is
|
|
8
|
+
* whatever the team decided. But when the SAME creator wallet appears on
|
|
9
|
+
* many tokens, the list stops being a credit and becomes a lineage.
|
|
10
|
+
*
|
|
11
|
+
* We scanned 9,053 Solana mints and found 212 creator clusters. The largest
|
|
12
|
+
* ones look like this:
|
|
13
|
+
*
|
|
14
|
+
* JARrYgBJt2bL… 1,243 tokens Aave, Arcium, AgriDex, Access Protocol…
|
|
15
|
+
* 7jMmecogKC9… 531 tokens BAT impostor, "Litecoin" impostor,…
|
|
16
|
+
* 7jMmrEsTS6… 141 tokens AC Milan, Arsenal FC, Atlético Madrid…
|
|
17
|
+
*
|
|
18
|
+
* ── THE HONEST READING ─────────────────────────────────────────────────────
|
|
19
|
+
*
|
|
20
|
+
* The first and third rows are LEGITIMATE. A token launchpad deploys
|
|
21
|
+
* hundreds of tokens with one creator wallet; a bridge sets itself as
|
|
22
|
+
* creator; Chiliz issues football-club fan tokens from a single deployer.
|
|
23
|
+
* In the 9,053-mint sweep, the "Aave" token in the JARrYg cluster, the
|
|
24
|
+
* "Arcium" token and the "AgriDex" token are three unrelated, real
|
|
25
|
+
* projects sharing one creator.
|
|
26
|
+
*
|
|
27
|
+
* **A shared creator wallet is therefore NOT evidence of a fraud ring.** We
|
|
28
|
+
* measured this and we were about to publish the opposite. Any tool that
|
|
29
|
+
* claims otherwise would be crying wolf on every launchpad in the market.
|
|
30
|
+
*
|
|
31
|
+
* So this module NEVER makes an accusation. It produces a LINEAGE: "this
|
|
32
|
+
* token was deployed by the same wallet as these N other tokens". The
|
|
33
|
+
* accusation, when there is one, comes from the canonical resolver
|
|
34
|
+
* (src/canonical.ts) — which cites the genuine mint — combined with the
|
|
35
|
+
* on-chain liquidity evidence (src/receipt.ts). The lineage only ever
|
|
36
|
+
* says: these tokens share a deployer.
|
|
37
|
+
*
|
|
38
|
+
* The combination is what is strong. "This mint claims to be Chiliz, and
|
|
39
|
+
* here is Chiliz's official mint from their own documentation" is a proof.
|
|
40
|
+
* "This mint claims to be Chiliz, the official Chiliz mint is X, and both
|
|
41
|
+
* were deployed by wallet W" is a proof plus an attribution — and the
|
|
42
|
+
* attribution is what turns a list of tokens into a case.
|
|
43
|
+
*
|
|
44
|
+
* ── REPRODUCIBILITY ─────────────────────────────────────────────────────────
|
|
45
|
+
*
|
|
46
|
+
* The registry this module reads is generated by `scripts/operator-sweep.mjs`
|
|
47
|
+
* and is reproducible: same universe → same clusters → same file.
|
|
48
|
+
*/
|
|
49
|
+
|
|
50
|
+
import { readFileSync } from 'node:fs';
|
|
51
|
+
import { join } from 'node:path';
|
|
52
|
+
|
|
53
|
+
export interface OperatorMember {
|
|
54
|
+
mint: string;
|
|
55
|
+
name?: string;
|
|
56
|
+
symbol?: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface OperatorCluster {
|
|
60
|
+
/** stable id, e.g. "creator:7jMmecogKC9…" or "prefix:7jMmec" */
|
|
61
|
+
id: string;
|
|
62
|
+
/** the shared creator wallet (exact clusters only) */
|
|
63
|
+
creator?: string;
|
|
64
|
+
/** the shared vanity prefix (prefix clusters only) */
|
|
65
|
+
prefix?: string;
|
|
66
|
+
kind: 'identical-creator' | 'vanity-prefix';
|
|
67
|
+
members: OperatorMember[];
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export interface OperatorRegistry {
|
|
71
|
+
generatedAt: string;
|
|
72
|
+
universeSize: number;
|
|
73
|
+
clusters: OperatorCluster[];
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export interface OperatorLink {
|
|
77
|
+
cluster: OperatorCluster;
|
|
78
|
+
/** the creator wallet on THIS mint that ties it to the cluster */
|
|
79
|
+
creator: string;
|
|
80
|
+
/** 'identical' = same wallet byte for byte; 'prefix' = same vanity family */
|
|
81
|
+
link: 'identical' | 'prefix';
|
|
82
|
+
/** other mints in the cluster */
|
|
83
|
+
peers: OperatorMember[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* How many members of a cluster are independently proven impersonators.
|
|
88
|
+
*
|
|
89
|
+
* A cluster of 1,243 tokens is a launchpad. A cluster of 1,243 tokens that
|
|
90
|
+
* contains six proven bluechip impersonators is something else. The count
|
|
91
|
+
* is what distinguishes them — so we compute it, and we never let the raw
|
|
92
|
+
* cluster size stand in for evidence.
|
|
93
|
+
*/
|
|
94
|
+
export function countImpersonators(
|
|
95
|
+
cluster: OperatorCluster,
|
|
96
|
+
isImpersonator: (mint: string) => boolean,
|
|
97
|
+
): number {
|
|
98
|
+
let n = 0;
|
|
99
|
+
for (const m of cluster.members) if (isImpersonator(m.mint)) n++;
|
|
100
|
+
return n;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
let registryCache: OperatorRegistry | null = null;
|
|
104
|
+
|
|
105
|
+
/** Read the operator registry generated by the sweep. Null if not built yet. */
|
|
106
|
+
export function loadOperatorRegistry(root = process.cwd()): OperatorRegistry | null {
|
|
107
|
+
if (registryCache) return registryCache;
|
|
108
|
+
try {
|
|
109
|
+
const raw = readFileSync(join(root, 'data', 'operator-registry.json'), 'utf8');
|
|
110
|
+
const parsed = JSON.parse(raw) as OperatorRegistry;
|
|
111
|
+
if (!parsed?.clusters?.length) return null;
|
|
112
|
+
registryCache = parsed;
|
|
113
|
+
return registryCache;
|
|
114
|
+
} catch {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Find the operator cluster this mint belongs to, if any.
|
|
121
|
+
*
|
|
122
|
+
* `creators` is the mint's metadata creator list (Metaplex order). We test
|
|
123
|
+
* every creator against every cluster, exact match first.
|
|
124
|
+
*/
|
|
125
|
+
export function findOperatorLink(
|
|
126
|
+
registry: OperatorRegistry | null,
|
|
127
|
+
mint: string,
|
|
128
|
+
creators: Array<{ address: string }>,
|
|
129
|
+
): OperatorLink | null {
|
|
130
|
+
if (!registry || !creators.length) return null;
|
|
131
|
+
const addresses = creators.map((c) => c.address).filter(Boolean);
|
|
132
|
+
|
|
133
|
+
// exact creator-wallet clusters first — strongest link
|
|
134
|
+
for (const cluster of registry.clusters) {
|
|
135
|
+
if (cluster.kind !== 'identical-creator' || !cluster.creator) continue;
|
|
136
|
+
if (!addresses.includes(cluster.creator)) continue;
|
|
137
|
+
return {
|
|
138
|
+
cluster,
|
|
139
|
+
creator: cluster.creator,
|
|
140
|
+
link: 'identical',
|
|
141
|
+
peers: cluster.members.filter((m) => m.mint !== mint),
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// then vanity-prefix families
|
|
146
|
+
for (const cluster of registry.clusters) {
|
|
147
|
+
if (cluster.kind !== 'vanity-prefix' || !cluster.prefix) continue;
|
|
148
|
+
const hit = addresses.find((a) => a.startsWith(cluster.prefix!));
|
|
149
|
+
if (!hit) continue;
|
|
150
|
+
return {
|
|
151
|
+
cluster,
|
|
152
|
+
creator: hit,
|
|
153
|
+
link: 'prefix',
|
|
154
|
+
peers: cluster.members.filter((m) => m.mint !== mint),
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return null;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Cluster a set of tokens by their creator wallets, live.
|
|
163
|
+
*
|
|
164
|
+
* Used by the scan command: every candidate it audits already has its
|
|
165
|
+
* metadata loaded, so grouping is free. This is how a NEW factory gets
|
|
166
|
+
* discovered instead of only the ones we happened to hard-code.
|
|
167
|
+
*/
|
|
168
|
+
export function clusterByCreator(
|
|
169
|
+
tokens: Array<{ mint: string; name?: string; symbol?: string; creators: Array<{ address: string }> }>,
|
|
170
|
+
): OperatorCluster[] {
|
|
171
|
+
const byExact = new Map<string, OperatorMember[]>();
|
|
172
|
+
const byPrefix = new Map<string, OperatorMember[]>();
|
|
173
|
+
|
|
174
|
+
for (const t of tokens) {
|
|
175
|
+
const member: OperatorMember = { mint: t.mint, name: t.name, symbol: t.symbol };
|
|
176
|
+
for (const c of t.creators ?? []) {
|
|
177
|
+
if (!c.address) continue;
|
|
178
|
+
const list = byExact.get(c.address) ?? [];
|
|
179
|
+
list.push(member);
|
|
180
|
+
byExact.set(c.address, list);
|
|
181
|
+
const prefix = c.address.slice(0, 6);
|
|
182
|
+
const plist = byPrefix.get(prefix) ?? [];
|
|
183
|
+
plist.push(member);
|
|
184
|
+
byPrefix.set(prefix, plist);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const clusters: OperatorCluster[] = [];
|
|
189
|
+
for (const [creator, members] of byExact) {
|
|
190
|
+
if (members.length < 2) continue;
|
|
191
|
+
clusters.push({
|
|
192
|
+
id: `creator:${creator.slice(0, 12)}…`,
|
|
193
|
+
creator,
|
|
194
|
+
kind: 'identical-creator',
|
|
195
|
+
members: dedupe(members),
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
for (const [prefix, members] of byPrefix) {
|
|
199
|
+
if (members.length < 2) continue;
|
|
200
|
+
clusters.push({
|
|
201
|
+
id: `prefix:${prefix}`,
|
|
202
|
+
prefix,
|
|
203
|
+
kind: 'vanity-prefix',
|
|
204
|
+
members: dedupe(members),
|
|
205
|
+
});
|
|
206
|
+
}
|
|
207
|
+
return clusters.sort((a, b) => b.members.length - a.members.length);
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function dedupe(members: OperatorMember[]): OperatorMember[] {
|
|
211
|
+
const seen = new Set<string>();
|
|
212
|
+
const out: OperatorMember[] = [];
|
|
213
|
+
for (const m of members) {
|
|
214
|
+
if (seen.has(m.mint)) continue;
|
|
215
|
+
seen.add(m.mint);
|
|
216
|
+
out.push(m);
|
|
217
|
+
}
|
|
218
|
+
return out;
|
|
219
|
+
}
|