๐ Call Functions & Verify Results
Interact with your deployed contract and confirm transactions on-chain
Your Progress
0 / 5 completed๐ Interaction & Verification
Your contract is deployed! Now let's interact with itโread data, write data, and verify the source code on Etherscan.
๐ฎ Interactive: Contract Interaction Simulator
Choose an action to see how to interact with your deployed contract
// Read value (free call) const value = await contract.storedData() console.log(value) // Current stored number
๐ Read vs โ๏ธ Write Operations
๐ Using Etherscan to Interact
Etherscan provides a user-friendly interface to interact with any contractโno code required!
Go to sepolia.etherscan.io and paste your contract address
Click the "Contract" tab โ "Read Contract" to view all view functions
Click "storedData" to see current value. No wallet connection needed!
Click "Write Contract" โ Connect MetaMask when prompted
Enter value โ Click "Write" โ Confirm in MetaMask โ Wait for confirmation
โ Why Verify Your Contract?
Anyone can read source code and verify what the contract does
Users can audit logic and confirm no hidden malicious code
Etherscan shows function names instead of raw bytecode
Track contract usage, events, and transactions easily
๐ Interacting with Web3.js
For dApp developers, here's how to interact programmatically:
import { ethers } from 'ethers'
// Connect to wallet
const provider = new ethers.BrowserProvider(window.ethereum)
const signer = await provider.getSigner()
// Contract instance
const contract = new ethers.Contract(
'0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb', // Address
['function set(uint256 x)', 'function storedData() view returns (uint256)'], // ABI
signer
)
// Read value (free)
const value = await contract.storedData()
console.log('Stored value:', value)
// Write value (costs gas)
const tx = await contract.set(123)
await tx.wait() // Wait for confirmation
console.log('New value set to 123!')โ ๏ธ Common Pitfalls
await tx.wait() to ensure transaction is mined