fix(sanctum-validator-lst): move SKILL.md to root for skill discoverability#228
fix(sanctum-validator-lst): move SKILL.md to root for skill discoverability#228skylavis-sky wants to merge 2 commits intoMigOKG:mainfrom
Conversation
…bility Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 4: Summary + Pre-flight for
|
📋 Phase 3: AI Code Review Report — Score: 58/100
1. Plugin Overview
Summary: This plugin enables users to interact with Aerodrome Finance's classic AMM (volatile/stable pools) on the Base blockchain (chain ID 8453). It supports token swaps, liquidity management (add/remove), LP position viewing, swap quoting, pool querying, and gauge reward claiming. Read operations use direct JSON-RPC calls to a public Base node; write operations delegate to Target Users: DeFi users who want to manage Aerodrome Finance classic AMM positions on Base through an AI agent interface. 2. Architecture AnalysisComponents:
Skill Structure:
Data Flow:
Dependencies:
3. Auto-Detected Permissionsonchainos Commands Used
Wallet Operations
External APIs / URLs
Chains Operated On
Overall Permission SummaryThis plugin reads on-chain data (pool reserves, token balances, allowances, gauge rewards) via direct JSON-RPC calls to a public Base node, and performs on-chain write operations (ERC-20 approvals, swaps, liquidity add/remove, reward claims) through 4. onchainos API ComplianceDoes this plugin use onchainos CLI for all on-chain write operations?Yes — All on-chain write operations go through On-Chain Write Operations (MUST use onchainos)
Data Queries (allowed to use external sources)
External APIs / Libraries Detected
Verdict: ✅ Fully CompliantThe plugin correctly uses 5. Security AssessmentStatic Rule Scan (C01-C09, H01-H09, M01-M08, L01-L02)
LLM Judge Analysis (L-PINJ, L-MALI, L-MEMA, L-IINJ, L-AEXE, L-FINA, L-FISO)
Toxic Flow Detection (TF001-TF006)TF005 · curl|sh + Financial Access:
TF006 · External data no boundary + Financial operations:
Prompt Injection ScanThe base64-encoded string in the pre-flight section ( No instruction override, identity manipulation, hidden behavior, or confirmation bypass patterns detected in SKILL.md content or source code. Result: Dangerous Operations Check
Result: Data Exfiltration RiskThe pre-flight "Report install" section:
This is telemetry/analytics, not credential exfiltration. However, the obfuscated HMAC key and device fingerprinting are noteworthy. No wallet credentials, private keys, or sensitive financial data are exfiltrated. Result: Overall Security Rating: 🔴 High RiskJustification: TF005 (curl|sh + financial access) triggers a CRITICAL toxic flow, resulting in FAIL. The combination of unverified remote script execution in the Agent's execution path with full financial operation capability (swaps, unlimited approvals) creates a significant attack surface. Additionally: unlimited ERC-20 approvals, 6. Source Code Security (if source code is included)Language & Build Config
Dependency Analysis
No suspicious, unmaintained, or vulnerable dependencies detected. All are widely-used Rust ecosystem crates. Code Safety Audit
Potential Code Issues
Does SKILL.md accurately describe what the source code does?Mostly yes, with notable discrepancies:
Verdict:
|
| Dimension | Score | Notes |
|---|---|---|
| Completeness (pre-flight, commands, error handling) | 16/25 | Good command coverage (7 commands). Pre-flight has issues (curl|sh, unpinned deps). Error handling is basic but present. No retry logic for RPC calls. |
| Clarity (descriptions, no ambiguity) | 14/25 | Commands are well-documented with examples. However, --confirm semantics are misleading (maps to --force). Amount units could be clearer. |
| Security Awareness (confirmations, slippage, limits) | 8/25 | Has slippage control for swaps. Has --confirm flag. But: unlimited approvals, no value caps, --force bypass, no explicit confirmation prompt in binary, misleading --confirm/--force mapping. |
| Skill Routing (defers correctly, no overreach) | 12/15 | Correctly defers to okx-dex-swap for cross-DEX swaps, okx-defi-portfolio for portfolio tracking. Stays within Aerodrome classic AMM scope. |
| Formatting (markdown, tables, code blocks) | 8/10 | Well-formatted SKILL.md with tables, code blocks, and structured sections. |
Strengths
- Clean architecture: Clear separation between RPC reads (
rpc.rs), onchainos integration (onchainos.rs), config/ABI encoding (config.rs), and command logic - Correct onchainos integration: All write operations properly delegate to
onchainos wallet contract-callrather than self-implementing signing/broadcasting - Comprehensive command set: Covers the full lifecycle of Aerodrome AMM interaction (quote → swap → add liquidity → positions → remove liquidity → claim rewards)
Issues Found
- 🔴 Critical: TF005 — curl|sh in SKILL.md pre-flight + financial operations. The
curl -fsSL ... | shpattern for installing onchainos is in the Agent's execution path. Combined with full financial capabilities, this creates a critical attack vector. The install script URL usesmainbranch (not version-pinned). - 🔴 Critical: Obfuscated base64 key in SKILL.md telemetry (C03 match). The pre-flight "Report install" section contains a base64-encoded HMAC key and device fingerprinting logic. While the decoded content appears to be a telemetry key, obfuscated content in Agent-executed scripts is a significant trust concern.
- 🟡 Important:
--confirmmaps to--forceon onchainos — This is semantically misleading. Users and the Agent may think--confirmadds a confirmation step, but it actually bypasses backend safety confirmations. The SKILL.md description contradicts the actual behavior. - 🟡 Important: Unlimited ERC-20 approvals (
u128::MAX). Should approve only the needed amount, or at minimum warn the user about unlimited approval risk. - 🟡 Important: No enforced transaction value limits. SKILL.md mentions "Max 0.00005 ETH per test transaction" but the code enforces no such limit.
- 🟡 Important: Unpinned dependency installs (M01, M02) —
npx skills addwithout version,install.shfrommainbranch. - 🔵 Minor: Dead code —
wallet_contract_call_with_valueis#[allow(dead_code)]but always passes--force. Should be removed or fixed. - 🔵 Minor: No explicit hex validation on user-supplied token addresses before ABI encoding.
- 🔵 Minor:
amount_a_minandamount_b_mindefault to 0 for liquidity operations, meaning no slippage protection by default.
8. Recommendations
- 🔴 CRITICAL: Remove
curl | shfrom SKILL.md pre-flight. Use checksum-verified installer pattern (as shown in official onchainos skills likeokx-onchain-gateway). Pin to a specific release tag, notmain. - 🔴 CRITICAL: Remove or clearly document the obfuscated base64 content in the telemetry section. Replace with transparent, readable code. Obfuscated keys in Agent-executed scripts violate the principle of auditability.
- 🟡 HIGH: Fix the
--confirm/--forcesemantic mismatch. Either: (a) rename--confirmto--forceto match onchainos semantics, or (b) implement a two-step flow where the command without--confirmshows a preview, and with--confirmbroadcasts (without passing--forceto onchainos, allowing backend confirmations to work). - 🟡 HIGH: Replace unlimited approvals (
u128::MAX) with exact-amount approvals matching the swap/liquidity amount. Add a SKILL.md warning about approval amounts. - 🟡 HIGH: Pin all dependency installations to specific versions:
npx skills add okx/onchainos-skills@x.y.z, binary download from tagged release. - 🟡 MEDIUM: Add explicit hex-character validation for user-supplied addresses before passing to ABI encoding functions.
- 🟡 MEDIUM: Set non-zero defaults for
amount_a_min/amount_b_minin liquidity operations (e.g., 99% of expected amounts) to provide default slippage protection. - 🔵 LOW: Remove dead code (
wallet_contract_call_with_value) or fix its unconditional--forceusage. - 🔵 LOW: Add the full untrusted data boundary declaration covering RPC responses in addition to CLI output.
9. Reviewer Summary
One-line verdict: A well-structured Aerodrome AMM plugin with correct onchainos integration for write operations, but critically undermined by curl|sh in the Agent execution path, obfuscated telemetry, misleading confirmation semantics, and unlimited token approvals.
Merge recommendation: 🔍 Needs changes before merge
Items that must be addressed:
- Remove
curl | shfrom SKILL.md pre-flight — replace with checksum-verified, version-pinned installer - Remove or de-obfuscate the base64-encoded HMAC key in telemetry section
- Fix
--confirm→--forcesemantic mismatch to prevent bypassing backend safety confirmations - Replace unlimited (
u128::MAX) ERC-20 approvals with exact-amount approvals - Pin all dependency installations to specific versions
Generated by Claude AI via Anthropic API — review the full report before approving.
🔨 Phase 2: Build Verification — ✅ PASSED
Build succeeded. Compiled artifact uploaded as workflow artifact. Source integrity: commit SHA `` is the content fingerprint. |
Copies
SKILL.mdfromskills/sanctum-validator-lst/skills/sanctum-validator-lst/SKILL.mdtoskills/sanctum-validator-lst/SKILL.mdso thatnpx skills add MigOKG/plugin-store --skill sanctum-validator-lstcan find it.