Loading...
Loading...
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.
npx skill4agent add kukapay/crypto-skills evm-swiss-knifecastcastcurl -L https://foundry.paradigm.xyz | bashsource ~/.bashrc # or ~/.zshrcfoundryupcast --versioncast--rpc-urlcurl -s https://chainlist.org/rpcs.json | jq '.[] | select(.chainId == 1)' # For Ethereum (chain ID 1)cast balance <address> --rpc-url <rpc_url>cast call <token_contract> "balanceOf(address)(uint256)" <address> --rpc-url <rpc_url>cast call <contract_address> "<function_signature>" [args...] --rpc-url <rpc_url>cast call 0xA0b86a33E6441e88C5F2712C3E9b74B6F3f5a8b8 "totalSupply()(uint256)" --rpc-url <rpc_url>cast send --private-key <pk> --rpc-url <rpc_url> <to_address> --value <amount_in_wei>cast send --private-key <pk> --rpc-url <rpc_url> <contract_address> "<function_signature>" [args...]cast block-number --rpc-url <rpc_url>cast block <block_number> --rpc-url <rpc_url>cast tx <tx_hash> --rpc-url <rpc_url>cast send --private-key <pk> --rpc-url <rpc_url> --create <bytecode> [constructor_args...]cast --to-ascii <hex_string>
cast --to-dec <hex_string>export ETH_RPC_URL=https://eth-mainnet.alchemyapi.io/v2/YOUR_API_KEY
cast balance 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045cast balance <address> --rpc-url https://polygon-rpc.com/cast balance <address> --rpc-url http://127.0.0.1:8545for addr in addr1 addr2 addr3; do
echo "Balance of $addr: $(cast balance $addr --rpc-url $RPC_URL)"
donecast estimate --rpc-url <rpc_url> <to_address> --value <amount>cast call --abi <abi_file> <contract> <function> [args...]