Unit 5 - Practice Quiz

CSC203 60 Questions
0 Correct 0 Wrong 60 Left
0/60

1 What is Ethereum primarily known for being?

Ethereum and smart contracts Easy
A. A decentralized platform for running smart contracts
B. A social media network on the blockchain
C. A digital currency for peer-to-peer payments only
D. A centralized database for financial records

2 A 'smart contract' on Ethereum is best described as:

Ethereum and smart contracts Easy
A. A legal document written by lawyers and stored on the blockchain
B. A computer program that automatically executes when certain conditions are met
C. A user's crypto wallet address and private key
D. A physical contract that is scanned and uploaded to a server

3 What is the native cryptocurrency of the Ethereum network used to pay for transactions?

Ethereum and smart contracts Easy
A. Ether (ETH)
B. Bitcoin (BTC)
C. Litecoin (LTC)
D. Ripple (XRP)

4 In the context of Ethereum, what is the primary purpose of 'gas'?

Ethereum and smart contracts Easy
A. A password required to access a smart contract
B. To power the physical computers of miners
C. A unit to measure the computational effort required to execute an operation
D. A type of cryptocurrency token separate from Ether

5 What does it mean for a programming language like Solidity to be 'Turing-complete'?

The Turing completeness of smart contract languages and verification challenges Easy
A. It can only perform a very limited set of operations
B. It was designed by the famous computer scientist Alan Turing
C. It is completely secure and free of bugs by design
D. It can be used to solve any computational problem, given enough resources

6 A major security challenge arising from the Turing completeness of smart contracts is the possibility of:

The Turing completeness of smart contract languages and verification challenges Easy
A. Incompatibility with traditional legal systems
B. Faster than expected transaction speeds
C. Infinite loops that could potentially consume all allocated gas
D. Contracts being too simple to be useful

7 The 'Halting Problem' is a fundamental concept in computer science that proves it's impossible to:

The Turing completeness of smart contract languages and verification challenges Easy
A. Stop a smart contract once it has been deployed
B. Build a computer that never crashes
C. Create a program that can determine if any other program will finish or run forever
D. Verify that a contract has enough gas to run

8 What is the goal of 'formal verification' in smart contract development?

The Turing completeness of smart contract languages and verification challenges Easy
A. To mathematically prove that the contract's code behaves as specified and is free of certain bugs
B. To make the code run faster on the EVM
C. To automatically translate the code into multiple programming languages
D. To get legal approval for the smart contract's deployment

9 What does the principle 'code is law' mean in the context of smart contracts?

Using smart contracts to enforce legal contracts Easy
A. All software code must be reviewed by a lawyer before deployment
B. The execution of a smart contract is determined strictly by its code, without human interpretation
C. Developers can be sued for writing code with bugs
D. Smart contract code is legally binding in all jurisdictions worldwide

10 In the blockchain world, what is an 'oracle'?

Using smart contracts to enforce legal contracts Easy
A. A person who audits smart contract code for security flaws
B. A trusted service that provides external, real-world data to a smart contract
C. The original, genesis block of a blockchain
D. A special type of smart contract that can predict future cryptocurrency prices

11 What is a primary benefit of using a smart contract for an agreement like an escrow?

Using smart contracts to enforce legal contracts Easy
A. It eliminates the need for a trusted third-party intermediary, reducing costs
B. It allows for flexible, subjective interpretation of the agreement terms
C. It requires a team of expensive lawyers to operate
D. It is easy to change the terms of the agreement after deployment

12 What is a major challenge when trying to represent a traditional legal contract as a smart contract?

Using smart contracts to enforce legal contracts Easy
A. Legal language often contains ambiguity and subjectivity, which is hard to translate into deterministic code
B. Smart contract programming languages are not powerful enough
C. Most legal contracts are too short to be coded
D. There is no way to store text in a smart contract

13 A key difference between Bitcoin's scripting language and Ethereum's smart contract languages is that Bitcoin's script is intentionally:

Comparing Bitcoin scripting vs. Ethereum smart contracts Easy
A. Turing-complete
B. Non-Turing-complete
C. Encrypted
D. Object-oriented

14 Which of the following can be easily implemented with an Ethereum smart contract but is very difficult or impossible with Bitcoin's native script?

Comparing Bitcoin scripting vs. Ethereum smart contracts Easy
A. A multi-signature wallet
B. A decentralized autonomous organization (DAO)
C. A time-locked transaction
D. A simple peer-to-peer payment

15 What is the name of the sandboxed runtime environment where smart contracts are executed on the Ethereum network?

Comparing Bitcoin scripting vs. Ethereum smart contracts Easy
A. Bitcoin Core
B. The Ethereum Virtual Machine (EVM)
C. The Java Virtual Machine (JVM)
D. Docker Container

16 Compared to Ethereum's account-based model, Bitcoin's model is based on:

Comparing Bitcoin scripting vs. Ethereum smart contracts Easy
A. User profiles
B. Centralized ledgers
C. Smart contracts
D. Unspent Transaction Outputs (UTXOs)

17 What is the most popular, high-level programming language for writing smart contracts on Ethereum?

Writing smart contracts using Solidity & JavaScript Easy
A. JavaScript
B. Solidity
C. C#
D. Python

18 In a Solidity smart contract, what does the public visibility keyword for a state variable do?

Writing smart contracts using Solidity & JavaScript Easy
A. It ensures only the contract owner can modify the variable
B. It makes the variable a constant that cannot be changed
C. It automatically creates a 'getter' function so its value can be read from outside the contract
D. It encrypts the variable's data on the blockchain

19 Which of the following are popular JavaScript libraries used to interact with the Ethereum blockchain from a web application?

Writing smart contracts using Solidity & JavaScript Easy
A. Ethers.js and Web3.js
B. React and Vue
C. Node.js and Express
D. jQuery and Lodash

20 What is the purpose of the constructor function in a Solidity smart contract?

Writing smart contracts using Solidity & JavaScript Easy
A. It is a function that must be called in every transaction to the contract
B. To destroy the contract and return funds
C. It is a special function that is executed only once when the contract is first deployed
D. To receive payments of Ether from users

21 A smart contract deployed on Ethereum needs to be updated to fix a critical bug. What is the most common and accepted method to achieve this, considering the immutability of the blockchain?

Ethereum and smart contracts Medium
A. Directly edit the code of the deployed contract using a special transaction.
B. Submit a network-wide vote to overwrite the specific block containing the contract.
C. Use the selfdestruct function on the old contract, which automatically transfers its logic to a new address.
D. Deploy a new version of the contract and have users/other contracts migrate to the new address.

22 In Solidity, what is the key difference between functions marked with view and pure?

Writing smart contracts using Solidity & JavaScript Medium
A. pure functions can read from state but not from memory, while view functions can read from both.
B. view functions can read from the blockchain state but not modify it, while pure functions cannot even read from the state.
C. view functions consume gas when called externally, while pure functions do not.
D. view functions are for external calls only, while pure functions can only be called internally.

23 Which of the following functionalities is easily achievable with an Ethereum smart contract but is practically impossible with Bitcoin's native Script language?

Comparing Bitcoin scripting vs. Ethereum smart contracts Medium
A. Creating a decentralized autonomous organization (DAO) where members vote on proposals and funds are managed based on voting outcomes.
B. Executing a transaction that is only valid after a certain block height (timelock).
C. Verifying a cryptographic signature against a public key.
D. Creating a multi-signature wallet that requires 2-of-3 signatures to spend funds.

24 The concept of 'gas' in Ethereum is a direct solution to which problem introduced by Turing-complete smart contract languages?

The Turing completeness of smart contract languages and verification challenges Medium
A. The Byzantine Generals' Problem, by ensuring all nodes agree on the transaction fee.
B. The Halting Problem, by ensuring that any computation, including infinite loops, will eventually stop due to depleted resources.
C. The problem of data privacy, by making expensive computations publicly visible.
D. The challenge of formal verification, by simplifying the contract's bytecode.

25 What is the primary role of an 'oracle' when using a smart contract to execute the terms of a real-world agreement, such as a crop insurance policy?

Using smart contracts to enforce legal contracts Medium
A. To translate the legal prose of the contract into Solidity code.
B. To act as a legal arbitrator in case of a dispute between the parties.
C. To formally verify the smart contract code for bugs before deployment.
D. To provide reliable, off-chain data (e.g., weather reports) to the smart contract, triggering its execution.

26 A developer wants to notify a JavaScript frontend every time a new item is created in their smart contract. What is the most gas-efficient and standard way to achieve this in Solidity?

Writing smart contracts using Solidity & JavaScript Medium
A. Have the Solidity function return a special string value that the JavaScript frontend can parse.
B. Write a new transaction to the blockchain containing the notification message.
C. Store a boolean flag in storage and have the JavaScript app poll this flag continuously.
D. Use the emit keyword to trigger a declared event, which the frontend can listen for.

27 How does the state management in Ethereum's account-based model differ from Bitcoin's UTXO model?

Comparing Bitcoin scripting vs. Ethereum smart contracts Medium
A. Ethereum maintains a global state that maps addresses to account balances and storage, while Bitcoin's state is the set of all unspent transaction outputs (UTXOs).
B. Ethereum uses a 'first-in, first-out' queue for transactions, whereas Bitcoin uses a UTXO-based stack.
C. Bitcoin's UTXO model is stateful, tracking account history, while Ethereum's model is stateless, recalculating balances with each block.
D. Both systems use an identical account-based model, but Ethereum's is written in a more complex language.

28 A common vulnerability in early smart contracts was 're-entrancy'. This type of attack is a direct consequence of which feature of smart contract execution?

The Turing completeness of smart contract languages and verification challenges Medium
A. The use of assembly language within Solidity, which is inherently unsafe.
B. The fixed gas limit for all transactions, which forces developers to write inefficient code.
C. The ability of one contract to call another contract's public functions, combined with the execution order of state updates.
D. The immutability of contract code, which prevents patching the vulnerability.

29 What is the primary function of the Ethereum Virtual Machine (EVM)?

Ethereum and smart contracts Medium
A. To compile Solidity and other high-level languages into machine code for a specific operating system.
B. To provide a sandboxed runtime environment for executing smart contract bytecode in a deterministic way across all nodes.
C. To manage the peer-to-peer network connections between Ethereum nodes.
D. To reach consensus on the order of blocks using a Proof-of-Work algorithm.

30 A key challenge in mapping legal contracts to smart contracts is handling ambiguity. Which of the following legal clauses would be the most difficult to implement directly in a smart contract without an external arbitrator?

Using smart contracts to enforce legal contracts Medium
A. "The escrow shall release funds if signatures from both Party A and Party B are provided."
B. "A penalty of 1 ETH per day shall be applied for each day the payment is late after the due date."
C. "Party A shall pay Party B if the goods are delivered in a 'satisfactory condition'."
D. "Party A shall pay Party B 10 ETH on or before December 31st, 2024."

31 What happens to a transaction if it is submitted with a gas limit that is too low to complete its required computations?

Ethereum and smart contracts Medium
A. The miner who includes the transaction pays the remaining gas cost out of their block reward.
B. The transaction is rejected by the network and never included in a block, and the sender is refunded the gas fee.
C. The transaction executes as many steps as it can, then fails and reverts all state changes, but the gas fee is still consumed by the miner.
D. The transaction is partially executed, and the state changes made before the gas ran out are permanently saved to the blockchain.

32 Consider the following Solidity code snippet: uint256[] public data;. What is a potential risk associated with making an array of dynamic size public?

Writing smart contracts using Solidity & JavaScript Medium
A. Making an array public allows anyone on the network to delete its elements without restriction.
B. Public arrays cannot store more than 256 elements, leading to unexpected data loss.
C. The public visibility keyword is deprecated for arrays and will cause a compilation error.
D. Solidity automatically creates a getter function for it. If the array becomes very large, calling this getter function from an external contract could lead to an out-of-gas error.

33 What is the primary goal of 'formal verification' in the context of smart contract security?

The Turing completeness of smart contract languages and verification challenges Medium
A. To translate the smart contract's bytecode back into a high-level language for manual review.
B. To run the smart contract on a test network with simulated attack scenarios.
C. To automatically generate unit tests that cover every possible execution path of the contract.
D. To mathematically prove that the smart contract's code behaves exactly as intended and adheres to certain properties, eliminating entire classes of bugs.

34 Which statement best describes the difference in how transaction fees are calculated in Bitcoin versus Ethereum?

Comparing Bitcoin scripting vs. Ethereum smart contracts Medium
A. Bitcoin transactions are free, while Ethereum transactions require a fee.
B. Ethereum fees are based on computational complexity (gas), while Bitcoin fees are primarily based on transaction size in bytes.
C. Ethereum fees are paid to a central entity, while Bitcoin fees are paid to miners.
D. Bitcoin fees are a fixed percentage of the transaction amount, while Ethereum fees are dynamic based on network congestion.

35 The principle of 'Code is Law' suggests that the execution of a smart contract is the final and binding outcome. What is a significant practical and philosophical challenge to this principle?

Using smart contracts to enforce legal contracts Medium
A. It is incompatible with most modern programming languages like JavaScript and Python.
B. It does not account for bugs or exploits in the code, which can lead to unintended outcomes that conflict with the original intent of the agreement.
C. It requires all parties to have advanced knowledge of cryptography.
D. It cannot be implemented on public blockchains due to privacy concerns.

36 What is the difference between an Externally Owned Account (EOA) and a Contract Account on Ethereum?

Ethereum and smart contracts Medium
A. Only Contract Accounts can send transactions, which are then signed by EOAs.
B. An EOA has an associated code hash, while a Contract Account does not.
C. A Contract Account can hold more ETH than an EOA.
D. An EOA is controlled by a private key, while a Contract Account is controlled by its own code; only EOAs can initiate transactions.

37 A developer writes a Solidity function: function _doSomething() internal pure returns(uint) { ... }. What are the implications of the internal visibility modifier?

Writing smart contracts using Solidity & JavaScript Medium
A. The function is part of the contract's public ABI and can be called via a transaction, but only if the caller is another contract.
B. The function can only be called by the contract's owner.
C. The function can only be called from within the same contract or by contracts that inherit from it.
D. The function is automatically inlined by the compiler to save gas.

38 Why is Bitcoin's scripting language intentionally designed to be non-Turing-complete?

Comparing Bitcoin scripting vs. Ethereum smart contracts Medium
A. To make the language compatible with financial regulations that prohibit complex derivatives.
B. To enhance security by making transaction outcomes more predictable and preventing complex, potentially harmful programs like infinite loops.
C. To ensure that all Bitcoin scripts could run on low-power hardware like mobile phones.
D. Because the creators lacked the technical ability to create a Turing-complete language at the time.

39 Integer overflow and underflow vulnerabilities were common in early Solidity contracts. This problem arises because...

The Turing completeness of smart contract languages and verification challenges Medium
A. The Turing-complete nature of Solidity allows for recursive functions that can quickly exhaust the integer range.
B. Solidity's compiler automatically converts all integer types to uint8 to save gas, increasing the risk of overflow.
C. The EVM does not support floating-point arithmetic, forcing all calculations to use integers.
D. EVM integers are of a fixed size (e.g., uint256), and operations that exceed the maximum or go below the minimum value wrap around without throwing an error.

40 When a JavaScript DApp uses a library like web3.js to call a view function on a smart contract, how is this operation typically handled by an Ethereum node like Geth or Infura?

Writing smart contracts using Solidity & JavaScript Medium
A. The call is broadcast to the network as a zero-gas transaction for miners to execute and confirm.
B. A read-only block is temporarily created to simulate the function call.
C. The JavaScript library simulates the EVM locally within the browser to get the result without contacting a node.
D. The node executes the function on its local EVM instance using the current blockchain state and returns the result directly, without creating a transaction.

41 A proxy contract at address 0xP uses delegatecall to forward calls to an implementation contract V1. V1 has a single state variable: uint256 public value;. Later, the proxy is upgraded to a new implementation V2, which introduces a new variable at the first storage slot: address public owner;. An administrator calls a function on V2 via the proxy that is meant to set the owner variable. What is the most likely consequence of this operation on the proxy contract's state?

Writing smart contracts using Solidity & JavaScript Hard
A. The value variable in the proxy's storage is overwritten with the new owner's address, likely leading to data corruption.
B. The owner variable is set correctly in the proxy's storage context, and the original value variable is shifted to a new storage slot.
C. A new storage slot is allocated for the owner variable in the proxy, leaving the value variable untouched.
D. The transaction reverts because the storage layouts of the proxy and the V2 implementation are incompatible.

42 Given the Turing completeness of the EVM, the Halting Problem states that it's impossible to create a general algorithm that can determine if any arbitrary smart contract will finish running or loop forever. How does the Ethereum protocol pragmatically address this undecidable problem to prevent network-wide freezes?

The Turing completeness of smart contract languages and verification challenges Hard
A. By using a sandboxed WebAssembly (WASM) environment that can formally prove termination for most contracts.
B. By enforcing a strict wall-clock time limit (e.g., 30 seconds) on transaction execution, after which the node terminates the process.
C. By implementing a 'gas' mechanism, where every computational step has a cost, and execution halts with an exception if the transaction runs out of its prepaid gas.
D. By requiring all smart contracts to be formally verified and certified by a trusted committee before they can be deployed to the mainnet.

43 A key architectural difference between Bitcoin and Ethereum is their state model. Bitcoin uses the UTXO (Unspent Transaction Output) model, while Ethereum uses an account-based model. How does this difference fundamentally impact the ability to create complex, multi-party stateful applications like a decentralized exchange (DEX)?

Comparing Bitcoin scripting vs. Ethereum smart contracts Hard
A. The UTXO model makes it extremely difficult to represent and update shared global state. A DEX requires a common state (liquidity pools, order books) that multiple agents interact with, which is natural in Ethereum's contract accounts but creates massive contention and complexity in the UTXO model.
B. There is no fundamental difference; building a DEX is equally complex on both platforms, but Ethereum has better developer tooling.
C. Bitcoin's UTXO model is better for a DEX because it prevents the double-spending of assets more effectively than Ethereum's account model.
D. Ethereum's account model is less secure for a DEX because a single contract bug can compromise all user funds, whereas in the UTXO model, funds are segregated in individual outputs.

44 A smart contract is designed to automate payments for a supply chain agreement. A clause in the corresponding legal document states that payment is released upon "successful delivery of goods in satisfactory condition." What is the most profound challenge in encoding this clause into the deterministic logic of a smart contract?

Using smart contracts to enforce legal contracts Hard
A. The risk of a 51% attack on the Ethereum network, which could revert the payment transaction after it has been confirmed.
B. The high gas cost associated with storing and verifying delivery confirmation data on the blockchain.
C. The inability of Solidity to handle complex data types required to represent shipping manifests.
D. The 'Oracle Problem,' compounded by the subjectivity of 'satisfactory condition.' The contract cannot intrinsically know about real-world events or interpret ambiguous, subjective criteria, requiring a trusted external data source or a decentralized dispute resolution mechanism.

45 What is the primary function of the CREATE2 opcode (EIP-1014), and which of the following use-cases does it uniquely enable compared to the original CREATE opcode?

Ethereum and smart contracts Hard
A. CREATE2 allows contracts to be deployed by other contracts, a feature not available with CREATE.
B. CREATE2 reduces the gas cost of deployment by pre-calculating the contract address off-chain.
C. CREATE2 allows for the creation of upgradeable contracts by making it easier to change a contract's code after deployment.
D. CREATE2 enables 'counterfactual instantiation,' allowing users to send funds to a pre-determined address before any contract code is actually deployed there, with the guarantee that only specific code can ever exist at that address.

46 In Solidity, the tx.origin global variable provides the address of the Externally Owned Account (EOA) that originally started the transaction chain. Using require(tx.origin == owner) for authorization in a wallet contract is a known anti-pattern. Why is this check a severe security vulnerability?

Writing smart contracts using Solidity & JavaScript Hard
A. It is significantly more gas-expensive than checking msg.sender, leading to potential out-of-gas errors.
B. tx.origin is not guaranteed to be consistent across different Ethereum clients, leading to unpredictable behavior.
C. It makes the wallet vulnerable to a phishing attack where the owner is tricked into calling a malicious intermediary contract, which then calls the wallet. The tx.origin check will pass, granting the malicious contract control.
D. Future EIPs related to account abstraction are expected to deprecate tx.origin, making the contract obsolete.

47 Rice's Theorem, a fundamental result in computability theory, states that any non-trivial semantic property of programs is undecidable. How does this theorem directly apply to the automated security analysis of Ethereum smart contracts?

The Turing completeness of smart contract languages and verification challenges Hard
A. It proves that no Solidity compiler can be completely free of bugs.
B. It mandates that all smart contracts must include a gas limit to ensure termination.
C. It implies that creating a universal tool that can definitively prove the absence or presence of a complex vulnerability (e.g., 'can this contract ever be re-entered?') for any possible smart contract is theoretically impossible.
D. It guarantees that the EVM's state space is infinite, making full formal verification impractical.

48 When Contract A makes an external call to Contract B with a value transfer using address(B).call{value: v}(""), the EVM forwards a limited gas stipend of 2300 gas if a specific gas amount isn't provided. What is the primary security rationale behind this specific, low gas stipend?

Ethereum and smart contracts Hard
A. To provide just enough gas for the recipient to emit a single event log, but not enough to perform a state-changing external call, thus mitigating most common reentrancy attacks.
B. To prevent the recipient contract from consuming all the gas of the parent call, which would cause the entire transaction to revert unnecessarily.
C. To minimize the overall gas cost of simple ether transfers between contracts, making the network more efficient.
D. To create a standardized gas cost for value transfers that simplifies the calculations for gas estimation tools.

49 Bitcoin's OP_CHECKSIG opcode verifies a signature against a public key provided in the script. Ethereum has a similar capability via the ecrecover precompiled contract. What is a critical functional difference that allows ecrecover to enable complex mechanisms like meta-transactions, which are not natively possible with OP_CHECKSIG?

Comparing Bitcoin scripting vs. Ethereum smart contracts Hard
A. ecrecover supports more modern and efficient cryptographic signature schemes than OP_CHECKSIG.
B. ecrecover recovers the signer's public address directly from the signature hash and the message, whereas OP_CHECKSIG only verifies a signature against a known public key.
C. ecrecover is a precompiled contract, making its execution significantly faster and cheaper than the OP_CHECKSIG opcode.
D. OP_CHECKSIG can only verify one signature per script, while ecrecover can be called multiple times within a single transaction to verify many signatures.

50 A Solidity contract uses inline assembly (Yul) to directly manipulate memory. The code is as follows: function assemble() public pure returns (bytes memory) { bytes memory b = new bytes(64); assembly { mstore(add(b, 0x20), 0xFF) mstore(add(b, 0x40), 0xEE) } return b; }. What will be the hex value of the returned byte array?

Writing smart contracts using Solidity & JavaScript Hard
A. The function will revert because memory outside the allocated length is accessed.
B. 0x0000...00FF followed by 31 zero bytes, then 0x0000...00EE followed by 31 zero bytes.
C. 0x0000...00FF0000...00EE (64 bytes long)
D. 0xFF0000...00EE (64 bytes long)

51 What is the defining characteristic of a Ricardian Contract that distinguishes it from a standard Ethereum smart contract coupled with an off-chain legal agreement?

Using smart contracts to enforce legal contracts Hard
A. A Ricardian Contract is a single, integrated object that is both a human-readable legal document and machine-readable code, cryptographically binding the two together, often by hashing the legal text and including it in the code.
B. Ricardian Contracts are mutable and can be amended by a court order, whereas smart contracts are immutable.
C. Ricardian Contracts are written in a legally-enforceable programming language like DAML.
D. Ricardian Contracts can only be executed on permissioned blockchains that have a built-in legal framework and identity layer.

52 A developer writes a function process(uint256[] calldata items) that iterates through the items array to perform a calculation. While this loop is not infinite, it introduces a significant Denial of Service (DoS) vulnerability. Why is this pattern, often called a 'gas griefing' or 'unbounded loop' vulnerability, so dangerous?

The Turing completeness of smart contract languages and verification challenges Hard
A. The calldata keyword makes the array elements immutable, preventing the function from correctly processing them.
B. If the array is too large, it can cause a stack overflow error in the EVM, which is unrecoverable.
C. An attacker can call the function with an extremely large array, causing the transaction to consume the entire block gas limit and fail. If this function is required for other critical contract operations, the attacker can effectively halt the contract.
D. The EVM charges extra gas for processing arrays larger than 1024 elements, making the transaction uneconomical for legitimate users.

53 An EOA submits two transactions. The first has nonce: 42, gasPrice: 20 Gwei. The second, submitted moments later, has nonce: 42, gasPrice: 30 Gwei. Both transactions enter the mempool. Assuming both are valid, what will be the outcome?

Ethereum and smart contracts Hard
A. Both transactions will be mined, leading to a double execution of the intended action.
B. The transaction with the 20 Gwei gas price will be mined because it was submitted first, and the second transaction will be rejected as a duplicate.
C. Miners will prioritize the transaction with the 30 Gwei gas price. Once it is included in a block, the 20 Gwei transaction becomes invalid and is dropped from the mempool by all nodes.
D. Which transaction gets mined is random and depends on which one a miner's node sees first.

54 What is the primary purpose of the EIP-712 standard for typed structured data hashing and signing, and what specific class of vulnerability does it mitigate compared to the older eth_sign method?

Writing smart contracts using Solidity & JavaScript Hard
A. It standardizes a more gas-efficient signature verification algorithm, reducing the on-chain cost of ecrecover.
B. It enables signing transactions with hardware wallets, a feature that was not supported by eth_sign.
C. It prevents signature replay attacks across different blockchains (e.g., Ethereum and Polygon) by mandating the inclusion of the chainId in the signed data.
D. It mitigates phishing and replay attacks across different DApps by creating a domain-separated, human-readable context for the data being signed, ensuring a signature for one application cannot be used in another.

55 Bitcoin Script is a stack-based, non-Turing-complete language. Which of the following features, fundamental to general-purpose programming and present in Solidity, is explicitly forbidden in Bitcoin Script to prevent infinite loops and ensure termination?

Comparing Bitcoin scripting vs. Ethereum smart contracts Hard
A. Access to transaction-specific data like output values or lock times.
B. Conditional flow control using opcodes like OP_IF and OP_ELSE.
C. Arithmetic operations such as OP_ADD and OP_SUB.
D. Backward jumps or loops (e.g., GOTO or for/while constructs).

56 The EVM storage model works with 32-byte slots. Solidity packs multiple variables into a single storage slot if they fit. Consider the contract: contract C { uint128 a; uint128 b; }. A user calls a function that executes a = type(uint128).max; b = 1;. What will be the raw hex value stored in storage slot 0?

Ethereum and smart contracts Hard
A. The operation will fail because two variables cannot be written to the same slot in one transaction.
B. 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00000000000000000000000000000001
C. 0x00000000000000000000000000000001FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
D. 0x0000...01 in slot 0 and 0xFFFF...FF in slot 1.

57 A smart contract for a decentralized autonomous organization (DAO) is designed to be governed by its token holders. A legal challenge arises from a real-world event not anticipated in the code. The principle of "code is law" is invoked by one party, while another seeks external legal recourse. What architectural pattern could have been implemented in the DAO to bridge this gap between rigid code and the need for external, human-centric dispute resolution?

Using smart contracts to enforce legal contracts Hard
A. Integrating with a decentralized court system (e.g., Kleros, Aragon Court) and including a function that allows an EOA controlled by that system's resolution protocol to trigger a specific, pre-defined action (like an emergency pause or the reversal of a specific transaction).
B. Making the entire contract mutable so that a judge can order direct changes to the code.
C. Writing the smart contract in a natural language processing language so it can interpret legal documents directly.
D. A centralized 'admin key' held by a law firm that can override any DAO decision.

58 When interacting with a smart contract from a JavaScript application using a library like ethers.js, a function returns a uint256 value representing an ERC20 token balance with 18 decimals. The value is 100000000000000000000. If a developer attempts to process this value directly as a standard JavaScript Number (e.g., let balance = await contract.balanceOf(address); let newBalance = balance / 2;), what will happen?

Writing smart contracts using Solidity & JavaScript Hard
A. The code will throw a TypeError because the returned value is not a primitive number.
B. The developer will experience a loss of precision. The returned BigNumber object will be coerced into a JavaScript Number, exceeding Number.MAX_SAFE_INTEGER and resulting in an incorrect value for newBalance.
C. ethers.js automatically converts all uint256 values into strings to prevent precision loss, so the division operation will fail.
D. The calculation will work correctly, and newBalance will be 50000000000000000000.

59 An often-cited difference is that Bitcoin is 'stateless' while Ethereum is 'stateful'. What does this mean in the context of how their respective virtual machines operate on data?

Comparing Bitcoin scripting vs. Ethereum smart contracts Hard
A. Ethereum transactions can fail and revert, effectively being stateless, while all valid Bitcoin transactions are final and change the state of the UTXO set.
B. Bitcoin scripts are purely functional: they execute with data from the spending transaction and cannot access or modify any state outside of that transaction. Ethereum contracts can read and write to persistent storage associated with their address.
C. Bitcoin's state is reset after every block, whereas Ethereum's state persists indefinitely.
D. Bitcoin nodes do not store the entire blockchain history, whereas Ethereum nodes do.

60 What is the key difference in gas consumption and execution context between call, delegatecall, and staticcall in the EVM?

Ethereum and smart contracts Hard
A. call preserves msg.sender and storage context, delegatecall changes them, and staticcall is for read-only calls.
B. All three execute in the same context, but staticcall prevents writes, and delegatecall allows for library-like code reuse.
C. delegatecall is the most gas-efficient, followed by staticcall, and then call.
D. call creates a new execution context (storage, msg.sender are new), delegatecall uses the storage and context of the calling contract, and staticcall is a variant of call that forbids any state-modifying operations.