← All CBSA Flashcard Decks

Smart Contract Design Flashcards

7 cards from real CBSA 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 Contract Design flashcards as text
  1. Which design pattern separates a smart contract's logic from its data storage to enable upgradability?

    Answer: Proxy pattern

    The proxy pattern delegates calls to a logic contract while keeping state in a separate storage contract, allowing logic upgrades without migrating data.

  2. What is a primary security risk of using 'tx.origin' for authorization in a Solidity smart contract?

    Answer: It exposes the contract to phishing attacks via malicious intermediary contracts

    A malicious contract can trick the original sender into calling it, and tx.origin still returns that user's address, bypassing intended authorization checks.

  3. In smart contract design, what does the 'check-effects-interactions' pattern primarily prevent?

    Answer: Reentrancy attacks

    By updating internal state (effects) before calling external contracts (interactions), the pattern prevents reentrant calls from exploiting stale state.

  4. Which Ethereum opcode is used internally when a contract sends Ether using the 'transfer' function, and what is its gas stipend?

    Answer: CALL with 2300 gas

    The 'transfer' function uses the CALL opcode but forwards only 2300 gas, which is enough for a log event but prevents most reentrancy.

  5. What is the purpose of the 'circuit breaker' (emergency stop) pattern in smart contract design?

    Answer: To pause contract functionality when a vulnerability is detected

    A circuit breaker allows an authorized admin to halt critical functions so funds can be protected while a vulnerability is investigated and fixed.

  6. When designing a smart contract that accepts ERC-20 token payments, why must you call 'approve' before 'transferFrom'?

    Answer: Because transferFrom requires prior owner authorization via the allowance mechanism

    The ERC-20 allowance mechanism requires the token owner to first approve a spender's address for a specific amount before transferFrom can pull those tokens.

  7. What is 'storage collision' in the context of upgradeable smart contracts using the proxy pattern?

    Answer: When a proxy and its logic contract use the same storage slot for different variables

    If a proxy contract's admin variable occupies the same storage slot as a variable in the logic contract, one will overwrite the other causing data corruption.

How this page was made: written with AI tools. Exam facts are checked against the official sources listed below. Not reviewed by a subject-matter expert. Editorial policy

Sources & references

Exam facts on this page (fees, format, dates, passing scores) are checked against these official sources; the date is our last check. Editorial policy

  1. blockchaintrainingalliance.com — Test delivery, renewal, retake policy, score validity, passing score, test dates · verified Oct 2026