Smart Contracts and dApps Flashcards
7 cards from real CBCP practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.
Read the first 7 Smart Contracts and dApps flashcards as text
What is the 'ABI' (Application Binary Interface) in the context of Ethereum smart contracts?
Answer: A JSON description of a contract's functions and events used to encode/decode interactions
The ABI is a JSON specification that defines how to encode function calls and decode return values when interacting with a deployed smart contract.
In Solidity, what is the difference between 'storage' and 'memory' variable locations?
Answer: Storage is permanent and persists on-chain; memory is temporary and exists only during execution
Storage variables are written to the blockchain and persist between transactions, while memory variables are temporary and discarded after function execution ends.
What distinguishes a 'pure' function from a 'view' function in Solidity?
Answer: Pure functions neither read nor modify state; view functions can read but not modify state
A pure function promises to neither read nor write contract state, while a view function may read state but not modify it.
Which attack vector exploits a smart contract that uses block.timestamp for randomness or time-sensitive logic?
Answer: Timestamp manipulation by miners within a small window
Miners can adjust block.timestamp by a few seconds, making it an unreliable source of randomness or precise time measurement in smart contracts.
What is 'tokenomics' in the context of DApp design?
Answer: The economic model governing a token's supply, distribution, incentives, and utility within an ecosystem
Tokenomics describes the economic design of a token system including total supply, emission schedule, staking rewards, and incentive structures that drive participant behavior.
In a decentralized exchange (DEX) using an Automated Market Maker (AMM), what determines the token swap price?
Answer: A mathematical formula based on the ratio of token reserves in a liquidity pool
AMMs like Uniswap use the constant product formula (x * y = k) where the price is determined by the current ratio of two token reserves in the pool.
What is 'impermanent loss' in DeFi liquidity provision?
Answer: The temporary reduction in value a liquidity provider experiences compared to simply holding tokens when prices diverge
Impermanent loss occurs when the price ratio of tokens in a liquidity pool changes after deposit, making the LP's position less valuable than just holding the tokens outright.