Web3.js, Ethers.js and Ethereum APIs Flashcards
6 cards from real Ethereum Developer practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Web3.js, Ethers.js and Ethereum APIs flashcards as text
What does `eth_call` do in contrast to `eth_sendTransaction`?
Answer: eth_call simulates a call without modifying state; eth_sendTransaction writes to the chain
`eth_call` executes a function locally without creating a transaction, while `eth_sendTransaction` broadcasts a state-changing transaction.
What is the unit `Wei` in Ethereum?
Answer: The smallest denomination of Ether (1 ETH = 10^18 Wei)
Wei is the smallest indivisible unit of Ether, with 1 ETH equal to 1,000,000,000,000,000,000 (10^18) Wei.
What is an Ethereum event filter used for in ethers.js?
Answer: To listen for and query specific smart contract events emitted on-chain
Event filters in ethers.js allow developers to subscribe to or query specific contract events by topic and address.
What does the `nonce` in an Ethereum transaction represent?
Answer: The number of transactions sent from the sender's address, used to order and deduplicate transactions
The nonce is a sequential counter for each account ensuring transactions execute in order and preventing replay attacks.
What is the purpose of `eth_getLogs` in Ethereum's JSON-RPC API?
Answer: To retrieve historical event logs matching a given filter
`eth_getLogs` returns an array of log objects matching the specified filter (address, topics, block range) from the blockchain.
In ethers.js v6, how do you convert a value from Ether to Wei?
Answer: ethers.parseEther('1.0')
In ethers.js v6, `ethers.parseEther()` converts an Ether string to its Wei equivalent as a BigInt.