magneta-contract-risk
БесплатноБез исполняемых скриптовНе проверенCheck a smart contract's risk before trading, approving, bridging or integrating it, using the Magneta Contract Risk x402 service (0-100 score…
от bosacks423 установки в других каталогахОб этом скилле
Magneta Contract Risk (x402)
Deterministic on-chain risk report for any deployed EVM contract. No LLM in the analysis: RPC reads, bytecode
opcode/selector scan, Blockscout/Sourcify verification and an aderyn static-analysis pass. Service: https://x402.magneta.finance.
When to use
- Before swapping into, buying, approving (
approve/permit) or sending funds to an unfamiliar token or protocol contract. - Before bridging to or integrating a contract you did not deploy.
- As a pre-signature gate in an agent loop: score the counterparty, then decide.
Do not use it for externally-owned accounts (the API returns 422 not_a_contract), for non-EVM chains, or as a substitute for an audit.
Security posture (read first)
- Free tier first, no credentials.
curl -s https://x402.magneta.finance/v1/flags/<chainId>/<address>needs no key, no wallet, no account. Most go/no-go decisions can stop here. - This skill never asks for a key in chat and never stores one. The only secret is the optional
BUYER_PRIVATE_KEYenvironment variable, read by the x402 client code you run. Do not paste a key into the conversation, a file, a command line argument or a log. Never print, echo or log it (log the settlement tx hash instead). - No autonomous spending. Before the first paid call of a session, tell the user the price ($0.01 USDC on Base, one report) and get an explicit yes. Do not loop, retry-buy or batch paid calls without a fresh yes. At most one paid report per contract per decision.
- Hard spending cap in code, equal to the approved price. Every paid client caps each payment at exactly
$0.01USDC on Base (eip155:8453), the price the user approved. A 402 asking for more, another asset or another network is refused (see Spend control). - Dedicated wallet only. Use a throwaway buyer wallet funded with a few dollars of USDC on Base, never a treasury or personal wallet.
- Nothing is executed on your behalf. The skill only issues HTTPS GETs to
x402.magneta.finance(and an MCP endpoint on the same host). It installs nothing by itself; the optional npm packages in the examples must be installed by you, with exact versions, using--ignore-scripts. - External cost disclosed: the paid report costs $0.01 USDC per call, settled on-chain via x402 (EIP-3009
exact). ClawHub itself is free; this charge is for the external Magneta service only.
Endpoints
| Surface | Route / tool | Price |
|---|---|---|
| HTTP | GET /v1/risk/:chainId/:address |
$0.01 USDC, Base mainnet (eip155:8453), x402 exact |
| HTTP | GET /v1/flags/:chainId/:address (bytecode-only preview) |
free |
MCP https://x402.magneta.finance/mcp |
contract_risk_summary {chainId:int, address:string} |
$0.01 |
| MCP | contract_quick_flags, supported_chains, scoring_rubric |
free |
Chains (20): mainnets 1, 10, 56, 100, 130, 137, 146, 480, 5000, 8453, 42161, 42220, 43114, 59144, 81457, 534352; testnets 84532, 11155111, 11155420, 421614. The payment is always in USDC on Base mainnet, whichever chain the target contract is on.
Workflow
- Confirm the target chain id and address with the user (never guess an address).
- Free first: call
/v1/flags/:chainId/:address(orcontract_quick_flags). If it already shows a blocking flag for your use case, stop; no need to pay. - If the decision still depends on source verification, owner state or static analysis, ask the user to approve the $0.01 report, then buy it.
- Read the report (below), apply your own threshold, and tell the user which flags drove the decision.
- A report is cached server-side for 10 minutes per chain+address; the payment still happens on each call, so do not re-buy the same pair in a loop.
Call it
Versions this repo is tested with: @x402/core|evm|fetch|mcp 2.28.0, viem 2.57.7, @coinbase/cdp-sdk 1.58.0,
@modelcontextprotocol/sdk 1.32.1. Pin exact versions.
(a) HTTP with @x402/fetch + @x402/evm
import { x402Client, wrapFetchWithPayment, x402HTTPClient } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.BUYER_PRIVATE_KEY as `0x${string}`); // holds USDC on Base
const client = new x402Client();
client.setSpendControls({ maxAmountPerPayment: "$0.01" }); // exactly the approved price; a higher 402 is rejected
client.register("eip155:8453", new ExactEvmScheme(account)); // Base mainnet only
const fetchWithPayment = wrapFetchWithPayment(fetch, client);
const httpClient = new x402HTTPClient(client);
const res = await fetchWithPayment("https://x402.magneta.finance/v1/risk/8453/0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913");
if (!res.ok) throw new Error(`HTTP ${res.status}: ${await res.text()}`);
const settle = httpClient.getPaymentSettleResponse((n) => res.headers.get(n)); // PAYMENT-RESPONSE header
const report = await res.json();
console.error("paid tx", settle.transaction, "
Установить magneta-contract-risk в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл magneta-contract-risk?
Check a smart contract's risk before trading, approving, bridging or integrating it, using the Magneta Contract Risk x402 service (0-100 score, proxy/owner/mint/blacklist/fee flags, verified-source and static-analysis findings, 20 EVM chains). Free bytecode-only quick flags need only curl; the full report costs $0.01 USDC on Base per call and is paid only with explicit user approval. Use when about to sign a transaction involving an unfamiliar token or contract, or when asked whether a token looks like a rug or honeypot. Not an audit.
Как установить скилл magneta-contract-risk?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл magneta-contract-risk запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic