Smart Contracts and dApps Flashcards
6 cards from real Cryptocurrency practice questions. Tap to flip, then mark Knew It or Still Learning โ missed cards come back until you master them.
Read the first 6 Smart Contracts and dApps flashcards as text
A decentralized application (dApp) for agricultural insurance is designed to automatically pay out claims to farmers if a drought is officially declared in their region. The smart contract needs access to reliable, real-world weather data to trigger these payments. What component is essential for the smart contract to securely receive this external information?
Answer: A decentralized oracle network to feed external data to the blockchain.
Blockchains and the smart contracts that run on them are deterministic and cannot directly access data from outside their network (off-chain data). A decentralized oracle network serves as a secure bridge, retrieving external data, verifying its accuracy through consensus, and delivering it to the smart contract.
What is the primary function of 'gas' in the context of the Ethereum network?
Answer: To measure the computational effort required to execute operations and to compensate validators.
Gas is the unit used to measure the amount of computational work required to perform an operation, such as executing a transaction or a smart contract. Users pay a 'gas fee' in the network's native currency (ETH) to compensate validators for the computational resources they expend. This mechanism also prevents network spam and incentivizes efficient code.
A developer is creating a platform for digital art, where each piece is unique and can be individually owned and traded. Which Ethereum token standard is most appropriate for representing these one-of-a-kind digital assets?
Answer: ERC-721
The ERC-721 standard is specifically designed for non-fungible tokens (NFTs). Each ERC-721 token is unique and represents a specific, non-interchangeable asset, making it the ideal standard for digital collectibles, art, and real estate. In contrast, ERC-20 is for fungible tokens where each token is identical to another.
Which of the following is a key characteristic that distinguishes a decentralized application (dApp) from a traditional, centralized web application?
Answer: The backend logic of a dApp is executed via smart contracts on a peer-to-peer network.
Unlike traditional applications that run on centralized servers owned by a single entity, dApps operate on a blockchain or peer-to-peer network. Their backend logic is governed by smart contracts, which are self-executing pieces of code that run on this decentralized network, ensuring transparency and resistance to censorship.
A new online collective wants to manage a shared treasury and make decisions about funding projects based on member votes. They want the rules for governance and fund allocation to be transparent and automatically enforced by code. Which type of organization would best suit their needs?
Answer: A Decentralized Autonomous Organization (DAO).
A Decentralized Autonomous Organization (DAO) is an entity governed by smart contracts that run on a blockchain. Its rules are encoded in the contract, and decisions are made collectively by its members, often through voting with governance tokens. This structure provides transparency and automated enforcement without a central authority, perfectly matching the collective's requirements.
A user sends a transaction to interact with a complex DeFi smart contract on Ethereum. They set a 'gas limit' that is too low for the required computations. What is the most likely outcome?
Answer: The transaction will fail, any state changes will be reverted, and the entire gas fee will be consumed.
If a transaction runs out of gas before it completes, it will fail. The Ethereum Virtual Machine (EVM) will revert any changes made to the blockchain state during the attempted execution. However, the user will not be refunded the gas fee, as it has already been consumed to pay the validator for the computational work performed up to the point of failure.