Cryptocurrency Smart Contracts and Token Standards 1 — Questions and Answers
Question 1: What is a smart contract?
- A legal agreement stored on paper and notarized
- A self-executing program stored on a blockchain that runs when conditions are met (Correct answer)
- An AI-powered trading algorithm
- A digital signature used to authenticate transactions
Correct answer: A self-executing program stored on a blockchain that runs when conditions are met
A smart contract is a self-executing program on a blockchain that automatically enforces and executes terms when predefined conditions are fulfilled.
Question 2: Which programming language is most widely used to write Ethereum smart contracts?
- Python
- JavaScript
- Solidity (Correct answer)
- Rust
Correct answer: Solidity
Solidity is Ethereum's primary programming language for writing smart contracts, with syntax influenced by JavaScript and C++.
Question 3: What is the Ethereum Virtual Machine (EVM)?
- A virtual reality interface for Ethereum users
- The decentralized computation engine that executes smart contracts on Ethereum (Correct answer)
- A software wallet for storing Ethereum
- A mining pool coordination system
Correct answer: The decentralized computation engine that executes smart contracts on Ethereum
The EVM is the runtime environment that executes smart contract bytecode across all Ethereum nodes in a deterministic way.
Question 4: What is 'gas' in the context of Ethereum smart contracts?
- A token used exclusively for staking rewards
- A unit measuring computational effort required to execute operations on Ethereum (Correct answer)
- The name for Ethereum's native currency
- A fee charged by validators for confirming transactions
Correct answer: A unit measuring computational effort required to execute operations on Ethereum
Gas measures the computational work needed to execute operations on Ethereum, preventing spam and incentivizing validators.
Question 5: What is a reentrancy attack in smart contracts?
- A phishing attack targeting smart contract developers
- An exploit where a malicious contract repeatedly calls a vulnerable contract before the first call completes (Correct answer)
- An attack that front-runs transactions to steal gas fees
- A bug that allows unauthorized minting of tokens
Correct answer: An exploit where a malicious contract repeatedly calls a vulnerable contract before the first call completes
A reentrancy attack exploits a vulnerability where a contract calls an external contract before updating its own state, enabling recursive fund draining.
Question 6: What does it mean for a smart contract to be 'immutable'?
- The contract can be upgraded by the owner at any time
- Once deployed, the contract code cannot be changed on the blockchain (Correct answer)
- The contract locks funds indefinitely
- The contract cannot be interacted with by external users
Correct answer: Once deployed, the contract code cannot be changed on the blockchain
Smart contract immutability means that once deployed to the blockchain, the code cannot be altered, ensuring trustless and predictable execution.
What is a smart contract?