@kurox_real/plugin-rugshield-402 1.0.0 → 1.0.1
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 +1 -1
- package/dist/index.js +14 -10
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
**Autonomous Pre-Swap Honeypot Detection & Tax Verification Plugin for ElizaOS Agents on Base**
|
|
4
4
|
|
|
5
|
-
Gated by the **x402 Payment Protocol** ($0.
|
|
5
|
+
Gated by the **x402 Payment Protocol** ($0.010 USDC per scan on Base Mainnet).
|
|
6
6
|
|
|
7
7
|
## Overview
|
|
8
8
|
This plugin provides the `PRE_SWAP_RISK_CHECK` action for ElizaOS agents. Before an agent swaps any token on Base (Aerodrome, Uniswap v3), it automatically queries the RugShield 402 engine to:
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ export const preSwapRiskCheckAction = {
|
|
|
12
12
|
"AUDIT_BASE_TOKEN",
|
|
13
13
|
"RUGSHIELD_CHECK"
|
|
14
14
|
],
|
|
15
|
-
description: "MANDATORY check before executing DEX swaps on Base. Queries RugShield 402 to detect honeypots, high buy/sell taxes, and drained liquidity. Cost: 0.
|
|
15
|
+
description: "MANDATORY check before executing DEX swaps on Base. Queries RugShield 402 to detect honeypots, high buy/sell taxes, and drained liquidity. Cost: 0.010 USDC on Base.",
|
|
16
16
|
validate: async (_runtime, message) => {
|
|
17
17
|
const text = message.content?.text || "";
|
|
18
18
|
// Matches 0x addresses on Base
|
|
@@ -37,26 +37,30 @@ export const preSwapRiskCheckAction = {
|
|
|
37
37
|
});
|
|
38
38
|
if (response.status === 402) {
|
|
39
39
|
const challenge = await response.json();
|
|
40
|
+
const payTo = challenge?.accepts?.[0]?.payTo || challenge?.payTo || "0x80E0Ae84679b7f11bE171DaADd492FBECf628cd6";
|
|
40
41
|
if (callback) {
|
|
41
42
|
callback({
|
|
42
|
-
text: `RugShield 402 payment required ($0.
|
|
43
|
+
text: `RugShield 402 payment required ($0.010 USDC on Base). PayTo: ${payTo}`,
|
|
43
44
|
action: "X402_PAYMENT_REQUIRED",
|
|
44
45
|
challenge
|
|
45
46
|
});
|
|
46
47
|
}
|
|
47
48
|
return false;
|
|
48
49
|
}
|
|
50
|
+
if (!response.ok) {
|
|
51
|
+
throw new Error(`HTTP ${response.status}`);
|
|
52
|
+
}
|
|
49
53
|
const report = await response.json();
|
|
50
|
-
const isSafe = report.recommendation === "SAFE_TO_SWAP";
|
|
54
|
+
const isSafe = report.recommendation === "SAFE_TO_SWAP" && report.is_honeypot === false;
|
|
51
55
|
if (callback) {
|
|
52
56
|
callback({
|
|
53
|
-
text: `RugShield Security Report for ${report.symbol} (${tokenAddress}):\n` +
|
|
54
|
-
`• Recommendation: ${report.recommendation}\n` +
|
|
55
|
-
`• Honeypot: ${report.is_honeypot ? "YES (DO NOT BUY)" : "NO"}\n` +
|
|
56
|
-
`• Buy Tax: ${report.buy_tax_bps / 100}
|
|
57
|
-
`• Sell Tax: ${report.sell_tax_bps / 100}
|
|
58
|
-
`• Pool Liquidity:
|
|
59
|
-
`• Risk Score: ${report.risk_score}`,
|
|
57
|
+
text: `RugShield Security Report for ${report.symbol ?? tokenAddress} (${tokenAddress}):\n` +
|
|
58
|
+
`• Recommendation: ${report.recommendation ?? "UNVERIFIED"}\n` +
|
|
59
|
+
`• Honeypot: ${report.is_honeypot === true ? "YES (DO NOT BUY)" : report.is_honeypot === false ? "NO" : "UNVERIFIED"}\n` +
|
|
60
|
+
`• Buy Tax: ${typeof report.buy_tax_bps === "number" ? (report.buy_tax_bps / 100) + "%" : "UNVERIFIED"}\n` +
|
|
61
|
+
`• Sell Tax: ${typeof report.sell_tax_bps === "number" ? (report.sell_tax_bps / 100) + "%" : "UNVERIFIED"}\n` +
|
|
62
|
+
`• Pool Liquidity: ${typeof report.liquidity_usd === "number" ? "$" + report.liquidity_usd.toLocaleString() : "Unavailable"}\n` +
|
|
63
|
+
`• Risk Score: ${report.risk_score ?? "N/A"}`,
|
|
60
64
|
report
|
|
61
65
|
});
|
|
62
66
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kurox_real/plugin-rugshield-402",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "RugShield 402 DEX honeypot detection, buy/sell tax simulation, and pool liquidity verification action for ElizaOS agents on Base (x402 gated).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|