Sign In

@true402.dev/rugcheck

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@true402.dev/rugcheck - npm Package Compare versions

Comparing version
1.0.2
to
1.0.3
+39
-10
dist/cli.js

@@ -92,3 +92,5 @@ #!/usr/bin/env node

var BASE_URL = process.env.SERVER_URL || "https://true402.dev/api";
function printVerdict(token, r, free) {
var CHAINS = ["base", "ethereum", "bsc"];
var isChain = (s) => CHAINS.includes(s);
function printVerdict(token, r, free, chain = "base") {
const rating = r.verdict?.rating ?? "unknown";

@@ -98,3 +100,3 @@ const score = r.safety?.score ?? "?";

process.stdout.write(`
${C.bold}true402 rugcheck${C.reset} \xB7 ${short(token)}${free ? ` ${C.dim}(free trial)${C.reset}` : ""}
${C.bold}true402 rugcheck${C.reset} \xB7 ${short(token)} ${C.dim}on ${chain}${C.reset}${free ? ` ${C.dim}(free trial)${C.reset}` : ""}
`);

@@ -110,9 +112,36 @@ process.stdout.write(`${badge} ${C.dim}(score ${score}/100)${C.reset}

async function main() {
const arg = process.argv[2];
const argv = process.argv.slice(2);
let chain = "base";
const rest = [];
for (let i = 0; i < argv.length; i++) {
const a = argv[i];
if (a === "--chain" || a === "-c") {
const v = (argv[++i] ?? "").toLowerCase();
if (!isChain(v)) {
process.stderr.write(`${C.red}Unknown chain:${C.reset} ${v || "(missing)"} \u2014 use ${CHAINS.join(" | ")}
`);
process.exit(1);
}
chain = v;
} else if (a.startsWith("--chain=")) {
const v = a.slice("--chain=".length).toLowerCase();
if (!isChain(v)) {
process.stderr.write(`${C.red}Unknown chain:${C.reset} ${v} \u2014 use ${CHAINS.join(" | ")}
`);
process.exit(1);
}
chain = v;
} else {
rest.push(a);
}
}
const arg = rest[0];
if (!arg || arg === "-h" || arg === "--help") {
process.stdout.write(
`${C.bold}true402 rugcheck${C.reset} \u2014 on-chain rug/honeypot check for a Base token
`${C.bold}true402 rugcheck${C.reset} \u2014 on-chain rug/honeypot check for an EVM token
${C.bold}npx @true402.dev/rugcheck${C.reset} <0xTOKEN>
${C.bold}npx @true402.dev/rugcheck${C.reset} <0xTOKEN> [--chain ${CHAINS.join("|")}]
Defaults to ${C.bold}base${C.reset}. The check runs against that chain's own DEX pools.
Free trial first; for unlimited checks set ${C.bold}PAYER_PRIVATE_KEY${C.reset}=0x\u2026 (a Base wallet

@@ -126,3 +155,3 @@ with a little USDC) to pay ~$0.01 per call over x402 \u2014 no account, no API key.

if (!isAddr(arg)) {
process.stderr.write(`${C.red}Not a valid Base token address:${C.reset} ${arg}
process.stderr.write(`${C.red}Not a valid token address:${C.reset} ${arg}
`);

@@ -134,3 +163,3 @@ process.exit(1);

try {
const res = await fetch(`${BASE_URL}/v1/base/token-report`, {
const res = await fetch(`${BASE_URL}/v1/${chain}/token-report`, {
method: "POST",

@@ -142,3 +171,3 @@ headers: { "content-type": "application/json" },

const r = await res.json();
printVerdict(arg, r, true);
printVerdict(arg, r, true, chain);
process.exit(r.verdict?.rating === "avoid" ? 1 : 0);

@@ -161,4 +190,4 @@ }

try {
const r = await payStall("/v1/base/token-report", { token: arg }, { payerPrivateKey: key, baseUrl: BASE_URL });
printVerdict(arg, r, false);
const r = await payStall(`/v1/${chain}/token-report`, { token: arg }, { payerPrivateKey: key, baseUrl: BASE_URL });
printVerdict(arg, r, false, chain);
process.exit(r.verdict?.rating === "avoid" ? 1 : 0);

@@ -165,0 +194,0 @@ } catch (e) {

{
"name": "@true402.dev/rugcheck",
"version": "1.0.2",
"description": "Terminal rug/honeypot check for any Base token \u2014 `npx @true402.dev/rugcheck 0x\u2026` \u2014 pay-per-call over x402 (USDC, no account, no API key).",
"version": "1.0.3",
"description": "Terminal rug/honeypot check for any Base token — `npx @true402.dev/rugcheck 0x…` — pay-per-call over x402 (USDC, no account, no API key).",
"type": "module",

@@ -6,0 +6,0 @@ "bin": {

@@ -13,2 +13,4 @@ # @true402.dev/rugcheck

Works on Base (default), Ethereum and BNB Smart Chain — add `--chain ethereum` or `--chain bsc`.
```bash

@@ -15,0 +17,0 @@ PAYER_PRIVATE_KEY=0x… npx @true402.dev/rugcheck 0x<token>