โ† All Blockchain Technology Flashcard Decks

Smart Contract Fundamentals Flashcards

7 cards from real Blockchain Technology 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 Fundamentals flashcards as text
  1. What is a 'reentrancy attack' in the context of smart contracts?

    Answer: A bug where a contract calls itself recursively to drain funds before state updates

    A reentrancy attack occurs when a malicious contract repeatedly calls back into the victim before the victim updates its balance, allowing repeated withdrawals.

  2. Which Solidity keyword prevents a function from modifying contract state?

    Answer: view

    'view' functions can read state but cannot modify it, while 'pure' functions cannot read or modify state at all.

  3. What does the ERC-20 standard primarily define?

    Answer: A common interface for fungible tokens on Ethereum

    ERC-20 defines a standard interface (functions like transfer, approve, allowance) for fungible tokens so wallets and exchanges can interact with any compliant token uniformly.

  4. In Ethereum's ABI (Application Binary Interface), what is its primary purpose?

    Answer: To define how to encode and decode function calls and return values

    The ABI specifies the encoding scheme for calling contract functions and interpreting their return data so external applications can interact correctly.

  5. What is the purpose of the 'fallback' function in a Solidity smart contract?

    Answer: It is called when no other function matches the incoming call data

    The fallback function executes when a call arrives that doesn't match any function selector, or when ETH is sent without call data and no receive() exists.

  6. Which of the following best describes 'gas limit' in an Ethereum transaction?

    Answer: The maximum amount of computational work the sender authorizes for the transaction

    The gas limit is the maximum number of gas units the sender is willing to consume; unused gas is refunded, but the transaction fails if it exceeds the limit.

  7. What does the Solidity 'require' statement do when its condition evaluates to false?

    Answer: It reverts the transaction and refunds remaining gas

    'require' reverts all state changes and returns remaining gas to the caller when the condition fails, making it ideal for input validation.