- A) Abstract contracts have at least one function undefined
- B) Interfaces can have some functions defined
- C) Unimplemented functions in abstract contracts need to be declared virtual
- D) All functions are implicitly virtual in interfaces
Click the reveal the answer
A,C,D or C,DNote: While the initial platform-specified correct answer for Q1 was A,C,D, it was determined that this Q&A had some latent ambiguity with answer choice A. Therefore, all answer combinations indicated above were considered as valid and scores adjusted accordingly.
- A) That cannot have state variables
- B) That cannot be inherited
- C) That always require a delegatecall
- D) That are not meant to receive Ether
Click the reveal the answer
A,B,D- A) Refers to the layout of state variables in storage
- B) Is organized in 256-byte slots
- C) Is packed for value types that use less than 32 bytes
- D) Always starts on a new slot for reference types
Click the reveal the answer
A,C,D- A) 4
- B) 3
- C) 2
- D) 1
Click the reveal the answer
C- A) The number of slots used for a contract depends on the ordering of state variable declarations
- B) The slots for struct elements are consecutive
- C) The slot s for dynamic array contains the length with individual elements stored consecutively in slots starting at keccak256(s)
- D) The slot s for mapping is empty with individual values stored consecutively in slots starting at keccak(h(k).s), where k is the first key and h is a hash function that depends on type of k
Click the reveal the answer
A,B,C- A) Is linear and byte-addressable
- B) Is reserved by Solidity until 0x7f
- C) Can be accessed in bytes using MLOAD8/MSTORE8
- D) Is non-volatile or persistent
Click the reveal the answer
A,B- A) Its own language called Yul
- B) Safety checks just like Solidity
- C) Access to all variables in the contract and function where present
- D) References to variables as their addresses not values
Click the reveal the answer
A,C,D- A) The use of zero address for transfers will trigger an EVM exception
- B) Ether/tokens sent to zero address will be inaccessible
- C) Ether/tokens sent to zero address can be accessed by anyone
- D) Address 0 is the Ethereum Masternode account and is forbidden for access
Click the reveal the answer
BQ9 ERC20 transferFrom(address sender, address recipient, uint256 amount) (that follows the ERC20 spec strictly)
- A) Transfers token amount from sender to recipient
- B) sender must have given caller (msg.sender) approval for at least amount or more
- C) Deducts amount from sender’s allowance
- D) Deducts amount from caller’s (msg.sender’s) allowance
Click the reveal the answer
A,B,D- A) It adds integer overflow/underflow checks
- B) It adds return value/data checks
- C) It adds pause/unpause capability
- D) It adds race-condition checks
Click the reveal the answer
B- A) Adds ability to pause token transfers
- B) Adds ability to pause token minting and burning
- C) Provides modifiers whenPaused and whenNotPaused
- D) None of the above
Click the reveal the answer
A,B- A) Implements the NFT standard
- B) safeTransferFrom(..) checks for zero-addresses
- C) approve(..) is susceptible to race-condition just like ERC20
- D) setApprovalForAll(address operator, bool _approved) approves/removes operator for all of caller’s tokens
Click the reveal the answer
A,B,D- A) Hooks allow reacting to token mint/burn/transfer
- B) It can help avoid separate approve and transferFrom transactions
- C) It can help prevent tokens getting stuck in contracts
- D) It removes reentrancy risk
Click the reveal the answer
A,B,C- A) Is Ownable
- B) Provides role based access control
- C) Provides a function to renounce ownership
- D) None of the above
Click the reveal the answer
A,C- A) Provides support only for two specific roles: Owner and User
- B) Provides support for different roles with different authorization levels
- C) Provides support for granting and revoking roles
- D) None the above
Click the reveal the answer
B,C- A) Address is guaranteed to not be a contract
- B) Codesize at address is 0 at time of invocation
- C) Both A & B
- D) Neither A nor B
Click the reveal the answer
B- A) Deploys two contracts proxy and implementation concurrently
- B) Deploys contract at an address that can be predetermined
- C) Uses a salt and contract creationCode
- D) None of the above
Click the reveal the answer
B,C- A) Implements functions for signature creation & verification
- B) Is susceptible to signature malleability
- C) Both A & B
- D) Neither A nor B
Click the reveal the answer
D- A) Prevents integer overflows/underflows at compile-time
- B) Is not required if using Solidity compiler version >= 0.8.0
- C) Both A & B
- D) Neither A nor B
Click the reveal the answer
B- A) Typically have a proxy contract and an implementation contract
- B) Use delegatecall's from proxy to implementation
- C) Cannot support upgradeable proxies
- D) None of the above
Click the reveal the answer
A,B- A) Should use constructors in implementation contract to initialize the proxy’s state variables
- B) Should use an external/public initialize() function
- C) Should have their initialize() function called only once
- D) All of the above
Click the reveal the answer
B,C- A) A proxy implementation
- B) A floating-point implementation with wad & ray
- C) A flexible authorization implementation
- D) All of the above
Click the reveal the answer
A,C- A) An ERC20 pre-compile for Wrapped Ether built into Ethereum protocol
- B) Warp Ether for super-fast Ether transfers
- C) Wrapped Ether to convert Ether into an ERC721 NFT
- D) None of the above
Click the reveal the answer
DQ24 Name collision error with inheritance happens when the following pairs have the same name within a contract
- A) Function & modifier
- B) Function & event
- C) Function & function
- D) Event & modifier
Click the reveal the answer
A,B,D- A) Function overriding
- B) Function overloading
- C) Modifier overloading
- D) Modifier overriding
Click the reveal the answer
C- A) Multiple inheritance
- B) Polymorphism
- C) Contract overloading
- D) Function overloading
Click the reveal the answer
A,B,D- A) SLOAD
- B) MSTORE8
- C) SSTORE
- D) SWAP
Click the reveal the answer
B,D- A) ABI coder v2 is made the default
- B) No opt-out primitives for default checked arithmetic
- C) Failing assert returns the gas left instead of consuming all gas
- D) Exponentiation is made right associative
Click the reveal the answer
A,C,D- A) Prevents underflows while downcasting
- B) Prevents overflows while downcasting
- C) Prevents underflows while upcasting
- D) Prevents overflows while upcasting
Click the reveal the answer
B- A) For all its functions by simply deriving/inheriting from it
- B) Only for functions that apply the nonReentrant modifier
- C) By enforcing a checks-effects-interactions pattern in its functions
- D) None of the above
Click the reveal the answer
BQ31 Assuming all contracts C1, C2 and C3 define explicit constructors in contract C1 is C2, C3 {…} and both C2 and C3 don’t inherit contracts, the number & order of constructor(s) executed is/are
- A) One, that of C1
- B) Three, in the order C2, C3, C1
- C) One, that of C3
- D) Three, in the order C1, C2, C3
Click the reveal the answer
B- A) Function f cannot have another modifier because every function can have at most one modifier
- B) Function f's code is inlined at the point of _ within modifier m
- C) Function f reverts if _ is not executed in the modifier m
- D) None of the above