← 返回 Skills 市场
apexfork

Ethereum Readonly

作者 J. Campbell · GitHub ↗ · v1.0.0
cross-platform ✓ 安全检测通过
723
总下载
1
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install eth-readonly
功能描述
Read-only Ethereum blockchain queries — blocks, transactions, balances, contracts, logs via RPC and Etherscan APIs
使用说明 (SKILL.md)

Read-Only Ethereum Queries

You are a read-only Ethereum assistant. You help the user query blockchain state, inspect historical data, and explore contracts. This skill is purely for reading data — no wallet required, no transactions sent. Prefer Foundry's cast when available on PATH; otherwise construct raw JSON-RPC calls via curl.

Safety First

This skill is READ-ONLY. No private keys, no wallets, no transaction signing. You can safely explore blockchain data without any risk of spending funds or exposing secrets.

RPC Configuration

Public RPC Endpoints (Instant Access)

Free public endpoints (no API key required):

# Ethereum mainnet
export ETH_RPC_URL="https://ethereum.publicnode.com"
export ETH_RPC_URL="https://rpc.ankr.com/eth" 
export ETH_RPC_URL="https://eth.llamarpc.com"

# Sepolia testnet  
export SEPOLIA_RPC_URL="https://rpc.ankr.com/eth_sepolia"
export SEPOLIA_RPC_URL="https://ethereum-sepolia.publicnode.com"

Major providers (require API keys):

# Infura
export ETH_RPC_URL="https://mainnet.infura.io/v3/${INFURA_PROJECT_ID}"

# Alchemy  
export ETH_RPC_URL="https://eth-mainnet.g.alchemy.com/v2/${ALCHEMY_API_KEY}"

# QuickNode
export ETH_RPC_URL="https://${QUICKNODE_ENDPOINT}.quiknode.pro/${QUICKNODE_TOKEN}/"

Local node (if running your own):

export ETH_RPC_URL="http://localhost:8545"

Usage Pattern

# Use environment variable
cast block-number --rpc-url $ETH_RPC_URL

# Or specify directly
cast balance vitalik.eth --rpc-url https://ethereum.publicnode.com

⚠️ Rate Limits: Public endpoints have limits. Infura free: 100k requests/day. Alchemy free: 300M compute units/month. Use narrow ranges for log queries.

Chain ID Check

Always verify chain before any transaction:

cast chain-id --rpc-url $ETH_RPC_URL

Common chain IDs: 1 (mainnet), 11155111 (sepolia), 17000 (holesky).

Detecting Available Tools

command -v cast && echo "cast available" || echo "using curl fallback"

Querying State

Instant Exploration Examples

Get latest block (no API key needed):

cast block-number --rpc-url https://ethereum.publicnode.com

Check Vitalik's ETH balance:

cast balance vitalik.eth --rpc-url https://ethereum.publicnode.com
# Output: 2139127306712808209 (wei) = ~2139 ETH

Look up a recent transaction:

cast tx 0x... --rpc-url https://ethereum.publicnode.com

Common Query Patterns

# Account balance (using env var)
cast balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --rpc-url $ETH_RPC_URL

# Transaction receipt
cast receipt 0xTXHASH --rpc-url $ETH_RPC_URL

# Contract code
cast code 0xA0b86a33E6441929FD1F423c7ecE8F6DD15fA5E3 --rpc-url $ETH_RPC_URL  # USDC

# ENS resolution
cast resolve-name vitalik.eth --rpc-url $ETH_RPC_URL
cast lookup-address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --rpc-url $ETH_RPC_URL

curl JSON-RPC equivalents:

# Block number
curl -s -X POST https://ethereum.publicnode.com \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","id":1}'

# Balance  
curl -s -X POST $ETH_RPC_URL \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045","latest"],"id":1}'

Nonce (Account Transaction Count)

Useful for debugging stuck or pending transactions:

cast:

# Confirmed nonce
cast nonce 0xADDRESS --rpc-url http://localhost:8545

# Pending nonce (includes mempool txs)
cast nonce 0xADDRESS --block pending --rpc-url http://localhost:8545

curl:

curl -s -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_getTransactionCount","params":["0xADDRESS","latest"],"id":1}'

If confirmed nonce \x3C pending nonce, there are transactions in the mempool. For transaction management and replacement, see the /foundry skill.

Calling Contracts (Read-Only)

cast:

cast call 0xCONTRACT "balanceOf(address)" 0xADDRESS --rpc-url http://localhost:8545

curl (eth_call):

curl -s -X POST http://localhost:8545 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_call","params":[{"to":"0xCONTRACT","data":"0xABI_ENCODED_DATA"},"latest"],"id":1}'

Use cast calldata to ABI-encode function calls when constructing raw data payloads.

Transaction Analysis (Read-Only)

Look up transaction details:

cast tx 0xTXHASH --rpc-url $ETH_RPC_URL
cast receipt 0xTXHASH --rpc-url $ETH_RPC_URL

Decode transaction data:

cast 4byte-decode 0xCALLDATA
cast abi-decode "transfer(address,uint256)" 0xOUTPUT

Gas Price Analysis

Current gas prices:

# Via Etherscan
curl -s "https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=$ETHERSCAN_API_KEY" | jq '.result'

# Via RPC
cast gas-price --rpc-url $ETH_RPC_URL
cast base-fee --rpc-url $ETH_RPC_URL

Event Log Queries

⚠️ REQUIRED: Always specify contract address and narrow block ranges. Full-range queries can exhaust RPC limits instantly.

# Good: specific contract + block range
cast logs 0xA0b86a33E6441929FD1F423c7ecE8F6DD15fA5E3 --from-block 19000000 --to-block 19001000 \
  "Transfer(address,address,uint256)" --rpc-url $ETH_RPC_URL

# BAD: will likely fail on public RPCs
cast logs --from-block 0 --to-block latest "Transfer(address,address,uint256)"

For curl, always include "address": "0xCONTRACT" and specific fromBlock/toBlock in the filter object.

Etherscan API Integration

Setup:

export ETHERSCAN_API_KEY="your_api_key_here"  # Get free key at etherscan.io/apis

Contract Source Code

# Get verified contract source
curl -s "https://api.etherscan.io/api?module=contract&action=getsourcecode&address=0xA0b86a33E6441929FD1F423c7ecE8F6DD15fA5E3&apikey=$ETHERSCAN_API_KEY" | jq '.result[0].SourceCode'

# Check if contract is verified
curl -s "https://api.etherscan.io/api?module=contract&action=getabi&address=0xA0b86a33E6441929FD1F423c7ecE8F6DD15fA5E3&apikey=$ETHERSCAN_API_KEY"

Transaction History

# Get account transactions (latest 10)
curl -s "https://api.etherscan.io/api?module=account&action=txlist&address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&startblock=0&endblock=99999999&page=1&offset=10&sort=desc&apikey=$ETHERSCAN_API_KEY" | jq '.result[] | {hash: .hash, value: .value, gas: .gas}'

# Get ERC-20 token transfers
curl -s "https://api.etherscan.io/api?module=account&action=tokentx&address=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045&page=1&offset=10&sort=desc&apikey=$ETHERSCAN_API_KEY" | jq '.result[] | {tokenName: .tokenName, tokenSymbol: .tokenSymbol, value: .value}'

Gas Tracker

# Current gas prices
curl -s "https://api.etherscan.io/api?module=gastracker&action=gasoracle&apikey=$ETHERSCAN_API_KEY" | jq '.result'

# Output: {"SafeGasPrice": "12", "ProposeGasPrice": "13", "FastGasPrice": "14"}

Block & Network Stats

# Get block by number
curl -s "https://api.etherscan.io/api?module=proxy&action=eth_getBlockByNumber&tag=0x10d4f&boolean=true&apikey=$ETHERSCAN_API_KEY" | jq '.result | {number: .number, timestamp: .timestamp, gasUsed: .gasUsed}'

# Total ETH supply  
curl -s "https://api.etherscan.io/api?module=stats&action=ethsupply&apikey=$ETHERSCAN_API_KEY" | jq '.result'

Rate limits: Free tier: 5 calls/second, 100k calls/day. Pro tier available.

安全使用建议
This skill appears to be what it says: a read-only Ethereum query helper that uses `cast` (preferred) or `curl`. It does not require private keys or wallet access. Before installing: (1) avoid setting wallet private keys or secrets as environment variables for this skill — they are unnecessary; (2) understand optional API keys (Infura/Alchemy/QuickNode/Etherscan) increase request quotas but also mean those providers will see your queries; only provide them if you trust the provider and you understand quota/cost; (3) public RPC endpoints may enforce rate limits or log queries — heavy or broad log queries can fail or consume quotas, as the README warns; (4) because this is instruction-only, there is no code to inspect beyond the documentation — proceed if you trust the skill source or are comfortable with the documented commands.
功能分析
Type: OpenClaw Skill Name: eth-readonly Version: 1.0.0 The skill bundle is classified as benign. The `SKILL.md` explicitly and repeatedly states its read-only nature, emphasizing 'no wallet required, no transactions sent,' and 'no private keys, no wallets, no transaction signing.' All demonstrated commands using `cast`, `curl`, and `jq` are consistent with querying public blockchain data or Etherscan APIs. While `curl` is a powerful tool capable of arbitrary network requests, its usage here is strictly for legitimate blockchain RPC and API interactions, and there are no instructions for data exfiltration, malicious execution, persistence, or prompt injection against the agent. The skill transparently uses environment variables for API keys, but does not attempt to steal or misuse them.
能力评估
Purpose & Capability
Name/description match the runtime instructions. Requiring either `cast` or `curl` is proportionate for making JSON-RPC/Etherscan queries. Examples and RPC provider references align with a read-only explorer utility.
Instruction Scope
SKILL.md stays within read-only operations (RPC calls, logs, contract reads). It shows examples using environment variables for RPC endpoints and API keys (INFURA_PROJECT_ID, ALCHEMY_API_KEY, ETHERSCAN_API_KEY, QUICKNODE_TOKEN) but does not instruct reading unrelated files or secrets. Note: the doc includes examples that assume those optional API keys if the user chooses a provider.
Install Mechanism
No install spec and no code files — instruction-only. This minimizes footprint and disk writes. The required-binaries claim (cast or curl) matches the instructions.
Credentials
The skill does not require any environment variables, but the docs reference several optional provider keys and ETHERSCAN_API_KEY for Etherscan calls. That is expected for optional higher-rate providers, but users should not provision private keys or wallet secrets into environment variables for this skill (they are unnecessary for read-only queries).
Persistence & Privilege
always is false and the skill is user-invocable. There is no indication it modifies agent/system configuration or requests permanent presence. Autonomous invocation is allowed (the platform default) but not a unique risk here.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install eth-readonly
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /eth-readonly 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
- Initial release of eth-readonly skill for read-only Ethereum blockchain queries. - Supports querying blocks, transactions, account balances, contract data, and logs via Foundry's cast or raw JSON-RPC (curl). - Integrates Etherscan API for additional endpoints such as contract source, ABI, transaction history, and gas prices. - No wallet or private keys required — purely read-only; no transactions or signing. - Public and major provider RPC endpoint configuration supported. - Complete usage documentation with example commands for both cast and curl.
元数据
Slug eth-readonly
版本 1.0.0
许可证
累计安装 4
当前安装数 4
历史版本数 1
常见问题

Ethereum Readonly 是什么?

Read-only Ethereum blockchain queries — blocks, transactions, balances, contracts, logs via RPC and Etherscan APIs. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 723 次。

如何安装 Ethereum Readonly?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install eth-readonly」即可一键安装,无需额外配置。

Ethereum Readonly 是免费的吗?

是的,Ethereum Readonly 完全免费(开源免费),可自由下载、安装和使用。

Ethereum Readonly 支持哪些平台?

Ethereum Readonly 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Ethereum Readonly?

由 J. Campbell(@apexfork)开发并维护,当前版本 v1.0.0。

💬 留言讨论