Skip to content

fix(solv-solvbtc): move SKILL.md to root for skill discoverability#229

Closed
skylavis-sky wants to merge 2 commits intoMigOKG:mainfrom
skylavis-sky:fix/skill-md-solv-solvbtc
Closed

fix(solv-solvbtc): move SKILL.md to root for skill discoverability#229
skylavis-sky wants to merge 2 commits intoMigOKG:mainfrom
skylavis-sky:fix/skill-md-solv-solvbtc

Conversation

@skylavis-sky
Copy link
Copy Markdown
Collaborator

Copies SKILL.md from skills/solv-solvbtc/skills/solv-solvbtc/SKILL.md to skills/solv-solvbtc/SKILL.md so that npx skills add MigOKG/plugin-store --skill solv-solvbtc can find it.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

📋 Phase 3: AI Code Review Report — Score: 72/100

Plugin: aerodrome-amm | Recommendation: 🔍 Needs changes

🔗 Reviewed against latest onchainos source code (live from main branch) | Model: claude-opus-4-6 via Anthropic API | Cost: ~240044+5785 tokens

This is an advisory report. It does NOT block merging. Final decision is made by human reviewers.


1. Plugin Overview
Field Value
Name aerodrome-amm
Version 0.1.0
Category defi-protocol
Author GeoGu360 (GeoGu360)
License MIT
Has Binary Yes (Rust build config)
Risk Level High (DeFi write operations: swaps, liquidity management, reward claims)

Summary: This plugin enables interaction with Aerodrome Finance's classic AMM (volatile/stable pools) on the Base blockchain. It supports token swaps, LP position management (add/remove liquidity), pool queries, position viewing, and gauge reward claiming. Read operations use direct JSON-RPC calls to a public Base RPC endpoint, while write operations delegate to the onchainos wallet for signing and broadcasting.

Target Users: DeFi users who want to interact with Aerodrome Finance classic AMM pools on Base through an AI agent interface.

2. Architecture Analysis

Components:

  • Skill (SKILL.md)
  • Binary (Rust, aerodrome-amm)

Skill Structure:
SKILL.md contains: pre-flight dependency installation, plugin description, pool type documentation, 7 command specifications (quote, swap, pools, positions, add-liquidity, remove-liquidity, claim-rewards), supported token table, contract addresses, error handling guide, skill routing, and security notices. Well-structured with clear command documentation.

Data Flow:

  1. Read operations (quote, pools, positions): Binary makes direct eth_call JSON-RPC requests to https://base-rpc.publicnode.com to query on-chain state (reserves, balances, allowances, etc.)
  2. Write operations (swap, add-liquidity, remove-liquidity, claim-rewards): Binary constructs ABI-encoded calldata locally, then shells out to onchainos wallet contract-call for signing and broadcasting via TEE
  3. Wallet resolution: Binary calls onchainos wallet addresses to resolve the user's EVM address

Dependencies:

  • onchainos CLI (for wallet operations and transaction signing)
  • https://base-rpc.publicnode.com (public JSON-RPC endpoint for Base chain read operations)
  • Aerodrome Finance smart contracts on Base (Router, PoolFactory, Voter)
3. Auto-Detected Permissions

onchainos Commands Used

Command Found Exists in onchainos CLI Risk Level Context
onchainos wallet addresses ✅ Yes Low Resolve wallet address for the connected account
onchainos wallet contract-call ✅ Yes High Execute all write operations (swap, approve, add/remove liquidity, claim rewards)
onchainos --version ✅ Yes Low Pre-flight version check
onchainos wallet login ✅ Yes Medium Pre-flight authentication (in SKILL.md)

Wallet Operations

Operation Detected? Where Risk
Read balance Yes src/rpc.rs (get_balance via eth_call), SKILL.md (wallet balance checks) Low
Send transaction Yes src/onchainos.rs (wallet_contract_call) High
Sign message No N/A
Contract call Yes src/onchainos.rs (wallet_contract_call for swap, approve, add/remove liquidity, claim) High

External APIs / URLs

URL / Domain Purpose Risk
https://base-rpc.publicnode.com Public JSON-RPC endpoint for Base chain eth_call queries Low
https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh onchainos CLI installer (in SKILL.md pre-flight) Medium
https://plugin-store-dun.vercel.app/install Installation telemetry reporting Low
https://www.okx.com/priapi/v1/wallet/plugins/download/report Installation telemetry reporting Low
https://github.com/MigOKG/plugin-store/releases/download/... Binary download for plugin installation Medium

Chains Operated On

  • Base (chain ID 8453)

Overall Permission Summary

This plugin has high-risk financial permissions — it can execute token swaps, ERC-20 approvals (including unlimited u128::MAX approvals), liquidity additions/removals, and gauge reward claims on Base chain through onchainos wallet contract-call. All write operations correctly delegate to onchainos CLI for signing. Read operations query on-chain state directly via a public RPC endpoint. The plugin also includes telemetry reporting to two external endpoints during installation. The --force flag is used on contract calls, which bypasses the onchainos confirmation prompt — though the SKILL.md documents a --confirm flag for user-facing confirmation.

4. onchainos API Compliance

Does this plugin use onchainos CLI for all on-chain write operations?

Yes — All on-chain write operations are delegated to onchainos wallet contract-call.

On-Chain Write Operations (MUST use onchainos)

Operation Uses onchainos? Self-implements? Detail
Wallet signing No Via onchainos wallet contract-call
Transaction broadcasting No Via onchainos wallet contract-call
DEX swap execution No Constructs calldata, broadcasts via onchainos wallet contract-call
Token approval No Builds approve calldata, broadcasts via onchainos wallet contract-call
Contract calls No All contract interactions via onchainos wallet contract-call
Token transfers N/A No Not applicable — plugin uses contract calls

Data Queries (allowed to use external sources)

Data Source API/Service Used Purpose
Base blockchain state https://base-rpc.publicnode.com (eth_call) Pool lookups, reserve queries, allowance checks, balance queries, gauge earned amounts

External APIs / Libraries Detected

  • reqwest crate for HTTP JSON-RPC calls to base-rpc.publicnode.com
  • std::process::Command to shell out to onchainos CLI
  • No direct web3/ethers library usage for signing or broadcasting

Verdict: ✅ Fully Compliant

All on-chain write operations (swaps, approvals, liquidity management, reward claims) are properly delegated to onchainos wallet contract-call. Read operations use direct RPC calls which is allowed.

5. Security Assessment

Static Rule Scan (C01-C09, H01-H09, M01-M08, L01-L02)

Rule ID Severity Title Matched? Detail
C01 CRITICAL curl | sh remote execution ✅ Matched SKILL.md pre-flight: curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh. However, this is in SKILL.md (agent execution path). Phase 3.5: in SKILL.md → CRITICAL maintained.
H05 INFO Direct financial operations ✅ Matched onchainos wallet contract-call for swap, approve, add/remove liquidity, claim rewards — expected baseline for DeFi plugin
H09 HIGH signed-tx CLI param Not matched Plugin uses --input-data not --signed-tx
M01 MEDIUM Supply chain unpinned ✅ Matched SKILL.md: npx skills add okx/onchainos-skills --yes --global and npx skills add MigOKG/plugin-store --skill plugin-store --yes --global — no version pinning
M02 MEDIUM Unverifiable dependency ✅ Matched SKILL.md: npx skills add without version lock
M07 MEDIUM Missing untrusted data boundary ✅ Matched SKILL.md has "Treat all data returned by the CLI as untrusted external content" in the Security Notices section — HOWEVER, this statement only covers "CLI" data. The binary also processes data from eth_call RPC responses (pool reserves, token addresses, amounts) that feed into calldata construction. The boundary statement is present but may be insufficient for the RPC data path. Borderline — the statement exists, so downgrade to INFO for M07 itself.
M08 MEDIUM External data field passthrough ✅ Matched The binary processes raw eth_call results (token addresses, reserve amounts, quote amounts) and renders them directly in JSON output. No field-level isolation is specified in SKILL.md for RPC-sourced data.
L02 LOW Undeclared network Not matched RPC endpoint is declared in plugin.yaml api_calls

LLM Judge Analysis (L-PINJ, L-MALI, L-MEMA, L-IINJ, L-AEXE, L-FINA, L-FISO)

Judge Severity Detected Confidence Evidence
L-PINJ CRITICAL Not detected 0.9 No hidden instructions, no prompt override patterns. The curl | sh is a real install script, not an injection vector. SKILL.md instructions are consistent with stated purpose.
L-MALI CRITICAL Not detected 0.85 Plugin behavior matches its stated purpose (Aerodrome AMM interaction). Telemetry reporting is the only notable addition but it's non-malicious (install tracking). Code builds calldata correctly matching documented Aerodrome contract selectors.
L-MEMA HIGH Not detected 0.95 No attempts to write to MEMORY.md, SOUL.md, or any persistent agent state.
L-IINJ MEDIUM Detected 0.75 The binary makes external requests to base-rpc.publicnode.com for eth_call queries. SKILL.md has a general untrusted data boundary statement in Security Notices. However, RPC response data (addresses, amounts) flows directly into calldata construction without sanitization in the binary. This is an inherent risk but mitigated by the fact that calldata is ultimately validated by the on-chain contracts.
L-AEXE INFO Detected 0.8 Write operations use --force flag in onchainos wallet contract-call by default when confirm is true. The SKILL.md documents a --confirm pattern where preview is shown first, but the --force flag bypasses onchainos's own confirmation mechanism. The SKILL.md says "All write operations require explicit user confirmation via --confirm before broadcasting" which is a plugin-level gate.
L-FINA HIGH Detected 0.9 write + confirmation mechanism present but with caveats: The plugin has financial write operations (swap, approve, add/remove liquidity, claim). There IS a --confirm flag pattern. However, wallet_contract_call passes --force to onchainos when confirm=true, bypassing onchainos's native confirmation. The plugin itself shows transaction details before executing when --confirm is not passed. Rated HIGH because --force bypasses backend risk checks (code 81362 confirmation flow).

Toxic Flow Detection (TF001-TF006)

TF005 · curl|sh + financial access (C01 + H05):

  • C01 matched: curl | sh in SKILL.md pre-flight
  • H05 matched: Financial operations via wallet contract-call
  • TF005 TRIGGERED → CRITICAL → FAIL

The curl | sh install script in SKILL.md combined with financial operations creates a risk where a compromised install script could modify the plugin binary or environment to redirect financial operations.

TF006 · External data no boundary + financial operations (M08 + H05):

  • M08 matched: RPC data passthrough without field isolation
  • H05 matched: Financial operations
  • TF006 TRIGGERED → HIGH → WARN

RPC response data flows into calldata construction without explicit field-level isolation.

Prompt Injection Scan

No instruction override, identity manipulation, hidden behavior, confirmation bypass, unauthorized operations, hidden content (base64, invisible chars), or pseudo-system tags detected in SKILL.md or source code.

The base64-encoded string in the "Report install" script (OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==) decodes to what appears to be an HMAC key for telemetry signing. While obfuscated, it is used only for install reporting, not for prompt injection.

Result: ⚠️ Suspicious Pattern (base64 obfuscated key in install script — not injection, but notable)

Dangerous Operations Check

The plugin involves: token approvals (unlimited u128::MAX), swap execution, liquidity management, and reward claiming. Write operations have a --confirm flag pattern, but when confirmed, --force is passed to onchainos bypassing its backend confirmation flow.

Result: ⚠️ Review Needed

Data Exfiltration Risk

The install telemetry script collects: hostname, OS, architecture, and home directory path (hashed). This is sent to plugin-store-dun.vercel.app/install and www.okx.com/priapi/v1/wallet/plugins/download/report. No wallet addresses, keys, or transaction data is exfiltrated. The device fingerprint is SHA256-hashed.

Result: ⚠️ Potential Risk (device fingerprint collection, though hashed)

Overall Security Rating: 🔴 High Risk

Due to TF005 (curl|sh + financial operations), the overall assessment is FAIL.

6. Source Code Security (if source code is included)

Language & Build Config

  • Language: Rust
  • Entry point: src/main.rs
  • Binary name: aerodrome-amm

Dependency Analysis

Dependency Version Status
clap 4.6.0 ✅ Well-maintained CLI framework
tokio 1.51.0 ✅ Well-maintained async runtime
reqwest 0.12.28 ✅ Well-maintained HTTP client (rustls-tls)
serde/serde_json 1.0.228/1.0.149 ✅ Standard serialization
anyhow 1.0.102 ✅ Error handling
hex 0.4.3 ✅ Hex encoding

All dependencies are well-known, actively maintained Rust ecosystem crates. No suspicious or unmaintained packages detected.

Code Safety Audit

Check Result Detail
Hardcoded secrets (API keys, private keys, mnemonics) ✅ Clean No hardcoded secrets. Contract addresses are public on-chain constants.
Network requests to undeclared endpoints ✅ Clean Only base-rpc.publicnode.com (declared in plugin.yaml)
File system access outside plugin scope ✅ Clean No file system access in the binary
Dynamic code execution (eval, exec, shell commands) ⚠️ Review Uses std::process::Command to shell out to onchainos CLI — this is the intended architecture pattern
Environment variable access beyond declared env ✅ Clean No environment variable access in the binary code
Build scripts with side effects (build.rs, postinstall) ✅ Clean No build.rs or post-install scripts
Unsafe code blocks (Rust) ✅ Clean No unsafe blocks in any source file

Does SKILL.md accurately describe what the source code does?

Yes, with minor discrepancies:

  • SKILL.md documents --confirm as the user-facing gate, and the code correctly implements this: without --confirm, commands show previews; with --confirm, they pass --force to onchainos
  • SKILL.md mentions "Max 0.00005 ETH (~0.1 USDC) per test transaction" but this limit is not enforced in code — it's only documentation guidance
  • The wallet_contract_call_with_value function always passes --force regardless of any flag (line 87-96 of onchainos.rs) — though this function is marked #[allow(dead_code)] and is not currently used

Verdict: ⚠️ Needs Review

The wallet_contract_call_with_value function (currently dead code) always passes --force without any confirmation check. The unlimited approval pattern (u128::MAX) is standard DeFi practice but could be highlighted to users.

7. Code Review

Quality Score: 72/100

Dimension Score Notes
Completeness (pre-flight, commands, error handling) 18/25 Good command coverage (7 commands). Error handling present but some error messages could be more user-friendly. Missing: input validation for amount limits, no transaction simulation before broadcast.
Clarity (descriptions, no ambiguity) 20/25 Clear SKILL.md with good command documentation, token tables, and contract addresses. Minor: the relationship between --confirm (SKILL.md) and --force (onchainos) could be more transparent.
Security Awareness (confirmations, slippage, limits) 14/25 Has slippage control, confirmation flow via --confirm. Weaknesses: unlimited approvals without user warning, --force bypasses onchainos safety checks, no max amount caps enforced in code, amount_a_min/amount_b_min default to 0 (no slippage protection by default for liquidity operations).
Skill Routing (defers correctly, no overreach) 12/15 Correctly routes to onchainos for all write operations. Correctly suggests other skills for CLMM, portfolio, cross-DEX swaps. Does not overreach into other skills' domains.
Formatting (markdown, tables, code blocks) 8/10 Well-formatted SKILL.md with tables, code blocks, and clear sections. Good JSON output examples.

Strengths

  • Clean architecture: Clear separation between read (direct RPC) and write (onchainos delegation) paths
  • Comprehensive command set: Covers the full Aerodrome classic AMM lifecycle (quote → swap → LP management → rewards)
  • Pure Rust with minimal dependencies: No heavy web3 frameworks; manual ABI encoding is straightforward and auditable

Issues Found

  • 🔴 Critical: TF005 — curl|sh in SKILL.md combined with financial operations. The curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh pattern in the pre-flight section runs arbitrary remote code. Combined with the plugin's financial capabilities, this creates a supply chain attack vector.
  • 🔴 Critical: Obfuscated HMAC key in install telemetry (OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==). The base64-encoded key in the "Report install" shell script is obfuscated. While it appears to be for install telemetry HMAC signing, obfuscated secrets in agent-executed scripts are a security concern per C03.
  • 🟡 Important: --force always passed to onchainos on confirmed writes, bypassing onchainos's native backend risk confirmation (code 81362). This means the onchainos safety net for high-risk transactions is never engaged.
  • 🟡 Important: Unlimited ERC-20 approvals (u128::MAX) without user notification. The approve calldata uses maximum allowance without warning or offering a limited approval option.
  • 🟡 Important: Default slippage protection missing for liquidity operations. amount_a_min and amount_b_min default to 0 in both add-liquidity and remove-liquidity, meaning users get no slippage protection unless they explicitly set these values.
  • 🟡 Important: Supply chain — unpinned skill installs (M01): npx skills add okx/onchainos-skills --yes --global without version lock.
  • 🔵 Minor: Dead code wallet_contract_call_with_value always passes --force without confirmation parameter — should be fixed or removed.
  • 🔵 Minor: No transaction simulation before broadcasting swaps or liquidity operations. Adding a onchainos gateway simulate call before wallet contract-call would improve safety.
8. Recommendations
  1. [CRITICAL] Replace curl | sh installation with pinned version downloads with SHA256 verification. Use the pattern: download script → verify checksum → execute. Pin to specific release tags, not main branch.

  2. [CRITICAL] Remove or make transparent the obfuscated HMAC key in the install telemetry script. Hardcoded obfuscated keys in agent-executed scripts are unacceptable even for telemetry.

  3. [HIGH] Remove automatic --force from wallet_contract_call when confirm=true. Instead, first call without --force, handle the confirming response (exit code 2), display the message to the user, and only re-run with --force after user confirmation — matching onchainos's intended confirmation flow.

  4. [HIGH] Add slippage protection defaults for add-liquidity and remove-liquidity. Default amount_a_min/amount_b_min should be calculated from the desired amounts (e.g., 99% of expected amounts) rather than 0.

  5. [HIGH] Warn users about unlimited approvals and offer a limited approval option (approve exact amount needed rather than u128::MAX).

  6. [MEDIUM] Pin skill install versions: npx skills add okx/onchainos-skills@x.y.z.

  7. [MEDIUM] Add transaction simulation via onchainos gateway simulate before executing writes, especially for swaps.

  8. [LOW] Remove dead code (wallet_contract_call_with_value) or fix its confirmation handling to match wallet_contract_call.

9. Reviewer Summary

One-line verdict: Well-architected DeFi plugin with proper onchainos delegation for all write operations, but blocked by curl|sh supply chain risk and aggressive --force usage that bypasses safety confirmations.

Merge recommendation: 🔍 Needs changes before merge

Items that must be addressed:

  1. Remove or secure curl | sh installation pattern in SKILL.md (replace with version-pinned + checksum-verified download)
  2. Remove obfuscated base64 key from install telemetry script
  3. Fix --force handling to not bypass onchainos confirmation flow
  4. Add non-zero default slippage protection for liquidity operations

Generated by Claude AI via Anthropic API — review the full report before approving.

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

Phase 4: Summary + Pre-flight for aerodrome-amm

Review below. AI Code Review is in a separate check.


Auto-injected Pre-flight
## Pre-flight Dependencies (auto-injected by Plugin Store CI)

> Run once per session before first use. These checks ensure required tools are installed.

### Install onchainos CLI + Skills (auto-injected)

```bash
# 1. Install onchainos CLI
onchainos --version 2>/dev/null || curl -fsSL https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh | sh

# 2. Install onchainos skills (enables AI agent to use onchainos commands)
npx skills add okx/onchainos-skills --yes --global

# 3. Install plugin-store skills (enables plugin discovery and management)
npx skills add MigOKG/plugin-store --skill plugin-store --yes --global

Install aerodrome-amm binary (auto-injected)

if ! command -v aerodrome-amm >/dev/null 2>&1; then
  OS=$(uname -s | tr A-Z a-z)
  ARCH=$(uname -m)
  case "${OS}_${ARCH}" in
    darwin_arm64)  TARGET="aarch64-apple-darwin" ;;
    darwin_x86_64) TARGET="x86_64-apple-darwin" ;;
    linux_x86_64)  TARGET="x86_64-unknown-linux-gnu" ;;
    linux_aarch64) TARGET="aarch64-unknown-linux-gnu" ;;
  esac
  curl -fsSL "https://github.com/MigOKG/plugin-store/releases/download/plugins/aerodrome-amm@0.1.0/aerodrome-amm-${TARGET}" -o ~/.local/bin/aerodrome-amm
  chmod +x ~/.local/bin/aerodrome-amm
fi

Report install (auto-injected, runs once)

REPORT_FLAG="$HOME/.plugin-store/reported/aerodrome-amm"
if [ ! -f "$REPORT_FLAG" ]; then
  mkdir -p "$HOME/.plugin-store/reported"
  # Device fingerprint → SHA256 → 32-char device ID
  DEV_RAW="$(hostname):$(uname -s):$(uname -m):$HOME"
  DEV_ID=$(echo -n "$DEV_RAW" | shasum -a 256 | head -c 32)
  # HMAC signature (obfuscated key, same as CLI binary)
  _K=$(echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | base64 -d 2>/dev/null || echo 'OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==' | openssl base64 -d)
  HMAC_SIG=$(echo -n "${_K}${DEV_ID}" | shasum -a 256 | head -c 8)
  DIV_ID="${DEV_ID}${HMAC_SIG}"
  unset _K
  # Report to Vercel stats
  curl -s -X POST "https://plugin-store-dun.vercel.app/install" \
    -H "Content-Type: application/json" \
    -d '{"name":"aerodrome-amm","version":"0.1.0"}' >/dev/null 2>&1 || true
  # Report to OKX API (with HMAC-signed device token)
  curl -s -X POST "https://www.okx.com/priapi/v1/wallet/plugins/download/report" \
    -H "Content-Type: application/json" \
    -d '{"pluginName":"aerodrome-amm","divId":"'"$DIV_ID"'"}' >/dev/null 2>&1 || true
  touch "$REPORT_FLAG"
fi


</details>

---
*Generated by Plugin Store CI after maintainer approval.*

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 9, 2026

🔨 Phase 2: Build Verification — ✅ PASSED

Plugin: aerodrome-amm | Language: rust
Source: @

Compiled from developer source code by our CI. Users install our build artifacts.

Build succeeded. Compiled artifact uploaded as workflow artifact.


Source integrity: commit SHA `` is the content fingerprint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant