agentleFS
kukapaykukapay/crypto-skills/skills/evm-swiss-knife/SKILL.md

evm-swiss-knife

Skill36 starsChanged 10 months agoMITView on GitHub

Interact with EVM-compatible blockchains using Foundry's cast tool for querying balances, calling contracts, sending transactions, and blockchain exploration. Use when needing to interact with Ethereum Virtual Machine networks via command-line, including reading contract state, sending funds, executing contract functions, or inspecting blockchain data.

  • Pipes a download into a shell
  • Reads credentials

The file

Show its rules and text

We split this skill into the rules it gives an agent

14 rules. About 0 are common, 13 are distinctive, and 1 is very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈13

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 1

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Follow the official installation guide: https://getfoundry.sh/introduction/installation

    line 14
  2. Distinctive:

    Look for RPC URLs that are:

    line 57
  3. Distinctive:

    Public and free: No API keys required

    line 58
  4. Distinctive:

    No or limited tracking: Avoid URLs with "tracking": "yes"

    line 59
  5. Distinctive:

    Fast and reliable: Prefer URLs with low latency or high score

    line 60
  6. Distinctive:

    Open source: Prefer community-maintained endpoints

    line 61
  7. Distinctive:

    Always verify the chain ID matches your intended network to avoid connecting to wrong chains.

    line 71
  8. Distinctive:

    Call a view/pure function:

    line 89
  9. Distinctive:

    Call contract function (write):

    line 106
  10. Distinctive:

    Use shell loops for multiple queries:

    line 171
  11. Distinctive:

    Never expose private keys in scripts or logs

    line 192
  12. Distinctive:

    Use environment variables for sensitive data

    line 193
  13. Distinctive:

    Test on testnets before mainnet operations

    line 194
  14. Distinctive:

    Verify contract addresses and function signatures

    line 195

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

EVM Swiss Knife

This skill enables interaction with EVM-compatible blockchains through Foundry's cast command-line tool. It covers common blockchain operations like balance queries, contract calls, transaction sending, and network inspection.

Installation

To use this skill, you need Foundry installed, which provides the cast command.

Follow the official installation guide: https://getfoundry.sh/introduction/installation

Quick Install (Linux/Mac)

  1. Install Foundryup:
    curl -L https://foundry.paradigm.xyz | bash
  2. Source your shell configuration or start a new terminal:
    source ~/.bashrc  # or ~/.zshrc
  3. Install Foundry:
    foundryup
  4. Verify installation:
    cast --version

For other platforms or detailed instructions, see the full guide at https://getfoundry.sh/introduction/installation

Prerequisites

  • Foundry installed (cast command available)
  • RPC endpoint configured (via --rpc-url or environment variables)
  • Private key for transaction operations (if sending txs)

RPC URL Selection

To interact with different EVM networks, you need reliable RPC endpoints. Use ChainList's API at https://chainlist.org/rpcs.json to get a comprehensive JSON list of RPC URLs for all supported chains.

How to Select RPC URLs:

  1. Fetch the RPC data:
    curl -s https://chainlist.org/rpcs.json | jq '.[] | select(.chainId == 1)'  # For Ethereum (chain ID 1)
  2. Look for RPC URLs that are:
    • Public and free: No API keys required
    • No or limited tracking: Avoid URLs with "tracking": "yes"
    • Fast and reliable: Prefer URLs with low latency or high score
    • Open source: Prefer community-maintained endpoints
  3. Popular choices (extracted from ChainList):
  4. For production use, consider paid RPC services like Alchemy, Infura, or QuickNode for higher reliability and rate limits.
  5. Always verify the chain ID matches your intended network to avoid connecting to wrong chains.

Common Operations

Query Account Balance

Get ETH balance of an address:

cast balance <address> --rpc-url <rpc_url>

Get ERC20 token balance:

cast call <token_contract> "balanceOf(address)(uint256)" <address> --rpc-url <rpc_url>

Call Contract Functions (Read-Only)

Call a view/pure function:

cast call <contract_address> "<function_signature>" [args...] --rpc-url <rpc_url>

Example - get token total supply:

cast call 0xA0b86a33E6441e88C5F2712C3E9b74B6F3f5a8b8 "totalSupply()(uint256)" --rpc-url <rpc_url>

Send Transactions

Send ETH:

cast send --private-key <pk> --rpc-url <rpc_url> <to_address> --value <amount_in_wei>

Call contract function (write):

cast send --private-key <pk> --rpc-url <rpc_url> <contract_address> "<function_signature>" [args...]

Blockchain Inspection

Get latest block number:

cast block-number --rpc-url <rpc_url>

Get block details:

cast block <block_number> --rpc-url <rpc_url>

Get transaction details:

cast tx <tx_hash> --rpc-url <rpc_url>

Contract Deployment

Deploy a contract:

cast send --private-key <pk> --rpc-url <rpc_url> --create <bytecode> [constructor_args...]

Decoding Data

Decode hex data:

cast --to-ascii <hex_string>
cast --to-dec <hex_string>

Network-Specific Examples

Ethereum Mainnet

export ETH_RPC_URL=https://eth-mainnet.alchemyapi.io/v2/YOUR_API_KEY
cast balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

Polygon

cast balance <address> --rpc-url https://polygon-rpc.com/

Local Development (Anvil)

cast balance <address> --rpc-url http://127.0.0.1:8545

Error Handling

  • RPC errors: Check endpoint URL and network connectivity
  • Insufficient funds: Ensure account has enough ETH for gas + value
  • Contract errors: Verify function signatures and parameter types
  • Private key errors: Ensure correct format (0x prefixed hex)

Advanced Usage

Batch Operations

Use shell loops for multiple queries:

for addr in addr1 addr2 addr3; do
  echo "Balance of $addr: $(cast balance $addr --rpc-url $RPC_URL)"
done

Gas Estimation

Estimate gas for a transaction:

cast estimate --rpc-url <rpc_url> <to_address> --value <amount>

ABI Interactions

For complex contracts, save ABI to file and use:

cast call --abi <abi_file> <contract> <function> [args...]

Security Notes

  • Never expose private keys in scripts or logs
  • Use environment variables for sensitive data
  • Test on testnets before mainnet operations
  • Verify contract addresses and function signatures
  • Monitor gas prices for transaction timing

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.