fix(polymarket): bump source_commit to k256 signing + fix SKILL.md#235
fix(polymarket): bump source_commit to k256 signing + fix SKILL.md#235skylavis-sky wants to merge 407 commits intoMigOKG:mainfrom
Conversation
[new-plugin] aerodrome-amm v0.1.0
[new-plugin] balancer-v2 v0.1.0
[new-plugin] camelot-v3 v0.1.0
[new-plugin] beefy v0.1.0
[new-plugin] compound-v2 v0.1.0
[new-plugin] dolomite v0.1.0
[new-plugin] fluid v0.1.0
[new-plugin] frax-ether v0.1.0
[new-plugin] gmx-v1 v0.1.0
[new-plugin] instadapp v0.1.0
[new-plugin] jito v0.1.0
[new-plugin] kamino-lend v0.1.0
[new-plugin] kamino-liquidity v0.1.0
[new-plugin] kelp v0.1.0
[new-plugin] moonwell v0.1.0
[new-plugin] morpho-base v0.1.0
fix(polymarket): add missing .claude-plugin/plugin.json
1. Registry regenerated from all skills/ directories — was 52, now 86. aave-v3 and 33 other plugins were missing because the old merge logic split plugins into OFFICIAL/COMMUNITY buckets and new plugins that weren't in either bucket got dropped. 2. Simplified registry merge: use generated entries as the source of truth, only preserving link/extra fields from existing entries. No more OFFICIAL/COMMUNITY split that loses new plugins. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…verability SKILL.md was nested at skills/polymarket/skills/polymarket/SKILL.md but the store requires it at skills/polymarket/SKILL.md. Update plugin.yaml components.skill.dir from "skills/polymarket" to "." to match. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
fix(polymarket): move SKILL.md to root for skill discoverability
Points to b126c9e4 in skylavis-sky/onchainos-plugins: - Local k256 signing key auto-generated on first run (no private key from user) - Auto-derives CLOB API credentials from signing key - Windows build fix: #[cfg(unix)] gates on file permission APIs - SKILL.md updated to document the new auth flow accurately Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Phase 4: Summary + Pre-flight for
|
| Command | Description |
|---|---|
polymarket list-markets [--limit N] [--keyword text] |
Browse active prediction markets |
polymarket get-market --market-id <id> |
Get market details and order book |
polymarket get-positions [--address addr] |
View open positions with P&L |
polymarket buy --market-id <id> --outcome <yes/no> --amount <usdc> [--price price] |
Buy YES or NO shares |
polymarket sell --market-id <id> --outcome <yes/no> --shares <amount> [--price price] |
Sell existing shares |
polymarket cancel --order-id <id> |
Cancel specific order |
polymarket cancel --market <id> |
Cancel all orders for market |
polymarket cancel --all |
Cancel all open orders |
Triggers
Activate when users want to trade prediction markets, check positions, browse markets, or manage orders on Polymarket. Common trigger phrases include "buy polymarket shares," "sell polymarket position," "check my polymarket positions," or "list polymarket markets."
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 polymarket binary (auto-injected)
if ! command -v polymarket >/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/polymarket@0.1.0/polymarket-${TARGET}" -o ~/.local/bin/polymarket
chmod +x ~/.local/bin/polymarket
fiReport install (auto-injected, runs once)
REPORT_FLAG="$HOME/.plugin-store/reported/polymarket"
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":"polymarket","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":"polymarket","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: 72/100
1. Plugin Overview
Summary: This plugin enables trading on Polymarket prediction markets via Polygon. Users can browse markets, buy/sell YES/NO outcome tokens using USDC.e, check positions, and manage orders. The plugin uses a local k256 signing key for EIP-712 order signatures and delegates on-chain approvals to Target Users: Crypto traders interested in prediction markets who want to trade Polymarket outcome tokens 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 financial operation capabilities. It can trigger on-chain token approval transactions (both ERC-20 USDC.e 4. onchainos API ComplianceDoes this plugin use onchainos CLI for all on-chain write operations?Yes — On-chain approvals use 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)TF006 · External data no boundary + financial operations:
No toxic flows detected. Prompt Injection Scan
Result: ✅ Clean Dangerous Operations Check
Result: Data Exfiltration Risk
Result: ✅ No Risk Overall Security Rating: 🟡 Medium RiskKey concerns:
6. Source Code Security (if source code is included)Source code is not directly included in the submission. The binary is built from an external repo ( Language & Build Config
Dependency AnalysisCannot be fully audited without source access. Based on SKILL.md:
Code Safety Audit
Does SKILL.md accurately describe what the source code does?Cannot fully verify without source code access. The SKILL.md description of the architecture (local k256 signing, CLOB API interaction, onchainos contract-call for approvals) is internally consistent and technically plausible. Verdict:
|
| Dimension | Score | Notes |
|---|---|---|
| Completeness (pre-flight, commands, error handling) | 19/25 | Good command coverage with 6 commands, pre-flight checks present. Missing: no error code reference table, no explicit retry guidance for failed orders, no guidance for market resolution scenarios. |
| Clarity (descriptions, no ambiguity) | 20/25 | Well-structured command documentation with clear flag tables and examples. Architecture overview is helpful. Some ambiguity: "auto-generated on first run" — what happens if key is lost? No recovery procedure documented. |
| Security Awareness (confirmations, slippage, limits) | 16/25 | Good: untrusted data boundary declared, field-level output filtering specified, --force usage documented with warnings. Concerning: --force on approvals with only agent-level confirmation gate, no maximum amount limits, no explicit slippage warnings for FOK orders, no warning about prediction market resolution risk. |
| Skill Routing (defers correctly, no overreach) | 12/15 | Clear "Do NOT use for" section. Correctly defers to onchainos for wallet operations. Missing: no explicit routing to okx-security for contract verification before approvals. |
| Formatting (markdown, tables, code blocks) | 5/10 | Generally well-formatted. Some issues: empty sections (two --- separators with no content after the pre-flight block), inconsistent heading hierarchy. |
Strengths
- Well-documented architecture: Clear explanation of how local signing, CLOB API interaction, and on-chain approvals work together
- Security boundary declaration: Explicit untrusted data boundary and field-level output filtering guidance
- Correct onchainos usage: On-chain operations properly delegated to
onchainos wallet contract-call
Issues Found
-
🔴 Critical:
curl | shinstall command for onchainos CLI uses unpinnedmainbranch URL (https://raw.githubusercontent.com/okx/onchainos-skills/main/install.sh). This is a supply chain risk — the script could be modified at any time. Must pin to a specific release tag with SHA256 verification. -
🔴 Critical: The
--forceflag is used unconditionally ononchainos wallet contract-callfor approval transactions. This bypasses the backend confirmation mechanism (code 81362). While documented, this creates a single point of failure where only the agent's interpretation of user intent prevents potentially unlimited token approvals. The SKILL.md should either: (a) not use--forceand handle the confirming response properly, or (b) implement explicit amount caps on approvals. -
🟡 Important: Base64-obfuscated HMAC key in the install telemetry block (
OE9nNWFRUFdfSVJkektrMExOV2RNeTIzV2JibXo3ZWNTbExJUDFIWnVoZw==) reduces transparency. While used for device ID signing (not code execution), this pattern triggers C03 and makes security review harder. The key should be documented in plaintext with its purpose explained. -
🟡 Important: Binary download in install block has no checksum verification:
curl -fsSL "https://github.com/MigOKG/plugin-store/releases/download/plugins/polymarket@0.1.0/polymarket-${TARGET}" -o ~/.local/bin/polymarket. Should include SHA256 verification similar to onchainos's own install process. -
🟡 Important:
npx skills add okx/onchainos-skills --yes --globalandnpx skills add MigOKG/plugin-store --skill plugin-store --yes --global— both unpinned. Should specify exact versions. -
🟡 Important: No maximum approval amount specified for USDC.e approve — the plugin may approve unlimited USDC.e to the CTF Exchange contract. Should use exact-amount approvals matching the trade size.
-
🔵 Minor: Empty content blocks in SKILL.md (lines with just
---separators) create visual clutter. -
🔵 Minor: No explicit guidance on what happens if the local signing key at
~/.config/polymarket/signing_key.hexis lost or corrupted — users would lose their Polymarket trading identity. -
🔵 Minor: Source commit in plugin.yaml (
b126c9e41339ee2aaf7498288f5846d6750bade5) differs from the one mentioned in SKILL.md Overview (bc1629f2). These should match.
8. Recommendations
-
Pin all install URLs to specific release tags — Replace
mainbranch URL with a versioned tag (e.g.,v1.0.5) and add SHA256 checksum verification for the install script. -
Remove
--forcefrom approval transactions or implement amount caps — Either handle the confirming response flow properly (display confirmation to user, only add--forceafter explicit user consent), or implement exact-amount approvals that match the trade size rather than unlimited approvals. -
Add checksum verification for binary download — Include a checksums.txt file and verify the binary SHA256 before marking it executable.
-
Pin dependency versions — Use
npx skills add okx/onchainos-skills@x.y.zwith specific versions. -
Replace base64-obfuscated HMAC key with plaintext — Document the telemetry signing key openly with its purpose. The obfuscation provides no real security (the base64 is trivially decoded) but triggers security scanner alerts.
-
Add explicit approval amount limits — Document and implement exact-amount USDC.e approvals matching trade size, rather than potentially unlimited approvals.
-
Reconcile source commit references — Ensure plugin.yaml
source_commitmatches the commit referenced in SKILL.md. -
Add signing key recovery guidance — Document what happens if
signing_key.hexis lost and how users can recover their Polymarket trading identity.
9. Reviewer Summary
One-line verdict: A well-structured Polymarket trading plugin with correct onchainos API usage for on-chain operations, but has supply chain risks (unpinned installs, unverified binary downloads), a concerning --force flag pattern on approval transactions, and a base64-obfuscated key in telemetry that reduces transparency.
Merge recommendation: 🔍 Needs changes before merge
Required changes:
- Pin install script URL to a specific release tag and add SHA256 verification
- Add checksum verification for the polymarket binary download
- Either remove
--forcefrom approvalcontract-callinvocations (handling the confirming flow properly) or implement exact-amount approvals with documented caps - Pin
npx skills adddependencies to specific versions - Replace base64-obfuscated HMAC key with plaintext documentation
- Fix source commit mismatch between plugin.yaml and SKILL.md
Generated by Claude AI via Anthropic API — review the full report before approving.
✅ Phase 1: Structure Validation — PASSED→ Proceeding to Phase 2: Build Verification |
Replaces outdated credential setup docs (py-clob-client / manual env vars) with the current auto-generated local k256 signing key flow. Keeps auto-injected pre-flight block, replaces everything after with content from the updated source (onchainos-plugins@b126c9e4). Key changes: - Architecture: local k256 signing, no onchainos wallet sign-message - Removed "Known limitation" block — EIP-712 issue is fixed - Pre-flight check 3: signing_key.hex instead of env var check - Auth required: local signing key (auto-generated) instead of env vars - Credential Setup: auto-derivation flow, no py-clob-client, no private key - Env vars: optional overrides, not required setup - Source code commit reference updated to b126c9e4 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Summary
source_committob126c9e41339ee2aaf7498288f5846d6750bade5inskylavis-sky/onchainos-plugins~/.config/polymarket/creds.json#[cfg(unix)]gates all Unix file permission APIsSource PRs
🤖 Generated with Claude Code