Pick a depth. Each prompt opens in your AI pre-loaded with the lesson. Click a row to preview the prompt.
Once deployed, your contract lives on-chain. You interact with it via two primitives: reading (a view call, free, instant) and writing (a transaction, costs gas, takes a block). cast call reads. cast send writes. Understanding that every write is a transaction — with gas, with a sender, with an event trail — is the mental model you'll use for the rest of Solidity.
cast call executes a view function off-chain and returns the result immediately at no gas cost, while cast send submits a real transaction, waits for a receipt, and reports gas used. The distinction maps directly to Solidity's view/pure vs state-mutating functions — every write costs gas and leaves a permanent on-chain record.
# READ (view call — free, no transaction)
cast call <HELLO_ADDR> 'greeting()(string)' \
--rpc-url http://127.0.0.1:8545
# -> "gm"
# WRITE (transaction — costs gas)
cast send <HELLO_ADDR> 'setGreeting(string)' 'hello world' \
--rpc-url http://127.0.0.1:8545 \
--private-key 0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
# -> prints transaction hash, gas used, status
# READ AGAIN
cast call <HELLO_ADDR> 'greeting()(string)' \
--rpc-url http://127.0.0.1:8545
# -> "hello world"
# GAS USED BY THE WRITE (look at the receipt):
cast receipt <TX_HASH> --rpc-url http://127.0.0.1:8545
# gasUsed: ~26,000 for a string updategreeting() with cast call. Note that this is instant and free — no transaction is created.cast send, setting the greeting to something new. Copy the transaction hash it returns.cast receipt <tx_hash> and find the gasUsed field. Convert wei to gwei to USD — Anvil fakes gas prices, but the number is real.greeting() again and verify your new string.cast send with a wallet that has no ETH. It will fail — note the error. This is how you learn the difference between a view call and a transaction.