




























































































Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





























































































Question 1. What is the primary benefit of decentralization in a blockchain network? A) Faster transaction processing B) Central authority control C) Increased trust through distributed consensus D) Reduced storage requirements Answer: C Explanation: Decentralization removes the need for a central authority by distributing ledger copies among many nodes, enhancing trust and resilience.
Question 2. Which cryptographic primitive ensures that a transaction’s data cannot be altered without detection? A) Symmetric encryption B) Hash function C) Digital signature D) Public key Answer: B Explanation: A hash function produces a fixed‑size digest; any change to the input data results in a different hash, enabling integrity verification.
Question 3. In Proof‑of‑Work (PoW) consensus, what does the term “nonce” refer to? A) The public key of the miner B) A random number miners adjust to find a valid block hash C) The total supply of a token D) The gas limit of a transaction Answer: B Explanation: Miners repeatedly change the nonce to produce a block hash that meets the network’s difficulty target.
Question 4. Which of the following best describes the role of the Ethereum Virtual Machine (EVM)? A) Stores all off‑chain data for NFTs B) Executes smart contract bytecode in a sandboxed environment C) Generates cryptographic keys for users D) Provides a graphical user interface for developers
B) Unique identifier per token C) Compatibility with ERC‑721 standard D) Storage on IPFS Answer: B Explanation: Non‑fungible tokens have unique IDs, making each token distinct; fungible tokens are interchangeable.
Question 7. Which ERC‑20 function returns the total number of tokens in existence? A) balanceOf() B) totalSupply() C) allowance() D) name() Answer: B Explanation: totalSupply() reports the aggregate token count for the ERC‑ 20 contract.
Question 8. What is an Ethereum Improvement Proposal (EIP)? A) A smart contract library for NFTs B) A formal document describing a new standard or change to Ethereum C) A token that improves gas efficiency D) A wallet encryption method Answer: B Explanation: EIPs outline specifications, standards, or improvements and undergo community review before adoption.
Question 9. Which ERC‑721 mandatory function retrieves the owner of a specific token ID? A) balanceOf() B) ownerOf() C) getApproved() D) safeTransferFrom() Answer: B
D) setApprovalForAll() Answer: B Explanation: safeBatchTransferFrom() moves several token IDs and amounts atomically, saving gas compared to multiple ERC‑721 transfers.
Question 12. How does ERC‑1155 support both fungible and non‑fungible tokens within the same contract? A) By using separate contracts for each type B) By assigning a unique ID for each token; IDs with a supply of 1 are non‑fungible, higher supplies are fungible C) By requiring a different ABI for each token type D) By storing metadata off‑chain only Answer: B Explanation: ERC‑1155 treats each ID as a token type; a supply of one makes it non‑fungible, while larger supplies denote fungibility.
Question 13. Which Solidity data type is used to map an address to a uint balance? A) address[] B) mapping(address => uint256) C) uint256[address] D) struct Balance { address owner; uint256 amount; } Answer: B Explanation: mapping(address => uint256) creates a key‑value store linking addresses to numeric balances.
Question 14. What does the Solidity keyword “modifier” allow a developer to do? A) Define a new data type B) Reuse common validation logic before or after a function executes C) Emit an event automatically D) Deploy a contract with a lower gas cost Answer: B Explanation: Modifiers wrap functions with pre‑ or post‑execution checks, such as access control or reentrancy guards.
Answer: B Explanation: ERC721URIStorage adds a private mapping for tokenURIs, allowing per‑token metadata while preserving base functionality.
Question 17. What is the primary purpose of the “Ownable” contract in OpenZeppelin libraries? A) To enable token burning B) To enforce a single admin address that can execute privileged functions C) To provide royalty calculations D) To manage token supply Answer: B Explanation: Ownable defines an owner state variable and onlyOwner modifier, restricting sensitive functions to the contract deployer or a transferred owner.
Question 18. Which Solidity function is used to pause all token transfers in a contract that inherits from Pausable? A) stop()
B) pause() C) freeze() D) halt() Answer: B Explanation: pause() toggles the paused state; functions with whenNotPaused modifier reject calls while paused.
Question 19. What does ERC‑2981 standardize for NFTs? A) Token enumeration order B) Royalty payment information for secondary sales C) Batch minting limits D) On‑chain metadata format Answer: B Explanation: ERC‑2981 defines a royaltyInfo() function that returns the recipient and royalty amount, enabling marketplaces to honor creator fees.
Question 22. When writing unit tests for a Solidity contract with Hardhat, which JavaScript assertion library is commonly used? A) Jest B) Chai C) Mocha D) Jasmine Answer: B Explanation: Chai provides expressive assertions (e.g., expect, assert) that integrate with Hardhat’s Mocha test runner.
Question 23. What is the purpose of a “provider” in ethers.js? A) To sign transactions on behalf of a user B) To supply read‑only access to the blockchain (e.g., query state) C) To store private keys locally D) To manage NFT metadata uploads
Answer: B Explanation: A provider connects to an Ethereum node and enables read‑only operations like calling view functions or fetching block data.
Question 24. Which method in ethers.js is used to send a transaction that changes contract state? A) callStatic() B) estimateGas() C) sendTransaction() D) populateTransaction() Answer: C Explanation: sendTransaction() creates, signs, and broadcasts a state‑changing transaction to the network.
Question 25. What is the role of an ABI (Application Binary Interface) when interacting with a smart contract from a dApp? A) It stores the contract’s source code on‑chain
Question 27. When storing NFT metadata off‑chain, which JSON field typically holds the link to the asset image? A) “uri” B) “image” C) “src” D) “media” Answer: B Explanation: The “image” field contains a URL or IPFS URI pointing to the visual representation of the NFT.
Question 28. What advantage does Arweave offer over IPFS for NFT storage? A) Faster retrieval speeds on Ethereum mainnet B) Permanent, pay‑once storage with built‑in data permanence guarantees C) Automatic token minting upon upload D) Native support for ERC‑1155 token standards Answer: B
Explanation: Arweave’s “permaweb” model stores data forever after a one‑time payment, eliminating the need for continuous pinning.
Question 29. Which wallet is primarily a browser extension that injects a Web provider into dApps? A) Ledger B Trezor C) MetaMask D) MyEtherWallet Answer: C Explanation: MetaMask acts as a browser extension, exposing an Ethereum provider (window.ethereum) for dApps to interact with.
Question 30. What does a “seed phrase” enable a user to do? A) Increase gas limit for transactions B) Recover the private keys associated with a wallet C) Mint NFTs without paying gas
A) Higher transaction finality time B) Lower gas fees and faster confirmations compared to Ethereum mainnet C) Exclusive support for ERC‑20 tokens only D) Mandatory use of Solidity 0.5.x Answer: B Explanation: Polygon offers reduced transaction costs and faster block times, making it attractive for high‑volume NFT minting.
Question 33. In a dApp, which event listener would you typically subscribe to in order to update the UI after an NFT transfer? A) ApprovalForAll B) Transfer C) Minted D) Paused Answer: B Explanation: The Transfer event fires whenever an NFT changes ownership, allowing the frontend to reflect the new holder instantly.
Question 34. Which of the following best describes a “gas‑optimized” Solidity pattern? A) Using a for‑loop with unbounded iterations B) Packing multiple variables into a single storage slot (e.g., using uint128 + uint128) C) Storing large arrays in contract storage D) Reverting after performing external calls Answer: B Explanation: Packing variables reduces storage reads/writes, which are the most expensive operations in terms of gas.
Question 35. What is the purpose of a “whitelist” in many NFT minting contracts? A) To list all token IDs that have been minted B) To restrict minting to pre‑approved addresses during a private sale phase C) To store metadata URIs on‑chain D) To automatically approve marketplaces for token transfers