Certified Blockchain Developer - Ethereum (CBDE) — Questions and Answers
Question 1: Which Solidity data type is used to store Ethereum addresses?
- string
- bytes20
- uint160
- address (Correct answer)
Correct answer: address
The `address` type is a 20-byte value specifically designed to hold Ethereum addresses.
Question 2: What is the purpose of Foundry's `forge test` command?
- To generate ABI files for all contracts in the project
- To simulate gas costs for a deployment
- To compile contracts and check for syntax errors
- To run Solidity-native unit tests written directly in Solidity (Correct answer)
Correct answer: To run Solidity-native unit tests written directly in Solidity
`forge test` runs test contracts written in Solidity using Foundry's testing framework, providing fast and native EVM-level testing.
Question 3: Which of the following is NOT a valid data location in the EVM?
- Cache (Correct answer)
- Storage
- Stack
- Memory
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 4: 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?
- A fixed charge of 1 Ether
- 750,000,000,000,000 Wei (Correct answer)
- 750,000 Wei
- 750,000,000,000 Wei
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 5: What makes unit testing so crucial?
- All of the statement are true.
- 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)
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 6: How much Ether would you have to pay the miner if you interacted with a smart contract and saw a gas usage of 50,000 gas at a cost of 15 Gwei?
- A single charge of 1 Ether
- 750,000,000 Wei
- 750,000,000,000,000 Wei (Correct answer)
- 750,000,000,000 Wei
Correct answer: 750,000,000,000,000 Wei
To calculate the total Ether paid, multiply the gas usage by the gas price. Given 50,000 gas and 15 Gwei (15 * 10^9 Wei), the total cost is 50,000 * 15 * 10^9 Wei. This calculation results in 750,000,000,000,000 Wei, which is the amount paid to the miner for executing the transaction.
Question 7: How many stakeholders made up the DAO?
- 18000 (Correct answer)
- 48000
- 35000
- 10000
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 8: What does `eth_call` do in contrast to `eth_sendTransaction`?
- eth_call requires a signed transaction; eth_sendTransaction does not
- eth_call sends ETH while eth_sendTransaction calls functions
- eth_call is deprecated and replaced by eth_sendTransaction
- eth_call simulates a call without modifying state; eth_sendTransaction writes to the chain (Correct answer)
Correct 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.
Question 9: Choose the correct scientific notation?
- 1 Ether = 10^18 wei, 10^6 Gwei, 10^6 Finney
- 1 Ether = 10^19 wei, 10^13 Gwei, 10^3 Finney
- 1 Ether = 10^18 wei, 10^9 Gwei, 10^3 Finney (Correct answer)
- 1 Ether = 10^16 wei, 10^13 Gwei, 10^3 Finney
Correct answer: 1 Ether = 10^18 wei, 10^9 Gwei, 10^3 Finney
Ethereum uses various denominations for its native currency, Ether, to represent different values. The smallest unit is `wei`, with 1 Ether being equivalent to 10^18 wei. Other common units include `Gwei` (giga-wei), where 1 Ether equals 10^9 Gwei, and `Finney`, where 1 Ether equals 10^3 Finney, providing convenient ways to express transaction amounts.
Question 10: This would be the appropriate syntax if contract MyContractA is derived from contract MyContractB:
- contract MyContractA inherit (MyContractB) {...}
- contract MyContractA is MyContractB { ... } (Correct answer)
- 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 11: Which is TRUE about the Fallback function?
- Cannot accept Ether, even after applying the payable modifier.
- Can be as logical as you like, but it's best to keep it brief and not go over the 2300 gas allotment. (Correct answer)
- It is a method for preventing ether receipt.
Correct answer: Can be as logical as you like, but it's best to keep it brief and not go over the 2300 gas allotment.
The fallback function in Solidity is executed when a contract receives Ether without any data, or when a function is called that doesn't exist. It has a strict gas limit of 2300 gas when called by a plain Ether transfer, making it crucial to keep its logic minimal. While it can contain logic, exceeding this gas limit will cause the transaction to fail, so brevity is key for successful Ether transfers.
Question 12: What does the `abstract` keyword indicate about a Solidity contract?
- It is optimized for low gas consumption
- It cannot inherit from other contracts
- 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 13: What is a reentrancy attack in the context of DeFi smart contracts?
- An attack that floods a contract with transactions to drain gas
- An exploit where a malicious contract repeatedly calls back into a vulnerable contract before state is updated (Correct answer)
- A front-running attack on DEX trades
- An exploit targeting integer overflow in token balances
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 14: What is a sequencer in a rollup network?
- A centralized or decentralized node that orders and batches transactions before posting them to L1 (Correct answer)
- A validator node that proposes new Ethereum blocks
- A smart contract that verifies ZK proofs on Ethereum
- A relay that bridges assets from L1 to L2
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 15: What does the `nonce` in an Ethereum transaction represent?
- 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
- A timestamp preventing transaction replay
- The amount of gas pre-authorized for the transaction
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 16: To create intelligent contracts:
- A local in-memory blockchain with unit tests is a good place to start, but as soon as you can, deploy to the main-net.
- A local in-memory blockchain with unit tests is an excellent place to start. Next, test and debug the smart contract with beta users on a test network like Ropsten or Rinkeby to iron out any last kinks before deploying it to the main network. (Correct answer)
- A test-net with beta users, such as the Rinkeby or Ropsten testnet, is a nice place to start before testing it locally on an in-memory blockchain simulation like Ganache. Then roll it out to the main network.
Correct answer: A local in-memory blockchain with unit tests is an excellent place to start. Next, test and debug the smart contract with beta users on a test network like Ropsten or Rinkeby to iron out any last kinks before deploying it to the main network.
The recommended approach for smart contract development involves a phased testing strategy to ensure robustness and security. Developers should start with local in-memory blockchains (like Ganache) for rapid unit testing and debugging. After local validation, the contract should be deployed to public test networks (e.g., Sepolia, Goerli) for more extensive testing with beta users, allowing for real-world scenario validation before the final, irreversible deployment to the main Ethereum network.
Question 17: What is the difference between `memory` and `storage` in Solidity?
- storage holds function parameters; memory holds state variables
- memory is cheaper than storage for all operations
- memory is temporary and wiped after execution; storage persists on-chain (Correct answer)
- memory is for arrays only; storage is for all types
Correct answer: memory is temporary and wiped after execution; storage persists on-chain
`memory` variables exist only during function execution while `storage` variables persist permanently on the blockchain.
Question 18: What is a storage collision problem in upgradeable proxy contracts?
- When a contract exceeds the 2^256 storage slot limit
- When two contracts attempt to write to the same storage slot simultaneously
- When SSTORE opcodes from different transactions conflict in the mempool
- When the proxy and implementation use the same storage slots, causing data corruption during upgrades (Correct answer)
Correct answer: When the proxy and implementation use the same storage slots, causing data corruption during upgrades
Storage collision occurs when the proxy contract's own variables occupy the same storage slots as the implementation's variables, corrupting state.
Question 19: What address will be in msg.sender in Contract B if a User calls Contract A and that calls Contract B?
- Contract A (Correct answer)
- The User
- None of the above
Correct answer: Contract A
In Solidity, `msg.sender` always refers to the immediate external account or contract that initiated the current function call. If a user calls Contract A, and Contract A then calls Contract B, the `msg.sender` within Contract B's execution context will be the address of Contract A. The original user's address would be available via `tx.origin`.
Question 20: 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 require sequencer decentralization; Optimistic Rollups do not
- ZK Rollups are faster to withdraw from than Optimistic Rollups
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 21: In ethers.js v6, how do you convert a value from Ether to Wei?
- ethers.utils.toWei('1.0')
- ethers.BigNumber.fromEther(1.0)
- ethers.parseEther('1.0') (Correct answer)
- 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 22: What is an Ethereum layer-2 (L2) solution?
- 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)
- A smart contract upgrade mechanism for existing dApps
- An alternative client implementation of the Ethereum node
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 23: What is the role of an oracle in a DeFi smart contract?
- To relay transactions to layer-2 networks
- To provide off-chain real-world data (like prices) to smart contracts on-chain (Correct answer)
- To validate transactions before they are included in a block
- To audit smart contracts for security vulnerabilities
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 24: What does TVL stand for in DeFi protocols?
- Total Value Locked (Correct answer)
- Transaction Volume Limit
- Token Vault Liquidity
- Total Verified Loans
Correct answer: Total Value Locked
Total Value Locked (TVL) measures the total value of assets deposited and held within a DeFi protocol's smart contracts.
Question 25: In Solidity, what is a `mapping`?
- A hash table that maps keys to values (Correct answer)
- A linked list data structure
- A pointer to a storage slot
- An ordered array of key-value pairs
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 26: Which EIP number applies to the Hybrid Casper FFG proposal?
- 1010
- 1110
- 1000
- 1011 (Correct answer)
Correct answer: 1011
EIP-1011, titled 'Hybrid Casper FFG', proposed a significant change to Ethereum's consensus mechanism. This Ethereum Improvement Proposal outlined a hybrid approach that would combine the existing Proof-of-Work (PoW) chain with a Proof-of-Stake (PoS) 'Friendly Finality Gadget' (FFG), serving as a transitional step towards a full PoS system.
Question 27: Which visibility specifier restricts a function to be called only within the contract itself?
- public
- internal
- private (Correct answer)
- external
Correct answer: private
The `private` visibility means the function can only be called from within the same contract, not from derived contracts.
Question 28: What EIP defines the ERC-20 fungible token standard?
- EIP-20 (Correct answer)
- EIP-1155
- EIP-721
- EIP-2612
Correct answer: EIP-20
EIP-20 (commonly called ERC-20) defines the standard interface for fungible tokens on Ethereum.
Question 29: What does `eth_estimateGas` return?
- The maximum gas a block can hold
- An estimate of the gas required to execute a given transaction (Correct answer)
- The current base fee per gas on the network
- The gas used by the last confirmed transaction
Correct answer: An estimate of the gas required to execute a given transaction
`eth_estimateGas` simulates a transaction and returns an approximate gas cost without submitting it to the network.
Question 30: What is the purpose of the `SELFDESTRUCT` opcode in Solidity (pre-Cancun)?
- To remove the contract from the active validator set
- To terminate the current transaction without reverting state
- To reset all contract storage to zero values
- To destroy the contract and send its remaining ETH balance to a specified address (Correct answer)
Correct answer: To destroy the contract and send its remaining ETH balance to a specified address
`SELFDESTRUCT` (now deprecated in EIP-6780) would remove contract bytecode and forward the ETH balance to a target address.
Question 31: Which Solidity keyword is used to declare a function that cannot modify contract state?
- pure
- constant
- view (Correct answer)
- immutable
Correct answer: view
The `view` keyword declares a function that can read but not modify state variables.
Question 32: 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 33: What does the `chainId` field in an EIP-155 transaction prevent?
- Front-running by miners reordering transactions
- Reentrancy attacks on ETH withdrawal functions
- Replay attacks where a transaction signed for one network is resubmitted on another (Correct answer)
- Gas griefing from contracts consuming excessive gas
Correct answer: Replay attacks where a transaction signed for one network is resubmitted on another
EIP-155 added `chainId` to the transaction signature to prevent a valid Ethereum mainnet transaction from being replayed on testnets or other EVM chains.
Question 34: What is a state channel in Ethereum layer-2 scaling?
- A channel between Ethereum nodes for fast block propagation
- An off-chain communication channel between parties that only settles the final state on-chain (Correct answer)
- A private blockchain that posts merkle roots to Ethereum
- A smart contract that channels funds between DeFi protocols
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 35: What is the primary function of a lending protocol like Aave or Compound?
- Facilitate NFT auctions on-chain
- Create synthetic exposure to off-chain assets
- Allow users to deposit assets to earn interest and borrow against collateral (Correct answer)
- Provide decentralized insurance for smart contract risk
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 36: What is the Solidity `constructor` function used for?
- Initializing contract state when it is deployed (Correct answer)
- Defining the ABI of the contract
- Creating new contract instances
- 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 37: What is the key distinction between ERC-20 and ERC-721 tokens?
- ERC-721 allows batch transfers by default
- ERC-20 tokens represent ownership of NFTs
- ERC-721 tokens have higher decimal precision
- ERC-721 tokens are non-fungible and each has a unique ID (Correct answer)
Correct answer: ERC-721 tokens are non-fungible and each has a unique ID
ERC-721 tokens are non-fungible, meaning each token has a unique identifier and cannot be exchanged 1:1 with another.
Question 38: What function must an ERC-20 contract implement to allow a spender to transfer tokens on behalf of an owner?
- allowance()
- transfer()
- approve() (Correct answer)
- mint()
Correct answer: approve()
The `approve()` function grants a spender permission to transfer a specified amount of tokens on the owner's behalf.
Question 39: What is gas in Ethereum and why does it exist?
- A measure of network congestion used to throttle transaction throughput
- The fee paid to bridge assets between L1 and L2 networks
- A token earned by validators for including transactions in blocks
- A unit measuring computational work, preventing infinite loops and spam by requiring payment for execution (Correct answer)
Correct answer: A unit measuring computational work, preventing infinite loops and spam by requiring payment for execution
Gas quantifies EVM computation cost, ensuring users pay for resources used and preventing denial-of-service attacks via infinite loops.
Question 40: What does EIP-2612 add to the ERC-20 standard?
- Token metadata storage on-chain
- Permit functionality enabling gasless approvals via off-chain signatures (Correct answer)
- Built-in minting and burning functions
- 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 41: What does the EVM opcode SSTORE do?
- Stores a value in transient memory
- Stops execution and returns output data
- Loads a value from storage onto the stack
- Writes a value from the stack into persistent contract storage (Correct answer)
Correct answer: Writes a value from the stack into persistent contract storage
SSTORE pops a key and value from the stack and writes the 32-byte value into the contract's persistent storage at that key.
Question 42: What is a flash loan in DeFi?
- A loan backed by NFT collateral
- A loan that expires after one block
- A loan with a very low interest rate
- An uncollateralized loan that must be borrowed and repaid within a single transaction (Correct answer)
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 43: What is a stablecoin in the Ethereum ecosystem?
- 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
- A token that cannot be transferred once issued
- An NFT representing a real-world asset
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 44: After a new block has been mined,
- None of the above
- 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.
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 45: What major change did the Ethereum Merge (2022) introduce?
- Implemented sharding for parallel transaction processing
- Merged Ethereum mainnet with Polygon
- Replaced Proof of Work with Proof of Stake consensus (Correct answer)
- Increased the block size to reduce fees
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 46: What does the `require` statement do in Solidity when its condition is false?
- Emits an error event
- Returns a false boolean
- Pauses the contract
- Reverts the transaction and refunds unused gas (Correct answer)
Correct answer: Reverts the transaction and refunds unused gas
When `require` fails, it reverts all state changes and refunds the remaining gas to the caller.
Question 47: 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 smart contract deployed on Ethereum to manage user sessions
- A decentralized storage solution for dApp data
- A compiler for Solidity code in the browser
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 48: Which Solidity function is called when Ether is sent to a contract with no calldata?
- default()
- receive() (Correct answer)
- fallback()
- deposit()
Correct answer: receive()
The `receive()` function handles plain Ether transfers with empty calldata, and must be marked `payable`.
Question 49: What is 'gas' in the context of the Ethereum network?
- A unit measuring the computational work required to execute operations (Correct answer)
- The cryptocurrency used to reward validators
- The total amount of Ether held in a contract
- The number of pending transactions in the mempool
Correct answer: A unit measuring the computational work required to execute operations
Gas is a unit that measures the computational effort required to execute specific operations, preventing infinite loops and metering resource usage.
Question 50: Which eth2 client does Chainsafe support?
- Teku
- Lodestar (Correct answer)
- Lighthouse
- Trinity
Correct answer: Lodestar
Chainsafe is a prominent blockchain development company that actively contributes to the Ethereum ecosystem. They are the development team behind the Lodestar client, which is an Ethereum 2.0 (Consensus Layer) client implementation. Lodestar is written in TypeScript and is designed to be a lightweight and efficient client for the network.
Question 51: Which is TRUE about Ethereum Nodes?
- To connect with websites, you must use Web3.js.
- Must implement a JSON-RPC for communication with clients and the Ethereum Protocol. (Correct answer)
- Must implement the Ethereum protocol, and only the exclusive Ethereum Libraries like Web3.js can be used for external access.
Correct answer: Must implement a JSON-RPC for communication with clients and the Ethereum Protocol.
Ethereum nodes are software applications that adhere to the Ethereum protocol to interact with the blockchain. For external applications like dApps, wallets, or explorers to communicate with these nodes, a standardized interface is essential. This interface is typically a JSON-RPC (Remote Procedure Call) API, which allows clients to send requests and receive data from the node.
Question 52: What formula does Uniswap v2 use to maintain liquidity pool balance?
- x + y = k
- x / y = k
- x * y = k (Correct answer)
- x^2 + y^2 = 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 53: To prevent problems during updates to the Ethereum platform
- It's a good idea to send out a newsletter informing users of the updates.
- Ethereum does not make platform upgrades. It is fixed and complete.
- The ability to suspend a contract is useful for managing the risky capital. (Correct answer)
Correct answer: The ability to suspend a contract is useful for managing the risky capital.
The ability to pause or suspend a smart contract is a critical feature for managing risk, especially during platform upgrades or in response to discovered vulnerabilities. This mechanism allows developers to temporarily halt contract operations, preventing further funds from being locked or exploited. It provides a safety net to protect user capital and allows time for necessary fixes or adjustments to be implemented.
Question 54: Checking an address's balance repeatedly inside a smart contract's loop
- Both statement are correct
- Doesn't require any gas (Correct answer)
- Requires gas cost each time we check the account.
Correct answer: Doesn't require any gas
Accessing an address's balance within a smart contract loop, such as using `address.balance`, is a read-only operation that queries existing state information. Reading from the blockchain state does not incur additional gas costs for each read operation beyond the initial transaction execution cost. Gas is primarily consumed for state modifications or complex computations.
Question 55: What is EIP-1559 and what problem does it address?
- A proposal to double the block gas limit for scalability
- An upgrade that enabled smart contracts on the Beacon Chain
- A fee market reform that introduced a base fee burned per transaction, reducing fee unpredictability (Correct answer)
- A standard for gasless meta-transactions
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 56: What is impermanent loss in DeFi liquidity provision?
- Value lost to slippage on large trades
- Fees lost when a transaction fails
- The temporary loss experienced by liquidity providers due to price divergence of pooled assets (Correct answer)
- Loss from smart contract exploits
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 57: Complete the statement : "Gas costs accrue on..."
- Sending a transaction that solely interacts with a smart contract that has already been deployed
- Sending a transaction regardless of its content. (Correct answer)
- Only deploying a new smart contract when sending a transaction.
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 58: What is the maximum number of indexed parameters allowed in a Solidity event?
- 3 (Correct answer)
- 4
- 2
- 5
Correct answer: 3
Solidity allows up to 3 indexed event parameters, which are stored as topics in the transaction log for efficient filtering.
Question 59: What is account abstraction in Ethereum, as proposed by ERC-4337?
- Enabling accounts to hold multiple assets without separate contracts
- Replacing EOAs with multi-sig wallets as the default account type
- Allowing smart contracts to act as user accounts with custom validation logic for transactions (Correct answer)
- Abstracting private keys away from users with biometric authentication
Correct answer: Allowing smart contracts to act as user accounts with custom validation logic for transactions
ERC-4337 enables smart contract wallets with programmable transaction validation, enabling gasless transactions, social recovery, and batch operations.
Question 60: What is an Ethereum event filter used for in ethers.js?
- To filter out spam transactions in a block
- To restrict which addresses can call a contract
- To listen for and query specific smart contract events emitted on-chain (Correct answer)
- To set gas price limits for outgoing transactions
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 61: Variables of the type address hold
- A value of 32 bytes
- A value of 20 bytes (Correct answer)
- A string
- A 20-character hexadecimal number
Correct answer: A value of 20 bytes
An Ethereum address is a 160-bit (20-byte) identifier for an account or contract on the blockchain. It is typically represented as a 40-character hexadecimal string prefixed with '0x'. This 20-byte length is a fundamental characteristic of Ethereum addresses.
Question 62: What is a Signer in ethers.js?
- A node operator that validates blocks
- A contract that manages key recovery
- An abstraction that holds a private key and can sign and send transactions (Correct answer)
- A function that verifies the validity of a signature
Correct answer: An abstraction that holds a private key and can sign and send transactions
A Signer in ethers.js is an abstraction over a private key, enabling signing messages and sending transactions to the Ethereum network.
Question 63: What is Ethereum's 'difficulty bomb' and why was it introduced?
- A fee mechanism that burns ETH when block utilization exceeds 50%
- A mechanism that exponentially increased mining difficulty to encourage the transition to Proof of Stake (Correct answer)
- A network rule that slashes validators for double-signing blocks
- A smart contract that destroys ETH to reduce circulating supply
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 64: Which gas optimization pattern moves expensive computation off-chain and uses on-chain verification only?
- Opcode batching via assembly
- Merkle proofs and cryptographic verification (Correct answer)
- Lazy evaluation via storage flags
- Storage sharding across contracts
Correct answer: Merkle proofs and cryptographic verification
Merkle proofs allow a contract to verify membership in a large dataset with O(log n) on-chain hashing instead of storing and iterating the full dataset.
Question 65: What is the maximum stack depth of the EVM?
- 1024 items (Correct answer)
- 512 items
- 2048 items
- 4096 items
Correct answer: 1024 items
The EVM stack has a maximum depth of 1024 items; exceeding this limit causes a stack overflow and reverts execution.
Question 66: Which JSON-RPC method is used to get the ETH balance of an address on Ethereum?
- eth_accounts
- eth_getTransactionCount
- eth_call
- eth_getBalance (Correct answer)
Correct answer: eth_getBalance
`eth_getBalance` returns the Wei balance of a given address at a specified block number.
Question 67: What does AMM stand for in the context of DeFi?
- Automated Market Maker (Correct answer)
- Asset Management Module
- Autonomous Minting Mechanism
- Aggregated Margin Model
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 68: Among the Ethereum addresses, public keys, and private keys, which statement is TRUE?
- A public key is 32 characters, a private key is 64 characters long, and an address is 20 characters long.
- An address is 20 bytes long, a public key is 64 bytes and the private key is 32 bytes (Correct answer)
- The address serves as the public key; both are 20 bytes long, whereas the private key is 32 bytes long.
Correct answer: An address is 20 bytes long, a public key is 64 bytes and the private key is 32 bytes
In Ethereum's cryptographic architecture, a private key is a 32-byte (256-bit) random number. From this private key, a 64-byte (512-bit) public key is derived using elliptic curve cryptography. Finally, an Ethereum address is generated by taking the last 20 bytes of the Keccak-256 hash of the public key.
Question 69: What is the purpose of the ERC-1155 multi-token standard?
- To replace ERC-20 with better gas efficiency
- To manage multiple token types (fungible and non-fungible) in a single contract (Correct answer)
- To enable cross-chain token transfers
- To define royalty standards for NFT marketplaces
Correct answer: To manage multiple token types (fungible and non-fungible) in a single contract
ERC-1155 allows a single smart contract to manage both fungible and non-fungible tokens, reducing deployment costs and complexity.
Question 70: Why are Solidity events more gas-efficient than contract storage for recording historical data?
- Events are compressed automatically by the EVM before persisting
- 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 stored off-chain and don't consume any gas
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.
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