1Who proposed the Ethereum platform in a white paper published in late 2013?
A.Satoshi Nakamoto
B.Vitalik Buterin
C.Nick Szabo
D.Gavin Wood
Correct Answer: Vitalik Buterin
Explanation:Ethereum was proposed in late 2013 by Vitalik Buterin, a cryptocurrency researcher and programmer.
Incorrect! Try again.
2What is the primary unit of computation cost in the Ethereum Virtual Machine (EVM)?
A.Ether
B.Wei
C.Gas
D.Gwei
Correct Answer: Gas
Explanation:Gas is the unit that measures the amount of computational effort required to execute specific operations on the Ethereum network.
Incorrect! Try again.
3Which of the following best describes the Turing Completeness of the Ethereum Virtual Machine?
A.It can only calculate financial transactions.
B.It can solve any computational problem given enough resources (time and memory).
C.It is restricted to stateless scripting like Bitcoin.
D.It cannot execute loops or complex logic.
Correct Answer: It can solve any computational problem given enough resources (time and memory).
Explanation:A Turing-complete system is one that can perform any calculation that a programmable computer is capable of, provided it has enough resources. Ethereum's EVM is quasi-Turing complete due to the gas limit.
Incorrect! Try again.
4What mechanism does Ethereum use to solve the Halting Problem associated with Turing-complete languages?
A.Time-locks
B.Gas limits
C.Proof of Work
D.Static Analysis
Correct Answer: Gas limits
Explanation:The Halting Problem states that it is impossible to know if a program will run forever. Ethereum solves this by charging a fee (Gas) for every instruction; if the gas runs out, the execution halts.
Incorrect! Try again.
5In the context of Smart Contracts vs. Legal Contracts, what does the phrase "Code is Law" imply?
A.Smart contracts are recognized by all international courts.
B.The code will execute exactly as written, regardless of the developer's original intent or external legal frameworks.
C.Lawyers must write the code for it to be valid.
D.Smart contracts can only be used for criminal justice applications.
Correct Answer: The code will execute exactly as written, regardless of the developer's original intent or external legal frameworks.
Explanation:"Code is Law" implies that the software rules are absolute and the execution is immutable, which can lead to issues if the code contains bugs or logic errors.
Incorrect! Try again.
6Which of the following is a primary difference between Bitcoin Scripting and Ethereum Smart Contracts?
A.Bitcoin script is Turing complete; Ethereum is not.
B.Bitcoin script is stack-based and generally stateless; Ethereum is stateful.
C.Bitcoin supports loops; Ethereum does not.
D.Bitcoin uses Solidity; Ethereum uses C++.
Correct Answer: Bitcoin script is stack-based and generally stateless; Ethereum is stateful.
Explanation:Bitcoin's scripting language is intentionally not Turing complete (no loops) and is stateless (validates UTXOs). Ethereum maintains a global state and supports complex, stateful computations.
Incorrect! Try again.
7What is the primary file extension used for Solidity source code?
A..eth
B..js
C..sol
D..py
Correct Answer: .sol
Explanation:Solidity source code files are saved with the .sol extension.
Incorrect! Try again.
8In Solidity, what constitutes the state of a smart contract?
A.The functions defined in the contract.
B.The variables declared at the contract level (storage variables).
C.The local variables inside functions.
D.The gas price at the time of execution.
Correct Answer: The variables declared at the contract level (storage variables).
Explanation:State variables are variables whose values are permanently stored in contract storage on the blockchain.
Incorrect! Try again.
9Which of the following correctly defines Formal Verification in the context of smart contracts?
A.Checking the code for syntax errors using a compiler.
B.Using mathematical proofs to ensure the code behaves exactly as specified.
C.Having a lawyer read the code manually.
D.Running the code on a testnet before mainnet.
Correct Answer: Using mathematical proofs to ensure the code behaves exactly as specified.
Explanation:Formal verification involves proving or disproving the correctness of intended algorithms underlying a system with respect to a certain formal specification or property, using formal methods of mathematics.
Incorrect! Try again.
10What is the smallest denomination of Ether?
A.Finney
B.Szabo
C.Gwei
D.Wei
Correct Answer: Wei
Explanation:Wei is the smallest unit of Ether. .
Incorrect! Try again.
11Which data location in Solidity represents persistent storage on the blockchain?
A.memory
B.calldata
C.storage
D.stack
Correct Answer: storage
Explanation:The storage location holds state variables and is persistent across function calls and transactions. memory is temporary.
Incorrect! Try again.
12How does Bitcoin's UTXO model differ from Ethereum's Account model regarding balance management?
A.Bitcoin calculates balances by summing unspent outputs; Ethereum stores balances directly in accounts.
B.Bitcoin stores balances in accounts; Ethereum sums unspent outputs.
C.Both use the UTXO model.
D.Both use the Account model.
Correct Answer: Bitcoin calculates balances by summing unspent outputs; Ethereum stores balances directly in accounts.
Explanation:Ethereum uses an account-based model (similar to a bank account) where the state tracks the current balance. Bitcoin uses the Unspent Transaction Output (UTXO) model.
Incorrect! Try again.
13What keyword is used in Solidity to allow a function to receive Ether?
A.money
B.transferable
C.payable
D.accept
Correct Answer: payable
Explanation:The payable modifier is required for a function (or address) to receive Ether.
Incorrect! Try again.
14When writing a smart contract in Solidity, what is the purpose of the pragma directive?
A.To import JavaScript libraries.
B.To define the gas limit.
C.To specify the compiler version compatibility.
D.To declare the contract owner.
Correct Answer: To specify the compiler version compatibility.
Explanation:The pragma solidity line tells the compiler which version of Solidity the code is written for to prevent incompatibility issues.
Incorrect! Try again.
15Which global variable in Solidity contains the address of the person (or contract) calling the function?
A.tx.origin
B.msg.sender
C.this.address
D.msg.value
Correct Answer: msg.sender
Explanation:msg.sender is a global variable that refers to the address of the immediate sender of the message (current call).
Incorrect! Try again.
16Why is verification of smart contracts significantly harder than verification of Bitcoin scripts?
A.Bitcoin scripts are longer.
B.Ethereum smart contracts can have complex loops, state changes, and external calls.
C.Solidity is an older language than Bitcoin Script.
D.Bitcoin scripts are encrypted.
Correct Answer: Ethereum smart contracts can have complex loops, state changes, and external calls.
Explanation:The Turing-complete nature, combined with mutable state and interaction between contracts, makes the possible state space of Ethereum contracts vastly larger and harder to verify formally.
Incorrect! Try again.
17Which JavaScript library is commonly used to interact with the Ethereum blockchain?
A.React.js
B.Web3.js
C.Node.js
D.JQuery
Correct Answer: Web3.js
Explanation:Web3.js (and Ethers.js) are the standard libraries for interacting with Ethereum nodes using HTTP, IPC, or WebSocket.
Incorrect! Try again.
18What is the ABI (Application Binary Interface) in the context of Ethereum?
A.The machine code stored on the blockchain.
B.A JSON description of the contract's functions and events needed for interaction.
C.The address of the contract.
D.The private key of the developer.
Correct Answer: A JSON description of the contract's functions and events needed for interaction.
Explanation:The ABI acts as an interface between two program modules, specifically allowing JavaScript (frontend) to know how to format calls to the bytecode (backend).
Incorrect! Try again.
19What happens if a Solidity function requires more gas than the transaction's gas limit?
A.The transaction pauses and waits for more gas.
B.The transaction succeeds but is slower.
C.The transaction reverts, and all changes are undone, but the gas is consumed.
D.The transaction is mined with a special flag.
Correct Answer: The transaction reverts, and all changes are undone, but the gas is consumed.
Explanation:If an Out of Gas (OOG) exception occurs, the state reverts to its condition before the transaction, but the miner keeps the fees for the work done up to that point.
Incorrect! Try again.
20Which Solidity data type represents a hash map or dictionary?
A.array
B.struct
C.mapping
D.enum
Correct Answer: mapping
Explanation:Mappings act as hash tables which consist of key types and corresponding value types pairs. Syntax: mapping(KeyType => ValueType).
Incorrect! Try again.
21In terms of legal enforcement, a major challenge for smart contracts is:
A.They cannot handle digital assets.
B.They are too slow.
C.They lack the ability to handle subjective ambiguity or 'spirit of the law'.
D.They require a third party to execute.
Correct Answer: They lack the ability to handle subjective ambiguity or 'spirit of the law'.
Explanation:Legal contracts often rely on human interpretation of intent and ambiguity. Smart contracts execute rigid logic, making them unable to handle subjective nuances without an external arbiter (oracle/DAO).
Incorrect! Try again.
22What is the purpose of the constructor function in a Solidity contract?
A.To destroy the contract.
B.To execute code only once when the contract is deployed.
C.To allow users to pay the contract.
D.To update the contract code.
Correct Answer: To execute code only once when the contract is deployed.
Explanation:The constructor is a special function that is executed only once upon the creation of the contract, typically used to initialize state variables.
Incorrect! Try again.
23What is a re-entrancy attack?
A.Stealing a private key.
B.A malicious contract calling back into the calling contract before the first invocation is finished.
C.Mining a block faster than others.
D.Guessing the nonce of a transaction.
Correct Answer: A malicious contract calling back into the calling contract before the first invocation is finished.
Explanation:This is a vulnerability where an external call hijacks the control flow, allowing the attacker to re-enter the vulnerable function (often draining funds) before the state is updated.
Incorrect! Try again.
24Which of the following is NOT a valid visibility modifier in Solidity?
A.public
B.external
C.internal
D.protected
Correct Answer: protected
Explanation:Solidity uses public, private, internal, and external. protected is not a keyword in Solidity.
Incorrect! Try again.
25What is the distinction between view and pure functions in Solidity?
A.view reads state but doesn't modify it; pure neither reads nor modifies state.
B.pure reads state; view modifies state.
C.Both modify state.
D.They are identical.
Correct Answer: view reads state but doesn't modify it; pure neither reads nor modifies state.
Explanation:view functions promise not to modify the state. pure functions promise not to read from or modify the state.
Explanation:EVM code is a sequence of bytes, where each byte represents an operation (Opcode) like ADD, SSTORE, etc.
Incorrect! Try again.
27What does the require(condition, message) function do in Solidity?
A.It logs a message to the console.
B.It checks a condition; if false, it reverts the transaction and refunds remaining gas.
C.It checks a condition; if false, it consumes all gas and crashes.
D.It is used to import libraries.
Correct Answer: It checks a condition; if false, it reverts the transaction and refunds remaining gas.
Explanation:require is used for input validation and checking conditions. If the condition is not met, it reverts changes and returns unused gas.
Incorrect! Try again.
28Unlike Bitcoin, Ethereum distinguishes between two types of accounts. What are they?
A.Admin Accounts and User Accounts.
B.Externally Owned Accounts (EOA) and Contract Accounts.
C.Savings Accounts and Checking Accounts.
D.Miners and Validators.
Correct Answer: Externally Owned Accounts (EOA) and Contract Accounts.
Explanation:EOAs are controlled by private keys (humans), whereas Contract Accounts are controlled by their contract code.
Incorrect! Try again.
29Which Solidity keyword is used to create a custom error logging mechanism on the blockchain?
A.log
B.print
C.event
D.alert
Correct Answer: event
Explanation:Events allow smart contracts to log data to the blockchain, which can be listened to by frontend applications (e.g., emit Transfer(...)).
Incorrect! Try again.
30In a JavaScript application using Web3, what is a Provider?
A.The person paying for the gas.
B.The library used to compile Solidity.
C.The connection object that allows the library to communicate with an Ethereum node.
D.The smart contract address.
Correct Answer: The connection object that allows the library to communicate with an Ethereum node.
Explanation:A provider (e.g., MetaMask, Infura) provides the connection to the Ethereum blockchain network.
Incorrect! Try again.
31Why creates the 'Oracle Problem' in smart contracts?
A.Smart contracts cannot natively access external data (off-chain) like weather or stock prices.
B.Oracles are too expensive.
C.Smart contracts cannot perform math.
D.Oracles slow down the blockchain.
Correct Answer: Smart contracts cannot natively access external data (off-chain) like weather or stock prices.
Explanation:Blockchains are deterministic closed systems. They cannot reach out to the internet (API calls). Oracles are middleware required to bring off-chain data on-chain.
Incorrect! Try again.
32Which of the following Solidity snippets defines a fixed-size array of 10 integers?
A.uint[] x = 10;
B.uint[10] x;
C.array<uint, 10> x;
D.uint x(10);
Correct Answer: uint[10] x;
Explanation:In Solidity, type[n] defines a fixed-size array of size n.
Incorrect! Try again.
33What is the implication of Ethereum being a 'Stateful' protocol compared to Bitcoin?
A.Ethereum transactions depend only on previous outputs.
B.Ethereum keeps a record of the current status of all accounts and contracts, updated by transactions.
C.Ethereum does not use a blockchain.
D.Ethereum state is reset every block.
Correct Answer: Ethereum keeps a record of the current status of all accounts and contracts, updated by transactions.
Explanation:Stateful means the network remembers the current information (storage, balances, nonces) for all accounts, allowing for complex multi-step applications.
Incorrect! Try again.
34Which function is automatically executed when a contract receives Ether without data?
A.fallback()
B.receive()
C.deposit()
D.main()
Correct Answer: receive()
Explanation:The receive() function is a special function triggered when a contract receives a plain Ether transfer (empty calldata).
Incorrect! Try again.
35In Solidity, what is a Modifier?
A.A person who changes the code.
B.A reusable piece of code that can change the behavior of functions (e.g., checks preconditions).
C.A variable type.
D.A compiler setting.
Correct Answer: A reusable piece of code that can change the behavior of functions (e.g., checks preconditions).
Explanation:Modifiers (e.g., onlyOwner) are used to easily change the behavior of functions, often for access control checks before the function body executes.
Incorrect! Try again.
36What is the relationship between Gas Price, Gas Limit, and Transaction Fee?
A.
B.
C.
D.
Correct Answer:
Explanation:The total fee paid is the amount of gas actually consumed by the computation multiplied by the price per unit of gas set by the user.
Incorrect! Try again.
37Which of the following is true regarding Immutability and legal contracts on the blockchain?
A.If a smart contract has a legal error, a court can easily edit the code.
B.Immutability ensures that once deployed, the contract logic cannot be altered, even if it contains illegal terms.
C.Smart contracts automatically update to reflect new laws.
D.Immutability only applies to Bitcoin, not Ethereum.
Correct Answer: Immutability ensures that once deployed, the contract logic cannot be altered, even if it contains illegal terms.
Explanation:This creates a tension with legal systems, as voiding or altering an illegal contract on-chain is technically impossible without pre-programmed upgradeability or a hard fork.
Incorrect! Try again.
38What is Remix in the context of Ethereum development?
A.A new cryptocurrency.
B.A browser-based IDE (Integrated Development Environment) for writing and deploying Solidity.
C.A JavaScript library.
D.A layer-2 scaling solution.
Correct Answer: A browser-based IDE (Integrated Development Environment) for writing and deploying Solidity.
Explanation:Remix is the standard, entry-level web IDE for developing, compiling, and deploying Ethereum smart contracts.
Incorrect! Try again.
39Which Solidity type is essentially a 20-byte value?
A.uint256
B.bool
C.address
D.bytes32
Correct Answer: address
Explanation:An Ethereum address is 20 bytes (160 bits), derived from the public key.
Incorrect! Try again.
40What is the nonce in an Ethereum account used for?
A.Proof of work calculation.
B.To prevent replay attacks and order transactions from the same sender.
C.To store the account balance.
D.To encrypt the private key.
Correct Answer: To prevent replay attacks and order transactions from the same sender.
Explanation:The account nonce is a counter that increments with every transaction sent. It ensures a transaction is processed only once and in the correct order.
Incorrect! Try again.
41If you want to store a string in Solidity that you do not intend to change, which keyword optimizes gas usage?
A.static
B.constant
C.final
D.volatile
Correct Answer: constant
Explanation:State variables declared as constant are not stored in storage slots but are injected into the bytecode, saving gas.
Incorrect! Try again.
42Bitcoin uses a Forth-like reverse polish notation scripting system. What does this mean for loops?
A.It supports infinite loops.
B.It does not support loops (is not Turing complete).
C.It supports 'while' loops but not 'for' loops.
D.It uses recursive loops.
Correct Answer: It does not support loops (is not Turing complete).
Explanation:To prevent infinite execution attacks without a gas system, Bitcoin's scripting language intentionally omits loop opcodes.
Incorrect! Try again.
43How do you access the amount of Ether sent with a transaction inside a Solidity function?
A.msg.gas
B.msg.sender
C.msg.value
D.msg.data
Correct Answer: msg.value
Explanation:msg.value contains the amount of Wei sent with the call.
Incorrect! Try again.
44Which keyword allows a Solidity contract to inherit properties and functions from another contract?
A.extends
B.implements
C.is
D.inherits
Correct Answer: is
Explanation:Solidity uses the is keyword for inheritance. Example: contract Dog is Animal.
Incorrect! Try again.
45In Ethereum, what allows code to perform complex mathematical calculations that Bitcoin script cannot easily do?
A.Larger block size.
B.Turing-complete EVM with a rich instruction set.
C.Faster block times.
D.Proof of Stake.
Correct Answer: Turing-complete EVM with a rich instruction set.
Explanation:The EVM supports a wide range of operations and loops, enabling complex cryptography and logic unavailable in Bitcoin's limited script.
Incorrect! Try again.
46What is the main security risk of using tx.origin for authentication in Solidity?
A.It is always zero.
B.It returns the contract address.
C.It makes the contract vulnerable to phishing (man-in-the-middle) attacks.
D.It costs too much gas.
Correct Answer: It makes the contract vulnerable to phishing (man-in-the-middle) attacks.
Explanation:tx.origin refers to the original sender of the transaction (the EOA), while msg.sender is the immediate caller. Using tx.origin allows a malicious contract to trick a user into authenticating a call they didn't intend.
Incorrect! Try again.
47Which data structure is typically used to create a custom data type with multiple properties in Solidity?
A.enum
B.struct
C.mapping
D.interface
Correct Answer: struct
Explanation:Structs allow you to define new types in the form of a custom structure grouping several variables.
Incorrect! Try again.
48What does the selfdestruct(recipient) function do?
A.It deletes the contract bytecode from the blockchain and sends remaining Ether to the recipient.
B.It pauses the contract.
C.It deletes the recipient's account.
D.It burns the Ether inside the contract.
Correct Answer: It deletes the contract bytecode from the blockchain and sends remaining Ether to the recipient.
Explanation:selfdestruct removes the contract from the state and sends all remaining funds to the specified address.
Incorrect! Try again.
49When interacting with a smart contract via JavaScript, what is the difference between call and send?
A.call is for read-only operations (no gas); send is for state-changing transactions (requires gas).
B.call requires gas; send is free.
C.call is slower than send.
D.There is no difference.
Correct Answer: call is for read-only operations (no gas); send is for state-changing transactions (requires gas).
Explanation:call executes locally on the node to read data and does not broadcast a transaction. send broadcasts a transaction to the network to be mined.
Incorrect! Try again.
50Which standard ensures that different smart contracts (like tokens) can interact with each other predictably?