Blockchain Technology Smart Contracts and dApps 5 — Questions and Answers
Question 1: What is the primary purpose of a DAO (Decentralized Autonomous Organization) smart contract?
- To automate tax reporting for token holders
- To encode governance rules so token holders can vote on proposals without central control (Correct answer)
- To create deflationary tokenomics via automatic burns
- To bridge assets between Ethereum and other blockchains
Correct answer: To encode governance rules so token holders can vote on proposals without central control
DAO contracts implement on-chain governance where token holders submit and vote on proposals, with approved actions executed automatically by the contract.
Question 2: In Solidity, what is the difference between 'storage' and 'memory' variable locations?
- Storage is temporary per call; memory persists across transactions
- Storage persists on-chain between calls; memory is temporary within a single call (Correct answer)
- Storage is for mappings only; memory is for arrays only
- Storage is cheaper to read; memory is cheaper to write
Correct answer: Storage persists on-chain between calls; memory is temporary within a single call
Storage variables are permanently written to the blockchain state, while memory variables exist only during a function execution and are discarded afterward.
Question 3: What does EIP-1559 change about Ethereum transaction fees?
- It introduces a base fee that is burned and a priority tip paid to validators (Correct answer)
- It eliminates gas fees entirely for ERC-20 transfers
- It caps maximum gas per block at a fixed limit of 15M
- It requires all transactions to use zero-knowledge proofs
Correct answer: It introduces a base fee that is burned and a priority tip paid to validators
EIP-1559 replaced the first-price auction with a protocol-set base fee (burned) plus an optional priority tip, making fees more predictable.
Question 4: What is 'contract self-destruct' (selfdestruct) and why is it considered dangerous?
- A pattern to pause a contract; dangerous because it freezes user funds
- A function to delete contract code and send ETH to a target; dangerous because it can break dependent contracts (Correct answer)
- A method to upgrade contract logic; dangerous because it bypasses audits
- A way to burn tokens; dangerous because it is irreversible
Correct answer: A function to delete contract code and send ETH to a target; dangerous because it can break dependent contracts
selfdestruct removes contract bytecode from state and forces ETH to a recipient, which can break contracts expecting to interact with the now-deleted address.
Question 5: Which concept describes bundling multiple smart contract interactions into one atomic transaction?
- Multi-sig approval
- Multicall (Correct answer)
- Batch minting
- Delegate call
Correct answer: Multicall
Multicall allows a single transaction to execute multiple contract calls atomically, saving gas and ensuring all-or-nothing execution.
Question 6: What security risk does 'tx.origin' authentication introduce in Solidity?
- It exposes the contract deployer's address to the public
- It enables phishing attacks where a malicious contract tricks the original signer into authorizing actions (Correct answer)
- It prevents multi-sig wallets from interacting with the contract
- It causes gas estimation to fail for complex transactions
Correct answer: It enables phishing attacks where a malicious contract tricks the original signer into authorizing actions
tx.origin returns the original external account that initiated the call chain, so a malicious intermediary contract can impersonate a trusted user; msg.sender should be used instead.
Question 7: What is 'impermanent loss' in the context of providing liquidity to an AMM?
- Tokens permanently destroyed when a liquidity pool is drained by a hack
- The temporary loss in dollar value compared to holding assets, caused by price divergence in the pool (Correct answer)
- Gas fees lost during failed liquidity addition transactions
- Slippage incurred when withdrawing liquidity during high volatility
Correct answer: The temporary loss in dollar value compared to holding assets, caused by price divergence in the pool
Impermanent loss occurs when the price ratio of pooled assets changes from deposit time; the LP would have been better off simply holding the assets instead.
What is the primary purpose of a DAO (Decentralized Autonomous Organization) smart contract?