Certified Blockchain Developer - Ethereum (CBDE) — Questions and Answers
Question 1: What is EIP-4844 (Proto-Danksharding) and its primary benefit?
- It introduces blob-carrying transactions that drastically reduce rollup data posting costs (Correct answer)
- It adds native account abstraction to Ethereum
- It merges the execution and consensus layers for simplified node operation
- It enables sharded execution across 64 parallel chains
Correct answer: It introduces blob-carrying transactions that drastically reduce rollup data posting costs
EIP-4844 introduced a new transaction type carrying data 'blobs' with a separate, cheaper fee market, reducing L2 data costs by up to 10x.
Question 2: What is a Solidity `modifier` used for?
- Optimizing gas usage automatically
- Declaring abstract methods
- Reusing pre- and post-condition logic across multiple functions (Correct answer)
- Changing the return type of a function
Correct answer: Reusing pre- and post-condition logic across multiple functions
Modifiers wrap function execution with reusable guard logic, like access control checks, using `_;` as a placeholder.
Question 3: What does the `abstract` keyword indicate about a Solidity contract?
- It cannot inherit from other contracts
- It is optimized for low gas consumption
- It can only be called by other contracts
- It has at least one unimplemented function and cannot be deployed directly (Correct answer)
Correct answer: It has at least one unimplemented function and cannot be deployed directly
An `abstract` contract contains at least one function without implementation and must be inherited and completed before deployment.
Question 4: What is the primary function of a lending protocol like Aave or Compound?
- Provide decentralized insurance for smart contract risk
- Facilitate NFT auctions on-chain
- Allow users to deposit assets to earn interest and borrow against collateral (Correct answer)
- Create synthetic exposure to off-chain assets
Correct answer: Allow users to deposit assets to earn interest and borrow against collateral
Lending protocols match lenders who supply assets for yield with borrowers who provide overcollateralized deposits to take loans.
Question 5: Assert is used to?
- To examine user input arguments
- Check internal conditions that ought to never occur (Correct answer)
- To run programs internally
Correct answer: Check internal conditions that ought to never occur
`assert()` is a Solidity statement used to check for internal conditions that should logically never be false if the contract is functioning correctly. If an `assert` statement fails, it signals a critical bug, consumes all remaining gas, and reverts all state changes made during the transaction. It's primarily for internal consistency checks and invariants, distinguishing it from `require()` which validates user input or external conditions.
Question 6: What is an Ethereum layer-2 (L2) solution?
- A smart contract upgrade mechanism for existing dApps
- An alternative client implementation of the Ethereum node
- A sidechain that runs independently with its own consensus
- A protocol built on top of Ethereum that processes transactions off-chain while inheriting mainnet security (Correct answer)
Correct answer: A protocol built on top of Ethereum that processes transactions off-chain while inheriting mainnet security
Layer-2 solutions execute transactions off the Ethereum mainnet to increase throughput and reduce fees, periodically settling proofs or data on L1.
Question 7: Why are Solidity events more gas-efficient than contract storage for recording historical data?
- Events are stored off-chain and don't consume any gas
- Events bypass block gas limits entirely
- Events are stored in cheaper transaction logs (~8 gas/byte) rather than costly contract storage (~20,000 gas per slot) (Correct answer)
- Events are compressed automatically by the EVM before persisting
Correct answer: Events are stored in cheaper transaction logs (~8 gas/byte) rather than costly contract storage (~20,000 gas per slot)
Emitting an event stores data in transaction logs at roughly 375 gas per topic and 8 gas per byte of data, far cheaper than the 20,000 gas cost of a new SSTORE.
Question 8: Which network node is not PoW?
- Ropsten
- Rinkeby (Correct answer)
- Morden
- Olympic
Correct answer: Rinkeby
Rinkeby is an Ethereum testnet that utilizes a Proof-of-Authority (PoA) consensus mechanism, where a set of authorized signers validate transactions and create new blocks. In contrast, Ropsten, Morden (deprecated), and Olympic (deprecated) were all Proof-of-Work (PoW) testnets, mimicking the main Ethereum network's original consensus mechanism.
Question 9: Which Solidity function is called when Ether is sent to a contract with no calldata?
- fallback()
- receive() (Correct answer)
- default()
- deposit()
Correct answer: receive()
The `receive()` function handles plain Ether transfers with empty calldata, and must be marked `payable`.
Question 10: What function must an ERC-20 contract implement to allow a spender to transfer tokens on behalf of an owner?
- approve() (Correct answer)
- transfer()
- allowance()
- mint()
Correct answer: approve()
The `approve()` function grants a spender permission to transfer a specified amount of tokens on the owner's behalf.
Question 11: What makes unit testing so crucial?
- Working on something for which you are compensated is a terrific way to spend time. But in the end, it will just slow down the process of development.
- It aids in the discovery of errors, regression errors, and occasionally even aids in the understanding of your code from many perspectives (Correct answer)
- All of the statement are true.
Correct answer: It aids in the discovery of errors, regression errors, and occasionally even aids in the understanding of your code from many perspectives
Unit testing is paramount in smart contract development because it helps identify errors and potential vulnerabilities early in the development cycle, preventing costly exploits. It also guards against regression errors when code changes are introduced, ensuring existing functionalities remain intact. Furthermore, the process of writing unit tests often provides developers with a deeper understanding of their code's logic and potential edge cases.
Question 12: What is EIP-1559 and what problem does it address?
- A fee market reform that introduced a base fee burned per transaction, reducing fee unpredictability (Correct answer)
- A standard for gasless meta-transactions
- A proposal to double the block gas limit for scalability
- An upgrade that enabled smart contracts on the Beacon Chain
Correct answer: A fee market reform that introduced a base fee burned per transaction, reducing fee unpredictability
EIP-1559 replaced the first-price auction gas model with a protocol-determined base fee that is burned, plus an optional priority tip for validators.
Question 13: What does ABI stand for in Ethereum development?
- Automated Blockchain Interpreter
- Application Binary Interface (Correct answer)
- Address Binding Index
- Abstract Base Interface
Correct answer: Application Binary Interface
The ABI (Application Binary Interface) defines how to encode and decode function calls and return values when interacting with a smart contract.
Question 14: What is Hardhat used for in Ethereum development?
- A development environment for compiling, testing, and deploying Solidity smart contracts (Correct answer)
- A frontend framework for building dApp UIs
- A decentralized package manager for Solidity libraries
- A monitoring tool for Ethereum mainnet transactions
Correct answer: A development environment for compiling, testing, and deploying Solidity smart contracts
Hardhat is a popular Ethereum development framework that provides a local blockchain, testing tools, and deployment scripts.
Question 15: What does AMM stand for in the context of DeFi?
- Aggregated Margin Model
- Asset Management Module
- Automated Market Maker (Correct answer)
- Autonomous Minting Mechanism
Correct answer: Automated Market Maker
An Automated Market Maker (AMM) uses liquidity pools and mathematical formulas to enable permissionless token swaps without an order book.
Question 16: What major change did the Ethereum Merge (2022) introduce?
- Implemented sharding for parallel transaction processing
- Replaced Proof of Work with Proof of Stake consensus (Correct answer)
- Increased the block size to reduce fees
- Merged Ethereum mainnet with Polygon
Correct answer: Replaced Proof of Work with Proof of Stake consensus
The Merge transitioned Ethereum from energy-intensive Proof of Work mining to Proof of Stake, where validators stake ETH to propose blocks.
Question 17: What does the `nonce` in an Ethereum transaction represent?
- The amount of gas pre-authorized for the transaction
- A timestamp preventing transaction replay
- The number of transactions sent from the sender's address, used to order and deduplicate transactions (Correct answer)
- A random value used in proof-of-work mining
Correct 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.
Question 18: What is a reentrancy attack in the context of DeFi smart contracts?
- An exploit targeting integer overflow in token balances
- An attack that floods a contract with transactions to drain gas
- A front-running attack on DEX trades
- An exploit where a malicious contract repeatedly calls back into a vulnerable contract before state is updated (Correct answer)
Correct answer: An exploit where a malicious contract repeatedly calls back into a vulnerable contract before state is updated
A reentrancy attack exploits a contract that sends ETH before updating its internal balance, allowing the attacker to drain funds recursively.
Question 19: What is the upgradeable proxy pattern in Solidity development?
- A design where a proxy contract delegates calls to an implementation contract that can be swapped (Correct answer)
- A method for migrating contract storage between versions
- A pattern for upgrading the Ethereum protocol without a hard fork
- A proxy server that caches Ethereum RPC responses
Correct answer: A design where a proxy contract delegates calls to an implementation contract that can be swapped
The upgradeable proxy pattern separates storage (proxy) from logic (implementation), allowing the logic to be replaced without losing state.
Question 20: What is a liquidity pool in the context of DeFi?
- A smart contract holding reserves of two or more tokens used to facilitate trading (Correct answer)
- A contract that bridges assets between blockchains
- A smart contract that distributes yield to stakers
- An escrow service for peer-to-peer trades
Correct answer: A smart contract holding reserves of two or more tokens used to facilitate trading
A liquidity pool is a smart contract containing token reserves provided by liquidity providers, enabling decentralized trading.
Question 21: Which visibility specifier restricts a function to be called only within the contract itself?
- private (Correct answer)
- public
- internal
- external
Correct answer: private
The `private` visibility means the function can only be called from within the same contract, not from derived contracts.
Question 22: What is the purpose of the `payable` keyword in a Solidity function?
- It makes the function free to call
- It locks the function from being overridden
- It enables the function to return Ether
- It allows the function to receive Ether (Correct answer)
Correct answer: It allows the function to receive Ether
The `payable` keyword allows a function to receive Ether as part of a transaction.
Question 23: The ETH2 mascot was given the name of :
- Leslie Lemport
- Leyslie Lampport
- Leslee Lampart
- Leslie Lamport (Correct answer)
Correct answer: Leslie Lamport
The ETH2 mascot, a friendly cartoon character often associated with the Ethereum 2.0 (Consensus Layer) upgrade, was named Leslie Lamport. This name is a direct tribute to the distinguished computer scientist Leslie Lamport, renowned for his foundational contributions to distributed systems, including algorithms like Paxos and Lamport timestamps, which are crucial concepts in blockchain technology.
Question 24: What EIP defines the ERC-20 fungible token standard?
- EIP-1155
- EIP-20 (Correct answer)
- EIP-721
- EIP-2612
Correct answer: EIP-20
EIP-20 (commonly called ERC-20) defines the standard interface for fungible tokens on Ethereum.
Question 25: Which Solidity keyword marks a state variable as unchangeable after deployment?
- immutable (Correct answer)
- fixed
- final
- constant
Correct answer: immutable
The `immutable` keyword allows a variable to be set in the constructor but never changed afterward.
Question 26: Which opcode does Solidity use when making an external function call that preserves the calling contract's context?
- CALLCODE
- DELEGATECALL (Correct answer)
- STATICCALL
- CALL
Correct answer: DELEGATECALL
`DELEGATECALL` executes the target contract's code in the context of the calling contract, reusing its storage and `msg.sender`.
Question 27: What does the Ethereum Cancun upgrade (2024) primarily achieve for developers?
- It enables full sharding across 64 execution shards
- It activates EIP-4844, adding blob transactions that lower rollup fees significantly (Correct answer)
- It removes the 7-day withdrawal delay for Optimistic Rollups
- It introduces native token bridging between all L2 networks
Correct answer: It activates EIP-4844, adding blob transactions that lower rollup fees significantly
The Cancun upgrade activated EIP-4844, introducing blob-carrying transactions that dramatically reduced the cost of posting data for L2 rollups.
Question 28: What is Ethereum's 'difficulty bomb' and why was it introduced?
- A smart contract that destroys ETH to reduce circulating supply
- A fee mechanism that burns ETH when block utilization exceeds 50%
- A network rule that slashes validators for double-signing blocks
- A mechanism that exponentially increased mining difficulty to encourage the transition to Proof of Stake (Correct answer)
Correct answer: A mechanism that exponentially increased mining difficulty to encourage the transition to Proof of Stake
The difficulty bomb gradually increased Proof of Work mining difficulty to make PoW economically unviable and pressure the network toward the Merge.
Question 29: Why is reading function parameters from calldata cheaper than from memory in Solidity?
- Calldata uses a compressed binary encoding
- Calldata is read-only and avoids the gas cost of copying data into memory (Correct answer)
- Calldata is stored on layer 2 networks
- Calldata bypasses the EVM stack entirely
Correct answer: Calldata is read-only and avoids the gas cost of copying data into memory
Calldata is immutable transaction input that can be read directly without allocating or copying into memory, saving the gas cost of mstore and mload operations.
Question 30: What does the Checks-Effects-Interactions (CEI) pattern prevent in Solidity?
- Front-running by randomizing transaction order
- Reentrancy attacks by updating state before making external calls (Correct answer)
- Gas griefing by limiting loop iterations
- Integer overflow by adding SafeMath checks
Correct answer: Reentrancy attacks by updating state before making external calls
The CEI pattern mandates checking conditions, updating state, then interacting with external contracts to prevent reentrancy exploits.
Question 31: What is an Ethereum event filter used for in ethers.js?
- To listen for and query specific smart contract events emitted on-chain (Correct answer)
- To set gas price limits for outgoing transactions
- To restrict which addresses can call a contract
- To filter out spam transactions in a block
Correct 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.
Question 32: What is the fundamental difference between Optimistic Rollups and ZK Rollups?
- Optimistic Rollups assume validity and use fraud proofs; ZK Rollups use cryptographic validity proofs (Correct answer)
- Optimistic Rollups use Ethereum data availability; ZK Rollups store data off-chain
- ZK Rollups are faster to withdraw from than Optimistic Rollups
- ZK Rollups require sequencer decentralization; Optimistic Rollups do not
Correct answer: Optimistic Rollups assume validity and use fraud proofs; ZK Rollups use cryptographic validity proofs
Optimistic Rollups post transactions optimistically and allow a challenge period, while ZK Rollups post cryptographic proofs that are immediately verifiable.
Question 33: How many stakeholders made up the DAO?
- 10000
- 48000
- 35000
- 18000 (Correct answer)
Correct answer: 18000
The DAO was a decentralized autonomous organization launched on the Ethereum blockchain that raised a significant amount of Ether through a crowdfunding campaign. Historical data indicates that approximately 18,000 unique addresses contributed to the DAO, making them its stakeholders. This large number of participants highlighted the early interest in decentralized governance.
Question 34: In solidity, the outcome of dividing number -5 by integer 2 is
- Since Solidity only understands unsigned integers, it is not possible.
- -2 due to the truncated decimal (rounded to zero) (Correct answer)
- -3 as it is always rounded.
- -2.5 as a result of the automated casting or conversion into a float.
Correct answer: -2 due to the truncated decimal (rounded to zero)
In Solidity, integer division truncates any decimal part, effectively rounding the result towards zero. Therefore, when dividing -5 by 2, the mathematical result is -2.5, but Solidity's integer division truncates this to -2. This behavior is standard for integer arithmetic in many programming languages.
Question 35: The result of the division of two integers, 5/2, is
- None of the above.
- 2, as the decimal point has been truncated. (Correct answer)
- .5, as it is instantly transformed into a float.
- 3, as it is always rounded
Correct answer: 2, as the decimal point has been truncated.
Solidity performs integer division, which means any fractional part of the result is truncated, effectively rounding down to the nearest whole number. Therefore, 5 divided by 2 results in 2, as the decimal .5 is discarded. Solidity does not automatically convert integers to floats for division.
Question 36: Which Solidity data type is used to store Ethereum addresses?
- address (Correct answer)
- bytes20
- string
- uint160
Correct answer: address
The `address` type is a 20-byte value specifically designed to hold Ethereum addresses.
Question 37: Smart Contracts are programmable in
- Java, C++, Solidity, and JavaScript, as cross compilers for every major language are available and the Ethereum Blockchain is totally language agnostic.
- Solidity, Viper, LLL, and Serpent since they are bytecode-compiled high-level languages. (Correct answer)
- Solidity and JavaScript, as they are the first distributed application implementations that have been officially released, and the Blockchain fully supports both of these programming languages.
Correct answer: Solidity, Viper, LLL, and Serpent since they are bytecode-compiled high-level languages.
Ethereum smart contracts are primarily written in high-level languages that compile into EVM bytecode. Solidity is the most widely used, but other languages like Vyper (formerly Viper), LLL (Low-Level Lisp), and Serpent (now deprecated) were also designed for this purpose. These languages provide abstractions over the raw EVM opcodes.
Question 38: What does it mean when we say, "A Hashing Algorithm is deterministic"?
- Given a lengthy input, it produces the result using equally scattered data.
- When given the same input, it always generates the same output. (Correct answer)
- Given the output, it shouldn't be feasible to generate the input again.
Correct answer: When given the same input, it always generates the same output.
A deterministic hashing algorithm is one that consistently produces the exact same output hash whenever it is given the identical input. This property is fundamental to blockchain technology, as it ensures that data integrity can be reliably verified and that all network participants can independently and consistently arrive at the same hash for a given piece of data.
Question 39: This would be the appropriate syntax if contract MyContractA is derived from contract MyContractB:
- contract MyContractA is MyContractB { ... } (Correct answer)
- contract MyContractA inherit (MyContractB) {...}
- contract MyContractA extends MyContractB {...}
- contract MyContractB derives MyContractA {...}
Correct answer: contract MyContractA is MyContractB { ... }
In Solidity, contract inheritance is achieved using the `is` keyword. If `MyContractA` is designed to inherit functionalities and state variables from `MyContractB`, the correct syntax for defining this relationship is `contract MyContractA is MyContractB { ... }`. This establishes `MyContractB` as the base contract and `MyContractA` as the derived contract.
Question 40: After a new block has been mined,
- The block includes a list of the transactions and uncles. The balance of the miners is increased by the amount of gas spent during such transactions. Additionally, the miner receives the block reward. The network then achieves consensus by repeating the same transactions on all participating nodes. (Correct answer)
- That block includes a list of transactions. While the block reward is automatically distributed across the mining pool to ensure a fair distribution, the gas utilized during the execution is tied to the contracts that are actually being executed. By using a unique kind of hash code, consensus is achieved.
- None of the above
Correct answer: The block includes a list of the transactions and uncles. The balance of the miners is increased by the amount of gas spent during such transactions. Additionally, the miner receives the block reward. The network then achieves consensus by repeating the same transactions on all participating nodes.
After a new block is successfully mined on Ethereum (pre-Merge Proof-of-Work), it contains a list of validated transactions and references to any 'uncle' blocks. The miner who found the block receives a block reward (newly minted ETH) and the transaction fees (gas) from all included transactions. The rest of the network achieves consensus by verifying the block's validity and executing its transactions to update their local state, ensuring all nodes agree on the blockchain's current state.
Question 41: If you require more precise functionality than what solidity provides by default
- Inline-assembly can be used to improve controls. (Correct answer)
- Viper, an experimental assembly-like language designed to provide additional flexibility, is an option.
- You need to import assembly files that have already been hard-copied into the compiled solidity file's bytecode.
Correct answer: Inline-assembly can be used to improve controls.
Inline assembly in Solidity allows developers to write low-level EVM opcodes directly within their smart contracts. This provides fine-grained control over the contract's execution, enabling optimizations, implementing functionalities not natively supported by Solidity, or interacting with the EVM at a deeper level. It's used when more precise control or efficiency is required.
Question 42: What does 'data availability' mean in the context of Ethereum rollups?
- The availability of historical event logs on a node
- Ensuring that the transaction data needed to reconstruct rollup state is accessible to anyone (Correct answer)
- The percentage of nodes that have synced the latest block
- The uptime guarantee of an Ethereum RPC provider
Correct answer: Ensuring that the transaction data needed to reconstruct rollup state is accessible to anyone
Data availability ensures that the compressed transaction data posted by rollups to Ethereum can be downloaded and verified by any participant.
Question 43: Complete the statement : "Gas costs accrue on..."
- Only deploying a new smart contract when sending a transaction.
- Sending a transaction regardless of its content. (Correct answer)
- Sending a transaction that solely interacts with a smart contract that has already been deployed
Correct answer: Sending a transaction regardless of its content.
Gas costs are fundamental to the Ethereum network and are incurred for every transaction, regardless of its specific content. Whether you're sending Ether, deploying a new contract, or calling a function on an existing contract, gas is required to compensate miners for the computational resources used to process and validate the transaction on the blockchain.
Question 44: Which eth2 client launched the first testnet that allowed community participation before anyone else?
- Prysym Lighthouse
- Nimbus (Correct answer)
- Teku
Correct answer: Nimbus
Nimbus, an Ethereum 2.0 client developed by Status, was the first to launch a public testnet that allowed broad community participation. This early testnet was crucial for gathering feedback, identifying bugs, and fostering community involvement in the development and testing of the Ethereum 2.0 (now consensus layer) network.
Question 45: What is a state channel in Ethereum layer-2 scaling?
- An off-chain communication channel between parties that only settles the final state on-chain (Correct answer)
- A channel between Ethereum nodes for fast block propagation
- A smart contract that channels funds between DeFi protocols
- A private blockchain that posts merkle roots to Ethereum
Correct answer: An off-chain communication channel between parties that only settles the final state on-chain
State channels allow two or more parties to exchange signed state updates off-chain, opening and closing the channel with on-chain transactions.
Question 46: What does EIP-2612 add to the ERC-20 standard?
- Built-in minting and burning functions
- Token metadata storage on-chain
- Permit functionality enabling gasless approvals via off-chain signatures (Correct answer)
- Native cross-chain transfer support
Correct answer: Permit functionality enabling gasless approvals via off-chain signatures
EIP-2612 adds the `permit()` function, allowing ERC-20 approvals via signed messages without requiring a separate on-chain approval transaction.
Question 47: What is an Ethereum node's RPC endpoint used for?
- As an HTTP or WebSocket interface to send JSON-RPC requests to the node (Correct answer)
- As a peer-to-peer gossip address for block propagation
- As a storage endpoint for contract bytecode
- As a consensus vote submission channel
Correct answer: As an HTTP or WebSocket interface to send JSON-RPC requests to the node
The RPC endpoint exposes a standardized JSON-RPC API that lets applications query blockchain state and submit transactions.
Question 48: What is a flash loan in DeFi?
- An uncollateralized loan that must be borrowed and repaid within a single transaction (Correct answer)
- A loan backed by NFT collateral
- A loan with a very low interest rate
- A loan that expires after one block
Correct answer: An uncollateralized loan that must be borrowed and repaid within a single transaction
Flash loans allow users to borrow any amount without collateral as long as the loan is repaid within the same transaction block.
Question 49: What is a stablecoin in the Ethereum ecosystem?
- A token that cannot be transferred once issued
- An NFT representing a real-world asset
- A token designed to maintain a stable value, usually pegged to a fiat currency like USD (Correct answer)
- A governance token with a fixed supply
Correct answer: A token designed to maintain a stable value, usually pegged to a fiat currency like USD
Stablecoins reduce volatility by pegging their value to a reference asset, enabling predictable DeFi participation and payments.
Question 50: Why can using `uint8` for local variables cost MORE gas than `uint256` in Solidity?
- uint8 is not directly supported by EVM arithmetic opcodes
- uint256 enables better compiler optimizations
- uint256 is stored more compactly in memory
- The EVM's 256-bit word size requires extra masking operations when using smaller types (Correct answer)
Correct answer: The EVM's 256-bit word size requires extra masking operations when using smaller types
Since the EVM natively operates on 256-bit words, using uint8 in local variables forces the compiler to add bit-masking operations, adding gas overhead.
Question 51: What is the key difference between CALL and DELEGATECALL opcodes?
- DELEGATECALL transfers Ether while CALL does not
- DELEGATECALL executes the target's code in the caller's storage context (Correct answer)
- CALL preserves msg.sender while DELEGATECALL does not
- CALL is cheaper than DELEGATECALL
Correct answer: DELEGATECALL executes the target's code in the caller's storage context
DELEGATECALL runs the target contract's code but uses the calling contract's storage, msg.sender, and msg.value, which is fundamental to proxy patterns.
Question 52: Which of the following is NOT a valid data location in the EVM?
- Cache (Correct answer)
- Stack
- Memory
- Storage
Correct answer: Cache
The EVM has four data locations—stack, memory, storage, and calldata—cache does not exist as a distinct EVM data location.
Question 53: How much gas does a standard ETH transfer (no data, no contract) cost?
- 50,000 gas
- 21,000 gas (Correct answer)
- 100,000 gas
- 5,000 gas
Correct answer: 21,000 gas
A standard ETH transfer costs exactly 21,000 gas, which is the fixed base transaction cost on Ethereum for a simple value transfer.
Question 54: What is a sequencer in a rollup network?
- A smart contract that verifies ZK proofs on Ethereum
- A validator node that proposes new Ethereum blocks
- A relay that bridges assets from L1 to L2
- A centralized or decentralized node that orders and batches transactions before posting them to L1 (Correct answer)
Correct answer: A centralized or decentralized node that orders and batches transactions before posting them to L1
The sequencer is responsible for receiving user transactions, ordering them, and periodically posting compressed batches to the Ethereum base layer.
Question 55: What functions do private keys represent?
- To verify signatures on documents and determine an address from. (Correct answer)
- To create a transaction-capable address.
- To serve as a cryptographically significant shield for the Public Keys.
Correct answer: To verify signatures on documents and determine an address from.
Private keys serve critical functions in Ethereum's security model. They are used to cryptographically sign transactions, proving ownership of an address and authorizing fund transfers or contract interactions without revealing the private key itself. Additionally, an Ethereum address is deterministically derived from its corresponding public key, which in turn is generated from the private key.
Question 56: In Solidity, what is a `mapping`?
- A linked list data structure
- A pointer to a storage slot
- An ordered array of key-value pairs
- A hash table that maps keys to values (Correct answer)
Correct answer: A hash table that maps keys to values
A `mapping` in Solidity is a hash table that maps keys of one type to values of another type.
Question 57: What formula does Uniswap v2 use to maintain liquidity pool balance?
- x + y = k
- x^2 + y^2 = k
- x * y = k (Correct answer)
- x / y = k
Correct answer: x * y = k
Uniswap v2 uses the constant product formula `x * y = k`, where x and y are token reserves and k is a constant.
Question 58: When using the assert command to verify invariants and it returns false
- All gas is used up. (Correct answer)
- The entire gas supply is returned.
- All of the statement are false.
Correct answer: All gas is used up.
When an `assert` statement in Solidity evaluates to `false`, it signifies a critical internal error or a violation of an invariant that should never occur. The Ethereum Virtual Machine (EVM) then reverts all state changes made during the transaction and consumes all remaining gas, effectively failing the transaction without any gas refund. This behavior is designed to signal severe bugs.
Question 59: Which Solidity keyword is used to declare a function that cannot modify contract state?
- view (Correct answer)
- pure
- constant
- immutable
Correct answer: view
The `view` keyword declares a function that can read but not modify state variables.
Question 60: What is impermanent loss in DeFi liquidity provision?
- Fees lost when a transaction fails
- Value lost to slippage on large trades
- Loss from smart contract exploits
- The temporary loss experienced by liquidity providers due to price divergence of pooled assets (Correct answer)
Correct answer: The temporary loss experienced by liquidity providers due to price divergence of pooled assets
Impermanent loss occurs when the price ratio of pooled tokens changes from the deposit ratio, making holding preferable to providing liquidity.
Question 61: Which is TRUE about Storing almost all data in the Ethereum Blockchain?
- A linked list with references to earlier block hashes is utilized.
- Using a Merkle Patricia Trie (Correct answer)
- Because the Merkle Patricia Trie is too ineffective, a Radix Trie is used.
Correct answer: Using a Merkle Patricia Trie
Ethereum uses a Merkle Patricia Trie (MPT) to store all state data, including accounts, balances, contract storage, and transaction receipts. This data structure is highly efficient for verifying data integrity and allows for quick retrieval and updates of information. The MPT is fundamental to Ethereum's ability to maintain a consistent and verifiable global state across all nodes.
Question 62: In ethers.js v6, how do you convert a value from Ether to Wei?
- ethers.BigNumber.fromEther(1.0)
- ethers.parseEther('1.0') (Correct answer)
- ethers.utils.toWei('1.0')
- ethers.formatEther(1.0)
Correct answer: ethers.parseEther('1.0')
In ethers.js v6, `ethers.parseEther()` converts an Ether string to its Wei equivalent as a BigInt.
Question 63: What is slippage in the context of DEX trading?
- The difference between the expected price and the executed price of a trade (Correct answer)
- The loss of tokens sent to the wrong address
- The delay between transaction submission and confirmation
- The fee charged by liquidity providers
Correct answer: The difference between the expected price and the executed price of a trade
Slippage occurs because large trades move the pool's price, causing the execution price to differ from the quoted price.
Question 64: What is the Solidity `constructor` function used for?
- Creating new contract instances
- Defining the ABI of the contract
- Initializing contract state when it is deployed (Correct answer)
- Upgrading contract logic
Correct answer: Initializing contract state when it is deployed
The `constructor` runs once during contract deployment and is used to set initial state variables.
Question 65: What is MetaMask's primary role in a browser-based dApp?
- An injected wallet that provides a Web3 provider and Signer to the dApp (Correct answer)
- A decentralized storage solution for dApp data
- A compiler for Solidity code in the browser
- A smart contract deployed on Ethereum to manage user sessions
Correct answer: An injected wallet that provides a Web3 provider and Signer to the dApp
MetaMask injects a `window.ethereum` provider object into the browser, enabling dApps to request account access and sign transactions.
Question 66: A version pragma is a great method
- To identify the compiler version for which a smart contract was created. Keeping changes from breaking helps. (Correct answer)
- To identify the blockchain for which a smart contract was created. It aids in avoiding misunderstandings with beta users.
- To identify the blockchain node for which a smart contract was created. It is beneficial to avoid combining various Go-Ethereum iterations.
Correct answer: To identify the compiler version for which a smart contract was created. Keeping changes from breaking helps.
A version pragma, like `pragma solidity ^0.8.0;`, specifies the minimum and maximum Solidity compiler versions that can be used to compile the smart contract. This is crucial for ensuring compatibility and preventing unexpected behavior due to breaking changes or new features introduced in different compiler versions. It helps maintain the integrity and predictability of the contract's compilation.
Question 67: If you engage with a smart contract and observe a 50,000 gas usage at a 15 Gwei gas cost, how much Ether would you be required to pay the miner?
- 750,000 Wei
- 750,000,000,000,000 Wei (Correct answer)
- 750,000,000,000 Wei
- A fixed charge of 1 Ether
Correct answer: 750,000,000,000,000 Wei
To calculate the total Ether paid, multiply the gas usage by the gas cost: 50,000 gas * 15 Gwei/gas = 750,000 Gwei. Since 1 Gwei is 1,000,000,000 Wei (10^9 Wei), convert Gwei to Wei: 750,000 Gwei * 1,000,000,000 Wei/Gwei = 750,000,000,000,000 Wei. This conversion is crucial for understanding the actual cost in the smallest denomination of Ether.
Question 68: Which JSON-RPC method is used to get the ETH balance of an address on Ethereum?
- eth_getBalance (Correct answer)
- eth_getTransactionCount
- eth_accounts
- eth_call
Correct answer: eth_getBalance
`eth_getBalance` returns the Wei balance of a given address at a specified block number.
Question 69: What is the role of an oracle in a DeFi smart contract?
- To provide off-chain real-world data (like prices) to smart contracts on-chain (Correct answer)
- To audit smart contracts for security vulnerabilities
- To validate transactions before they are included in a block
- To relay transactions to layer-2 networks
Correct answer: To provide off-chain real-world data (like prices) to smart contracts on-chain
Oracles bridge the gap between on-chain contracts and off-chain data sources, supplying information like asset prices.
Question 70: What is the maximum number of indexed parameters allowed in a Solidity event?
- 3 (Correct answer)
- 2
- 5
- 4
Correct answer: 3
Solidity allows up to 3 indexed event parameters, which are stored as topics in the transaction log for efficient filtering.
Certified Blockchain Developer - Ethereum (CBDE)
The CBDE is a performance-based certification that validates practical Ethereum development skills including Solidity smart contract development, EVM mechanics, gas optimization, token standards, DeFi protocols, and Layer 2 scaling solutions. Offered by the Blockchain Training Alliance (BTA).
Exam Rules
- You can skip questions and return to them later
- Flag questions for review before submitting
- No feedback shown until you submit the entire exam
- Unanswered questions count as wrong — answer everything
- 10 pretest questions are mixed in and don't affect your score
- Timer auto-submits when time runs out
- Your progress is auto-saved every 30 seconds