Blockchain Technology Smart Contracts and dApps 3 — Questions and Answers
Question 1: What is a 'proxy contract' pattern used for in Ethereum smart contract development?
- Reducing transaction fees by batching calls
- Enabling upgradeable smart contracts (Correct answer)
- Encrypting on-chain data
- Bridging assets between blockchains
Correct answer: Enabling upgradeable smart contracts
Proxy contracts delegate calls to an implementation contract, allowing the logic to be upgraded by pointing to a new implementation while preserving storage and address.
Question 2: In the context of dApps, what is a 'wallet connect' flow primarily used for?
- Storing private keys inside the dApp frontend
- Allowing users to sign transactions without exposing keys to the dApp (Correct answer)
- Minting NFTs directly from a hardware wallet
- Creating multi-sig approvals for DAO votes
Correct answer: Allowing users to sign transactions without exposing keys to the dApp
WalletConnect establishes a secure channel between a dApp and a mobile or hardware wallet so users can approve transactions without sharing private keys.
Question 3: What does 'gas limit' represent in an Ethereum transaction?
- The maximum ETH price the sender will pay per unit of gas
- The maximum amount of computational work the sender authorizes (Correct answer)
- The total ETH transferred to the recipient
- The block size limit enforced by miners
Correct answer: The maximum amount of computational work the sender authorizes
The gas limit is the maximum units of computation the sender permits for the transaction; unused gas is refunded and exhausted gas causes a revert.
Question 4: Which consensus mechanism does Ethereum use after 'The Merge' in 2022?
- Proof of Work
- Delegated Proof of Stake
- Proof of Stake (Correct answer)
- Proof of Authority
Correct answer: Proof of Stake
After The Merge, Ethereum switched from Proof of Work to Proof of Stake, where validators stake 32 ETH to propose and attest blocks.
Question 5: What is the role of an 'event' in a Solidity smart contract?
- To call external contracts asynchronously
- To log data cheaply that off-chain clients can subscribe to (Correct answer)
- To trigger automatic token mints
- To enforce access control on functions
Correct answer: To log data cheaply that off-chain clients can subscribe to
Events write data to transaction logs, which are cheaper than storage and can be monitored by off-chain applications via Web3 subscriptions.
Question 6: In DeFi, what is an 'AMM' (Automated Market Maker)?
- A centralized order book managed by a smart contract
- A protocol that prices assets using liquidity pool formulas instead of order books (Correct answer)
- A hardware oracle that feeds real-world prices on-chain
- A DAO governance module that manages token supply
Correct answer: A protocol that prices assets using liquidity pool formulas instead of order books
AMMs like Uniswap use mathematical formulas (e.g., x*y=k) with liquidity pools to determine asset prices and enable permissionless token swaps.
Question 7: What distinguishes an ERC-721 token from an ERC-20 token?
- ERC-721 tokens are deflationary; ERC-20 tokens are inflationary
- ERC-721 tokens are non-fungible (unique); ERC-20 tokens are fungible (interchangeable) (Correct answer)
- ERC-721 tokens run on Layer 2; ERC-20 tokens run on Layer 1
- ERC-721 tokens require KYC; ERC-20 tokens do not
Correct answer: ERC-721 tokens are non-fungible (unique); ERC-20 tokens are fungible (interchangeable)
ERC-721 tokens each have a unique token ID representing a distinct asset (NFT), whereas ERC-20 tokens are interchangeable like currency.
What is a 'proxy contract' pattern used for in Ethereum smart contract development?