Blockchain and Crypto DeFi & Smart Contracts 2 — Questions and Answers
Question 1: What programming language is primarily used to write Ethereum smart contracts?
- Python
- JavaScript
- Solidity (Correct answer)
- Rust
Correct answer: Solidity
Solidity is the primary programming language used to write smart contracts on the Ethereum blockchain, designed specifically for the EVM.
Question 2: What is the Ethereum Virtual Machine (EVM)?
- A cloud server hosting Ethereum nodes
- The runtime environment that executes smart contract bytecode on Ethereum nodes (Correct answer)
- An Ethereum mining algorithm
- A hardware wallet firmware
Correct answer: The runtime environment that executes smart contract bytecode on Ethereum nodes
The EVM is the runtime environment that executes smart contract bytecode on all Ethereum nodes, ensuring consistent results across the network.
Question 3: What is a reentrancy attack in smart contracts?
- Unauthorized wallet access via phishing
- A vulnerability where a contract is repeatedly called before its initial execution finishes (Correct answer)
- A 51% attack on the blockchain
- Front-running a pending transaction
Correct answer: A vulnerability where a contract is repeatedly called before its initial execution finishes
A reentrancy attack occurs when a malicious contract repeatedly calls back into a vulnerable contract before execution completes, allowing funds to be drained.
Question 4: What does 'gas' refer to in Ethereum transactions?
- A type of utility token
- The computational fee required to execute transactions and smart contracts (Correct answer)
- Network bandwidth allocation
- Hashrate contributed by miners
Correct answer: The computational fee required to execute transactions and smart contracts
Gas in Ethereum is the computational fee required to execute transactions or smart contracts, priced in gwei based on network demand.
Question 5: What is a blockchain oracle?
- A prediction market platform
- A service that provides external real-world data to smart contracts (Correct answer)
- A consensus mechanism validator
- A type of multisig wallet
Correct answer: A service that provides external real-world data to smart contracts
A blockchain oracle is a service that provides external, real-world data to smart contracts, bridging the gap between on-chain code and off-chain information.
Question 6: What is the purpose of a smart contract audit?
- To check token price accuracy
- To identify security vulnerabilities and bugs in smart contract code before deployment (Correct answer)
- To verify miner rewards
- To register a contract with regulators
Correct answer: To identify security vulnerabilities and bugs in smart contract code before deployment
A smart contract audit is a thorough security review of contract code conducted by specialists to identify vulnerabilities before the contract is deployed on-chain.
What programming language is primarily used to write Ethereum smart contracts?