Interacting with Smart Contracts on Blockscout

Smart contract interface design mockup showing verified contract with green checkmark, Code button, and navigation tabs for All, Read, Write functions

Blockscout features a modern, React-based interface that allows users to verify, read, write to, and interact with contracts and proxies. It automatically detects proxy patterns ([EIP-1967], [EIP-1822], Diamond) and offers separate interfaces for proxy and implementation contracts. This tutorial will guide you through effectively using Blockscout's interface to interact with smart contracts on the Optimism network.

Smart Contracts on Blockscout

Once a smart contract is verified, its methods and functions become publicly accessible, enabling users to interact with them directly. This verification process allows developers and users alike to confirm the integrity and functionality of the contract.

To verify if a contract is verified, look for a green checkmark (✅) next to the "Contract" tab on the Explorer instance. This green checkmark serves as an indicator of a verified contract, reassuring users that the code has been reviewed and matches its deployed version on the blockchain.

Blockscout blockchain explorer showing verified smart contract details for StakedLPTokenSolidlyBase4 token contract on Optimism mainnet with contract address, verification status, and source code information

 Contract Tab: This tab is the heart of smart contract interaction, and it features the following tabs:

  • Read/Write Contract: Query contract state without gas costs and execute state-changing functions that incur gas fees.
  • Read Proxy/Write Proxy: For proxy contract interactions (For contracts with Proxies)
  • Code: Full source code with syntax highlighting
  • Custom ABI: You can add custom ABIs for your contract and access them when logged into your account.

Reading WETH9 Contract

Before you do this, ensure to have the following checked

  • Smart contract must be verified (✅ checkmark visible).
  • Web3 wallet connected to the Optimism network.
  • Understand of the contract's purpose and functions.
💡
The following tutorial is based on the Optimism Network. If you would prefer to use a testnet, you can use the WETH9 contract on Sepolia.

Step 1: Navigate to the Contract

  1. Go to https://optimism.blockscout.com/
  2. Enter the contract address (0x4200000000000000000000000000000000000006) in the search bar.
OP Mainnet explorer search results showing L2 Standard Bridged WETH token contract address with $2,572.95 value, latest blocks, transactions, and network utilization at 39.30% on Optimism blockchain
  1. Click on the contract page result.
L2 Standard Bridged WETH token page on Blockscout showing $2,568.29 price, $82.5B market cap, 32,157 WETH max supply, and verified contract details on Optimism blockchain explorer
  1. Check for the verification checkmark next to "Contract."

Step 2: Connect your wallet

Click the Connect Wallet button to link your wallet. Reading operations don't require gas, but a wallet connection is needed for identification.

WETH token contract page on Blockscout showing $2,572.95 price, $83.19B market cap, 303,508 holders, with Connect wallet button highlighted and contract interaction interface for L2 Standard Bridged WETH on Optimism
⚠️
Ensure your wallet is connected to the Optimism network.

Step 3: Execute Read Functions

  1. Click the “Read/write contract” tab, then select the read tab to start browsing the methods.
💡
For proxy contracts, you'll see both "Read Contract" and "Read Proxy" options. Choose "Read Proxy" for proxy contracts, as it displays the implementation methods.
Smart contract read interface on Blockscout showing connected wallet and ERC-20 token contract functions including allowance, balanceOf, decimals, name, symbol, and totalSupply methods with hexadecimal values
  1. For functions requiring parameters, fill in the required fields and click the “Read” button to execute the query.
Smart contract function interface showing allowance and balanceOf methods with Ethereum address inputs, Read and Copy calldata buttons, returning uint256 values 0 and 685654125388448733045 for ERC-20 token contract
To test the balanceOf and allowance methods, I used a random contract addresses on the Optimism network. Put in any random addresses that holds WETH and view the result.

For other methods that don't require parameters, click "Read" to execute the query. View the results displayed below the function.

ERC-20 token contract read functions showing name 'Wrapped Ether', symbol 'WETH', and totalSupply of 322729653933984883519120 with hexadecimal method IDs and Read buttons for smart contract interaction

Writing to the WETH9 Contract

Writing operations are irreversible and cost gas. Before you continue, ensure that;

  • Your Web3 wallet has sufficient ETH for gas fees
  • You understand the function you want to execute

Step 1: Navigate to the Write Methods

Click the Write tab to access the Write functions

Smart contract Write interface on Blockscout showing connected wallet with writable functions including approve, deposit, fallback, transfer, transferFrom, and withdraw methods with hexadecimal method IDs for ERC-20 token contract interaction

Step 2: Fill in the Parameters

Understand what the function will do, then carefully enter all required parameters.

For example, with the deposit function, we can send native ETH to this contract and get wrapped ETH (WETH) in return.

WETH deposit function interface showing 'Send native ETH' input field with uint256 parameter and scientific notation multiplier (×10^18) with Write button for converting ETH to Wrapped Ether on smart contract

The value of ETH is automatically converted to Wei if you paste in. If not, you can use a Wei calculator (ie https://eth-converter.com/) to enter the amount of ETH you want to convert and it will give you the value in WEI.

ETH unit converter tool showing conversion of 1.9409146745 Ether to 19409146754500000000 Wei with instructions to enter ETH amount and paste Wei value into smart contract deposit field for wrapping ETH tokens
WETH deposit function with Wei amount 1940914675450000000 entered in uint256 field and ×10^18 multiplier shown, ready to execute Write transaction for converting ETH to Wrapped Ether on smart contract

Click the "Write" button.

Step 3: Execute Transaction

Review the transaction pop-up in your wallet.

MetaMask transaction confirmation for WETH deposit showing 0.00195 ETH being sent to receive 0.00195 WETH tokens with network fee under $0.01 and market speed confirmation on OP Mainnet via Blockscout

Check gas fees (both L2 execution and L1 data fees), then confirm and sign the transaction. 

Successful WETH deposit transaction confirmation showing 'Transaction has been confirmed' message with 'View transaction details' link and Reset button for completing ETH to Wrapped Ether conversion on smart contract

You can view the details of the transaction by clicking “View transaction details.”

Blockscout transaction details page showing successful WETH deposit transaction with hash, 338 block confirmations, timestamp July 08 2025, and token minting details for converting ETH to Wrapped Ether on blockchain explorer