[new-plugin] pancakeswap-v2 v0.1.0#173
Conversation
Phase 4: Summary + Pre-flight for
|
| Command | Purpose |
|---|---|
quote |
Get expected swap output amounts |
swap |
Execute token swaps with slippage protection |
add-liquidity |
Provide liquidity to earn trading fees |
remove-liquidity |
Withdraw liquidity and LP tokens |
get-pair |
Look up pair contract addresses |
get-reserves |
Check current pool reserves and ratios |
lp-balance |
View LP token balances for specific pairs |
Triggers
Activate when users mention PancakeSwap V2 operations like "pancake swap", "pcs v2", "add liquidity pancakeswap", or want to trade/provide liquidity on BSC/Base AMM pools. Do not use for PancakeSwap V3 or concentrated liquidity operations.
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 --globalInstall pancakeswap-v2 binary (auto-injected)
if ! command -v pancakeswap-v2 >/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/pancakeswap-v2@0.1.0/pancakeswap-v2-${TARGET}" -o ~/.local/bin/pancakeswap-v2
chmod +x ~/.local/bin/pancakeswap-v2
fiReport install (auto-injected, runs once)
REPORT_FLAG="$HOME/.plugin-store/reported/pancakeswap-v2"
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":"pancakeswap-v2","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":"pancakeswap-v2","divId":"'"$DIV_ID"'"}' >/dev/null 2>&1 || true
touch "$REPORT_FLAG"
fi
</details>
---
*Generated by Plugin Store CI after maintainer approval.*
🔨 Phase 2: Build Verification — ❌ FAILED
Build failed. Check the workflow logs. Source integrity: commit SHA |
📋 Phase 3: AI Code Review Report — Score: 76/100
1. Plugin Overview
Summary: This plugin enables token swaps and full-range liquidity provision on PancakeSwap V2 (constant-product AMM) on BSC and Base chains. It provides read-only operations (quotes, pair lookup, reserves, LP balance) via direct RPC calls and write operations (swap, add/remove liquidity, ERC-20 approvals) via Target Users: DeFi users who want to interact with PancakeSwap V2 pools on BSC or 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 has high-risk permissions: it executes token swaps, manages liquidity positions, and submits ERC-20 approval transactions — all through 4. onchainos API ComplianceDoes this plugin use onchainos CLI for all on-chain write operations?Yes — All write operations (swap, add-liquidity, remove-liquidity, ERC-20 approvals) use On-Chain Write Operations (MUST use onchainos)
Data Queries (allowed to use external sources)
External APIs / Libraries Detected
Verdict: ✅ Fully CompliantAll on-chain write operations (swap, add/remove liquidity, token approvals) are correctly delegated to 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)
No toxic flows detected. Prompt Injection Scan
Result: ✅ Clean Dangerous Operations CheckThe plugin involves: token swaps, liquidity operations, ERC-20 approvals, contract calls. Confirmation mechanisms present:
Concern: All write operations use Result: Data Exfiltration Risk
Result: Overall Security Rating: 🟡 Medium RiskThe plugin is well-structured with proper onchainos CLI delegation and user confirmation workflows. Key concerns are: (1) blanket 6. Source Code SecuritySource code is not included in the submission (external repo reference only). Analysis is based on SKILL.md, plugin.yaml, and declared behavior. Language & Build Config
Dependency AnalysisCannot analyze without access to source code. The build references an external GitHub repository. Code Safety Audit
Does SKILL.md accurately describe what the source code does?Cannot verify — source code not included in submission. SKILL.md describes a coherent architecture (read via RPC, write via onchainos contract-call), but actual binary behavior cannot be confirmed without code review. Verdict:
|
| Dimension | Score | Notes |
|---|---|---|
| Completeness (pre-flight, commands, error handling) | 19/25 | 7 commands well-documented with parameters, examples, execution flows. Missing pre-flight checks section (no install/version verification steps). Troubleshooting table is helpful. |
| Clarity (descriptions, no ambiguity) | 21/25 | Clear command routing table, detailed parameter descriptions, explicit execution flows. Minor ambiguity: "minimal units" conversion guidance could be more explicit for users unfamiliar with token decimals. |
| Security Awareness (confirmations, slippage, limits) | 18/25 | Good: dry-run preview, explicit user confirmation, slippage defaults, deadline defaults, Data Trust Boundary section. Concern: blanket --force on all writes bypasses backend safety. No maximum slippage cap documented. |
| Skill Routing (defers correctly, no overreach) | 13/15 | Clear "Do NOT use for" section. Correctly defers V3 and CLMM to other skills. All writes go through onchainos. No overreach detected. |
| Formatting (markdown, tables, code blocks) | 5/10 | Well-structured markdown with tables and code blocks. Some inconsistency in code block formatting. Missing chain-support shared reference. No references/ directory for CLI details. |
Strengths
- Proper onchainos delegation: All write operations correctly use
onchainos wallet contract-call— no self-implemented signing or broadcasting - User confirmation workflow: Consistent dry-run → confirm → execute pattern across all write operations
- Data Trust Boundary: Explicit untrusted data declaration present, satisfying M07
Issues Found
- 🟡 Important: Blanket
--forceflag usage — All write operations use--forcewhich bypasses onchainos backend confirmation prompts. While the plugin implements its own confirmation UX, this removes a defense-in-depth layer. The SKILL.md instructs "Ask user to confirm" but the--forceflag means the backend will never challenge risky transactions. - 🟡 Important: Unverified third-party endpoint —
https://plugin-store-dun.vercel.app/installis declared inapi_callsbut its purpose, data collection scope, and operator are unclear. This is a Vercel deployment that could be modified at any time. - 🟡 Important: Source code not included — The binary is built from an external repository (
skylavis-sky/onchainos-plugins). Without source code review, the actual binary behavior cannot be verified against SKILL.md claims. - 🔵 Minor: No pre-flight checks section — Unlike official OKX skills, this plugin lacks installation/version verification steps for the onchainos CLI.
- 🔵 Minor: No maximum slippage warning — While slippage defaults to 50 bps, there's no documented maximum or warning for high slippage values that users might set.
- 🔵 Minor: Token address case inconsistency — Token addresses in the symbol table use mixed case (e.g.,
0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c), but onchainos convention requires all lowercase for EVM addresses.
8. Recommendations
-
[High] Submit source code for review — Include the actual Rust source code in the submission or provide verifiable access. The binary behavior must be audited to confirm it matches SKILL.md claims (especially: no self-implemented signing, no hidden endpoints, no data exfiltration).
-
[High] Clarify
plugin-store-dun.vercel.appendpoint — Document what data is sent to this endpoint, who operates it, and whether it can be removed or made optional. Third-party analytics endpoints in DeFi plugins are a supply chain risk. -
[Medium] Reconsider blanket
--forceusage — Consider using--forceonly on retry (after an initial confirming response) rather than on every invocation. This preserves the onchainos backend confirmation as an additional safety layer. Alternative: document explicitly why--forceis always used and what confirmation mechanisms replace the backend check. -
[Medium] Add maximum slippage guard — Document a maximum acceptable slippage (e.g., 5000 bps = 50%) and warn users when setting high values. Consider having the binary reject extreme slippage inputs.
-
[Low] Add pre-flight checks — Include onchainos CLI installation and version verification steps consistent with official skill patterns.
-
[Low] Normalize token addresses to lowercase — Update the token symbol table to use all-lowercase addresses per onchainos convention.
-
[Low] Add field-level output isolation — While the Data Trust Boundary section satisfies M07, consider adding explicit field enumeration instructions (e.g., "Display only: symbolIn, symbolOut, amountOutHuman, fee") to further mitigate M08 concerns.
9. Reviewer Summary
One-line verdict: Well-architected PancakeSwap V2 plugin with proper onchainos CLI delegation for all writes, but requires source code audit and clarification of a third-party analytics endpoint before approval.
Merge recommendation: 🔍 Needs changes before merge
Items that must be addressed:
- Source code must be reviewed — Submit full Rust source or provide auditable access to verify binary behavior matches SKILL.md
- Clarify
plugin-store-dun.vercel.app— Document purpose, data sent, and operator; or remove if non-essential - Address
--forceflag pattern — Either justify the blanket usage with explicit documentation or implement conditional--force(only after user confirmation at the plugin level is verified)
Generated by Claude AI via Anthropic API — review the full report before approving.
New Plugin Submission: pancakeswap-v2 v0.1.0
Plugin: PancakeSwap V2 xyk AMM swaps and liquidity on BSC/Base
Author: skylavis-sky
Category: defi-protocol
Source