← All CBCP Flashcard Decks

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
  1. Which vulnerability allows an attacker to repeatedly call a function before the first execution finishes, draining a contract's funds?

    Answer: Reentrancy attack

    Reentrancy attacks exploit the ability to re-enter a function before its state is updated, as famously demonstrated by The DAO hack in 2016.

  2. What Solidity design pattern places the 'check-effects-interactions' principle to prevent reentrancy?

    Answer: Update state variables before external calls

    The checks-effects-interactions pattern requires updating contract state before making any external calls to prevent reentrancy.

  3. In Ethereum, what does the 'fallback' function do when a contract receives Ether with no matching function signature?

    Answer: It executes as the default handler for unmatched calls or plain Ether transfers

    The fallback function is invoked when no other function matches the call data, or when Ether is sent without any call data.

  4. Which ERC standard is commonly used for non-fungible tokens (NFTs) on Ethereum?

    Answer: ERC-721

    ERC-721 defines the standard interface for non-fungible tokens, where each token has a unique identifier and cannot be exchanged 1:1 with another.

  5. What is the primary role of an oracle in a smart contract ecosystem?

    Answer: To provide off-chain real-world data to on-chain smart contracts

    Oracles act as bridges that fetch and verify external data (prices, weather, sports scores) and deliver it to smart contracts that cannot access the internet directly.

  6. What is a 'proxy pattern' in smart contract architecture primarily used for?

    Answer: Enabling upgradeable smart contracts by separating logic from storage

    The proxy pattern separates a contract's storage proxy from its logic implementation, allowing the logic to be upgraded without changing the contract address.

  7. In Solidity, what keyword restricts a function so it cannot modify the contract's state?

    Answer: view

    The 'view' keyword declares that a function reads state variables but does not modify them, which allows it to be called without a transaction.