Courses

Interacting with Smart Contracts
Ethereum · Chapter 8

Interacting with Smart Contracts

Reading and writing are different operations. A read asks for existing information; a write asks the network to execute a transaction and save the result.

The basics

  • Your app needs the contract address, network and ABI. The ABI describes available functions and how their arguments are encoded.
  • Reading count through an RPC call normally needs no wallet signature or onchain fee. Calling increment changes state and needs a signed transaction.
  • Wait for the transaction receipt and check success before refreshing the count. A transaction hash only shows that you have an identifier to track.

Try it yourself

Using your deployed Counter in Remix on Sepolia, read count, increment once, wait for confirmation and read again. Compare the read with the wallet approval required for the write.

Read more in the official documentation

@ Daniel Burlacu