โ† All CCE Flashcard Decks

Smart Contracts and Ethereum Flashcards

7 cards from real CCE 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 Ethereum flashcards as text
  1. What does the ERC-20 token standard define?

    Answer: A common set of rules for creating interchangeable (fungible) tokens on Ethereum

    ERC-20 is a technical standard that defines a common interface for fungible tokens on Ethereum, enabling any compliant token to be used interchangeably across wallets and exchanges.

  2. What is the key difference between an Externally Owned Account (EOA) and a contract account in Ethereum?

    Answer: EOAs are controlled by a private key; contract accounts are controlled by smart contract code

    EOAs are controlled by private keys held by users and can initiate transactions, while contract accounts are controlled by their deployed smart contract code and can only respond to incoming transactions.

  3. What is a 'reentrancy attack' in the context of smart contracts?

    Answer: An attack where a malicious contract calls back into the victim contract before the first execution completes

    A reentrancy attack occurs when a malicious contract recursively calls back into the vulnerable contract before the first call's state updates are finalized, allowing funds to be withdrawn multiple times.

  4. What does the 'payable' keyword do in a Solidity smart contract?

    Answer: It allows a function or address to receive Ether as part of a transaction

    The 'payable' modifier in Solidity allows a function or address to receive Ether; any Ether sent to a non-payable function will cause the transaction to revert.

  5. What is the primary purpose of events in Ethereum smart contracts?

    Answer: To log information to the blockchain that off-chain applications can listen to and act upon

    Events emit logs stored on the blockchain that are not accessible by other contracts but can be efficiently monitored by off-chain applications such as DApp frontends or indexing services.

  6. What is the ERC-721 standard primarily designed for?

    Answer: Creating non-fungible tokens (NFTs) where each token has a unique identity

    ERC-721 is the standard for non-fungible tokens on Ethereum, where each token has a unique token ID and is not interchangeable with any other token, making it suitable for digital collectibles and art.

  7. What happens when a smart contract transaction runs out of gas during execution?

    Answer: The transaction reverts, all state changes are rolled back, and the gas consumed is not refunded

    When gas runs out, execution halts, all state changes from that transaction are rolled back as if the call never happened, but the gas already consumed is forfeited and not refunded to the sender.