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/package.json
CHANGED
|
@@ -1,6 +1,80 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "liqproof",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"description": "
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"description": "On-chain liquidity receipts — prove fake liquidity with signed on-chain evidence. $0 budget, read-only.",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "Ahmed Ibrahim Hassan <aih.business77@gmail.com>",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "git+https://github.com/aihbusiness77-pixel/liqproof.git"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/aihbusiness77-pixel/liqproof#readme",
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/aihbusiness77-pixel/liqproof/issues"
|
|
16
|
+
},
|
|
17
|
+
"keywords": [
|
|
18
|
+
"solana",
|
|
19
|
+
"liquidity",
|
|
20
|
+
"mev",
|
|
21
|
+
"rug-pull",
|
|
22
|
+
"on-chain",
|
|
23
|
+
"receipts",
|
|
24
|
+
"x402",
|
|
25
|
+
"mcp",
|
|
26
|
+
"audit",
|
|
27
|
+
"read-only"
|
|
28
|
+
],
|
|
29
|
+
"mcpName": "io.github.aihbusiness77-pixel/liqproof",
|
|
30
|
+
"files": [
|
|
31
|
+
"dist/",
|
|
32
|
+
"src/",
|
|
33
|
+
"out/",
|
|
34
|
+
"scripts/",
|
|
35
|
+
"bugs/",
|
|
36
|
+
"data/impersonators.json",
|
|
37
|
+
"data/verified-impersonators.json",
|
|
38
|
+
"data/dataset-summary.md",
|
|
39
|
+
"data/wallets.json",
|
|
40
|
+
"docs/x402-pricing.md",
|
|
41
|
+
"docs/mcp-registry.md",
|
|
42
|
+
"docs/zero-xyz.md",
|
|
43
|
+
"docs/llms.txt",
|
|
44
|
+
"docs/liqproof-plan.md",
|
|
45
|
+
"docs/HACKATHON-SUBMISSION.md",
|
|
46
|
+
"docs/screenshots/",
|
|
47
|
+
"server.json",
|
|
48
|
+
"README.md",
|
|
49
|
+
"LICENSE"
|
|
50
|
+
],
|
|
51
|
+
"engines": {
|
|
52
|
+
"node": ">=22.5.0"
|
|
53
|
+
},
|
|
54
|
+
"bin": {
|
|
55
|
+
"liqproof": "./dist/cli.js"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc -p tsconfig.json",
|
|
59
|
+
"receipt": "node dist/cli.js receipt",
|
|
60
|
+
"scan": "node dist/cli.js scan",
|
|
61
|
+
"survival": "node dist/cli.js survival",
|
|
62
|
+
"timeline": "node dist/cli.js timeline",
|
|
63
|
+
"export": "node dist/cli.js export",
|
|
64
|
+
"mcp": "node dist/cli.js mcp",
|
|
65
|
+
"serve": "node dist/cli.js serve",
|
|
66
|
+
"x402": "node dist/cli.js x402",
|
|
67
|
+
"verify": "node dist/cli.js verify",
|
|
68
|
+
"wallet": "node dist/cli.js wallet",
|
|
69
|
+
"assert:safety": "node scripts/assert-no-canonical-accusations.mjs",
|
|
70
|
+
"test": "npm run build && node dist/cli.js verify && node scripts/test-keccak.mjs && node scripts/assert-no-canonical-accusations.mjs",
|
|
71
|
+
"miner": "node scripts/survival-miner.mjs",
|
|
72
|
+
"backfill": "node scripts/backfill.mjs",
|
|
73
|
+
"refresh": "node scripts/daily-refresh.mjs",
|
|
74
|
+
"dev": "tsc -p tsconfig.json --watch"
|
|
75
|
+
},
|
|
76
|
+
"devDependencies": {
|
|
77
|
+
"@types/node": "^22.10.2",
|
|
78
|
+
"typescript": "^5.7.2"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
// LIQPROOF — safety assertion: a canonical token can never be accused.
|
|
2
|
+
//
|
|
3
|
+
// WHAT THIS CHECKS
|
|
4
|
+
//
|
|
5
|
+
// The published dataset (out/dataset.csv, and the dashboard built from it)
|
|
6
|
+
// may contain an ACCUSATORY verdict — FAKE_LIQUIDITY, DRAINED or
|
|
7
|
+
// NO_DEPTH — only for a mint that is NOT the canonical token.
|
|
8
|
+
//
|
|
9
|
+
// For every accusatory row, this script re-derives the canonical answer
|
|
10
|
+
// from scratch, the way an outside reviewer would:
|
|
11
|
+
//
|
|
12
|
+
// 1. read the mint's OWN Metaplex metadata account (the on-chain name);
|
|
13
|
+
// 2. load the canonical index (first-party documentation + CoinGecko's
|
|
14
|
+
// coin→Solana-mint map, both keyless);
|
|
15
|
+
// 3. ask the resolver whether this mint IS the canonical token.
|
|
16
|
+
//
|
|
17
|
+
// If the answer is "yes, it is canonical", the row is a false accusation
|
|
18
|
+
// and this script FAILS (exit 1). The check does not trust the dataset's
|
|
19
|
+
// own verdict, its flags, or the receipt that produced it — it re-reads
|
|
20
|
+
// the chain and the index.
|
|
21
|
+
//
|
|
22
|
+
// WHY IT EXISTS
|
|
23
|
+
//
|
|
24
|
+
// On 2026-12-04 the canonical USDB mint
|
|
25
|
+
// (9GV3oZL4p5uGFhtSxS4JsyP64Dqvw4ZuvzgX7FzJ7eTD) reached the published
|
|
26
|
+
// dataset as NO_DEPTH on a $500M claim, because the accusation gate in
|
|
27
|
+
// the receipt engine protected FAKE_LIQUIDITY only, and the canonical
|
|
28
|
+
// guard that did exist lived inside one mining script instead of at store
|
|
29
|
+
// time. Both are fixed. This script is the third line of defence: even if
|
|
30
|
+
// a future change opens the gate again, CI goes red before a reviewer can
|
|
31
|
+
// find the mistake.
|
|
32
|
+
//
|
|
33
|
+
// COST
|
|
34
|
+
//
|
|
35
|
+
// Zero. One CoinGecko request for the index (cached for 6h) and one RPC
|
|
36
|
+
// account read per accusatory row — six rows today.
|
|
37
|
+
//
|
|
38
|
+
// EXIT CODES
|
|
39
|
+
//
|
|
40
|
+
// 0 the published dataset is clean
|
|
41
|
+
// 1 a canonical mint carries an accusatory verdict (never ship this)
|
|
42
|
+
|
|
43
|
+
import { readFileSync } from 'node:fs';
|
|
44
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
45
|
+
import { dirname, join } from 'node:path';
|
|
46
|
+
|
|
47
|
+
const ROOT = join(dirname(fileURLToPath(import.meta.url)), '..');
|
|
48
|
+
|
|
49
|
+
const ACCUSATORY = new Set(['FAKE_LIQUIDITY', 'NO_DEPTH', 'DRAINED']);
|
|
50
|
+
|
|
51
|
+
// ── the published dataset ────────────────────────────────────────────────────
|
|
52
|
+
|
|
53
|
+
function readDataset() {
|
|
54
|
+
const raw = readFileSync(join(ROOT, 'out', 'dataset.csv'), 'utf8');
|
|
55
|
+
const lines = raw.split(/\r?\n/).filter((l) => l.length > 0);
|
|
56
|
+
const header = splitCsv(lines[0]);
|
|
57
|
+
return lines.slice(1).map((line) => {
|
|
58
|
+
const cells = splitCsv(line);
|
|
59
|
+
const row = {};
|
|
60
|
+
header.forEach((h, i) => {
|
|
61
|
+
row[h] = cells[i] ?? '';
|
|
62
|
+
});
|
|
63
|
+
return row;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/** Minimal RFC-4180 field splitter — the CSV is written by our own exporter. */
|
|
68
|
+
function splitCsv(line) {
|
|
69
|
+
const out = [];
|
|
70
|
+
let cur = '';
|
|
71
|
+
let quoted = false;
|
|
72
|
+
for (let i = 0; i < line.length; i++) {
|
|
73
|
+
const ch = line[i];
|
|
74
|
+
if (quoted) {
|
|
75
|
+
if (ch === '"') {
|
|
76
|
+
if (line[i + 1] === '"') {
|
|
77
|
+
cur += '"';
|
|
78
|
+
i++;
|
|
79
|
+
} else {
|
|
80
|
+
quoted = false;
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
cur += ch;
|
|
84
|
+
}
|
|
85
|
+
} else if (ch === '"') {
|
|
86
|
+
quoted = true;
|
|
87
|
+
} else if (ch === ',') {
|
|
88
|
+
out.push(cur);
|
|
89
|
+
cur = '';
|
|
90
|
+
} else {
|
|
91
|
+
cur += ch;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
out.push(cur);
|
|
95
|
+
return out;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// ── the engine's own readers ─────────────────────────────────────────────────
|
|
99
|
+
|
|
100
|
+
// Windows note: an absolute path is NOT a valid ES module URL. Every import
|
|
101
|
+
// has to go through pathToFileURL, or the loader throws
|
|
102
|
+
// ERR_UNSUPPORTED_ESM_URL_SCHEME. (The project hit this exact trap before
|
|
103
|
+
// in scripts/check-wallet.mjs.)
|
|
104
|
+
const { RpcPool } = await import(pathToFileURL(join(ROOT, 'dist', 'rpc.js')).href);
|
|
105
|
+
const { loadCanonicalIndex, resolveCanonical } = await import(
|
|
106
|
+
pathToFileURL(join(ROOT, 'dist', 'canonical.js')).href
|
|
107
|
+
);
|
|
108
|
+
const { tokenMetadata } = await import(
|
|
109
|
+
pathToFileURL(join(ROOT, 'dist', 'tokenmeta.js')).href
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
const rows = readDataset();
|
|
113
|
+
const accusatory = rows.filter((r) => ACCUSATORY.has((r.verdict ?? '').trim()));
|
|
114
|
+
|
|
115
|
+
console.log('LIQPROOF SAFETY ASSERTION');
|
|
116
|
+
console.log('─'.repeat(64));
|
|
117
|
+
console.log(` published rows ${rows.length}`);
|
|
118
|
+
console.log(` accusatory rows ${accusatory.length}`);
|
|
119
|
+
console.log(` checked verdicts ${[...ACCUSATORY].join(', ')}`);
|
|
120
|
+
console.log('');
|
|
121
|
+
|
|
122
|
+
if (accusatory.length === 0) {
|
|
123
|
+
console.log(' nothing to accuse — the dataset makes no adverse claim.');
|
|
124
|
+
process.exit(0);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
const rpc = new RpcPool({ verbose: false });
|
|
128
|
+
let index = null;
|
|
129
|
+
try {
|
|
130
|
+
index = await loadCanonicalIndex();
|
|
131
|
+
console.log(` canonical index ${index.entries.length} entries`);
|
|
132
|
+
} catch (err) {
|
|
133
|
+
console.error(` FAIL could not load the canonical index: ${err.message}`);
|
|
134
|
+
console.error(' Without the index this assertion cannot run, and a');
|
|
135
|
+
console.error(' dataset that accuses without one is not publishable.');
|
|
136
|
+
process.exit(1);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
const violations = [];
|
|
140
|
+
const checked = [];
|
|
141
|
+
|
|
142
|
+
for (const row of accusatory) {
|
|
143
|
+
const mint = (row.mint ?? '').trim();
|
|
144
|
+
if (!mint) continue;
|
|
145
|
+
|
|
146
|
+
let name = '';
|
|
147
|
+
let symbol = (row.symbol ?? '').trim();
|
|
148
|
+
try {
|
|
149
|
+
const meta = await tokenMetadata(rpc, mint);
|
|
150
|
+
if (meta) {
|
|
151
|
+
name = meta.name ?? '';
|
|
152
|
+
symbol = meta.symbol || symbol;
|
|
153
|
+
}
|
|
154
|
+
} catch {
|
|
155
|
+
// A metadata read that fails does not make the row safe. We fall back to
|
|
156
|
+
// the symbol the dataset carries and let the resolver decide.
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const resolution = resolveCanonical(mint, { name, symbol }, index);
|
|
160
|
+
checked.push({ mint, symbol, verdict: row.verdict, status: resolution.status });
|
|
161
|
+
|
|
162
|
+
if (resolution.status === 'canonical' || resolution.isCanonical) {
|
|
163
|
+
violations.push({ mint, symbol, verdict: row.verdict, name, method: resolution.method });
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
console.log('');
|
|
168
|
+
for (const c of checked) {
|
|
169
|
+
const mark = c.status === 'canonical' ? 'VIOLATION' : 'ok';
|
|
170
|
+
console.log(
|
|
171
|
+
` ${mark.padEnd(10)} ${c.mint.slice(0, 44).padEnd(44)} ${c.verdict.padEnd(18)} canonical=${c.status}`,
|
|
172
|
+
);
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
console.log('');
|
|
176
|
+
|
|
177
|
+
if (violations.length > 0) {
|
|
178
|
+
console.error(' FAIL a canonical mint carries an accusatory verdict:');
|
|
179
|
+
for (const v of violations) {
|
|
180
|
+
console.error(
|
|
181
|
+
` ${v.mint} (${v.symbol}) → ${v.verdict} · on-chain name "${v.name}" · ${v.method}`,
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
console.error('');
|
|
185
|
+
console.error(' A real project was published as fake. Fix the gate, rebuild the');
|
|
186
|
+
console.error(' dataset, and do not publish this until the assertion is green.');
|
|
187
|
+
process.exit(1);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
console.log(` PASS ${checked.length} accusatory rows re-checked against the chain and the`);
|
|
191
|
+
console.log(' canonical index — none of them is a canonical token.');
|
|
192
|
+
console.log('');
|
|
193
|
+
process.exit(0);
|