-
A) Statically typed
-
B) Object-oriented
-
C) Supports inheritance
-
D) Supports inline assembly
Click the reveal the answer
A,B,C,D-
A) A Solidity file with pragma solidity ^0.6.5; can be compiled with compiler version 0.6.6
-
B) A Solidity file with pragma solidity 0.6.5; can only be compiled with compiler version 0.6.5
-
C) A Solidity file with pragma solidity ^0.6.5; can be compiled with compiler version 0.7.0
-
D) A Solidity file with pragma solidity >0.6.5 <0.7.0; can be compiled with compiler version 0.7.0
Click the reveal the answer
A,B-
A) Constant state variables can be initialized within a constructor
-
B) Immutable state variables are allocated a storage slot
-
C) Gas costs for constant and immutable variables is lower
-
D) Only value types can be immutable
Click the reveal the answer
C,D-
A) Can be declared only inside contracts
-
B) Can have named return variables
-
C) Can have unnamed parameters
-
D) Can be recursive
Click the reveal the answer
B,C,D-
A) Goes from private-internal-external-public in decreasing restrictive order (i.e. private being the most restrictive)
-
B) Goes from internal-private-external-public in decreasing restrictive order (i.e. internal being the most restrictive)
-
C) May be omitted to default to internal in the latest 0.8.0+ compiler versions
-
D) None of the above
Click the reveal the answer
A-
A) It should be marked as pure
-
B) It should be marked as view
-
C) It should be marked as payable
-
D) Cannot determine mutability based only on this information
Click the reveal the answer
D-
A) Events are meant for off-chain applications
-
B) Events can be accessed only by the emitting contract
-
C) Indexing event parameters creates searchable topics
-
D) A maximum of three events can have indexed parameters
Click the reveal the answer
A,C-
A) msg.value to payable functions
-
B) selfdestruct destination
-
C) coinbase transaction
-
D) receive() or fallback() functions
Click the reveal the answer
A,B,C,D-
A) Can rely only on 2300 gas in the worst case
-
B) May receive Ether with payable mutability
-
C) Are mandatory for all contracts
-
D) Must have external visibility
Click the reveal the answer
A,B,D-
A) Address
-
B) Enum
-
C) Struct
-
D) Contract
Click the reveal the answer
A,B,D-
A) Bool is false
-
B) Address is 0
-
C) Statically-sized array depends on the underlying type
-
D) Enum is its first member
Click the reveal the answer
A,B,C,D-
A) Can always receive Ether
-
B) Have members for balance, call, code
-
C) Can be converted to uint160 or contract types
-
D) Can be added and subtracted
Click the reveal the answer
B,C-
A) Are used for Ether transfers
-
B) Trigger the receive() or fallback() functions of address
-
C) Always return a value to be checked
-
D) Provide only 2300 gas
Click the reveal the answer
A,B,D-
A) They are used to call contracts
-
B) They only revert without returning success/failure
-
C) Delegatecall retains the msg.sender and msg.value of caller contract
-
D) Staticcall reverts if the called contract reads contract state of caller
Click the reveal the answer
A,C-
A) memory and its persistence/scope will be the function of declaration
-
B) storage and its persistence/scope will be the entire contract
-
C) calldata and it will only be readable
-
D) None of the above
Click the reveal the answer
A,B,C-
A) storage assigned to storage (local variable) makes a copy
-
B) memory assigned to memory makes a copy
-
C) memory assigned to storage creates a reference
-
D) None of the above
Click the reveal the answer
D-
A) if
-
B) else
-
C) elif
-
D) switch
Click the reveal the answer
A,B-
A) tx.gas()
-
B) gasleft()
-
C) msg.gas()
-
D) block.gaslimit()
Click the reveal the answer
B-
A) internal
-
B) pure
-
C) payable
-
D) immutable
Click the reveal the answer
A,B,C-
A) Are never possible because of the language design
-
B) Are possible but prevented by compiler added checks (version dependent)
-
C) Are possible but prevented by correctly using certain safe math libraries
-
D) Are possible without any mitigation whatsoever
Click the reveal the answer
B,C-
A) Can be fixed size or dynamic
-
B) Are zero indexed
-
C) Have push, pop and length members
-
D) None of the above
Click the reveal the answer
A,B,C-
A) Are user-defined type
-
B) Are reference types
-
C) Can contain or be contained in arrays and mappings
-
D) None of the above
Click the reveal the answer
A,B,C-
A) _KeyType can be any value or reference type
-
B) _ValueType can be any value or reference type
-
C) Can only have storage (not memory) as data location
-
D) Can be iterated over natively (i.e. without implementing another data structure)
Click the reveal the answer
B,C-
A) a += 1 makes the value of a = 2
-
B) b = ++a makes the value of b = 1
-
C) a -= 1 makes the value of a = 1
-
D) b = a-- makes the value of b = 1
Click the reveal the answer
A,D-
A) varName becomes 0 if varName is an integer
-
B) varName becomes true if varName is a boolean
-
C) No effect if varName is a mapping
-
D) Resets all struct members to their default values irrespective of their types
Click the reveal the answer
A,C-
A) Implicit conversions are never allowed
-
B) Explicit conversion of uint16 to uint8 removes higher-order bits
-
C) Explicit conversion of uint16 to uint32 adds lower-order padding
-
D) Explicit conversions are checked by compiler for safety
Click the reveal the answer
B-
A) block.number is 1001
-
B) blockhash(1) returns 0
-
C) block.chainID returns 1
-
D) block.timestamp returns the number of seconds since last block
Click the reveal the answer
A,B,CQ28 User from EOA A calls Contract C1 which makes an external call (CALL opcode) to Contract C2. Which of the following is/are true?
-
A) tx.origin in C2 returns A’s address
-
B) msg.sender in C2 returns A’s address
-
C) msg.sender in C1 returns A’s address
-
D) msg.value in C2 returns amount of Wei sent from A
Click the reveal the answer
A,C-
A) require() is meant to be used for input validation
-
B) require() has a mandatory error message string
-
C) assert() is meant to be used to check invariants
-
D) revert() will abort and revert state changes
Click the reveal the answer
A,C,D-
A) Takes a message hash and ECDSA signature values as inputs
-
B) Recovers and returns the public key of the signature
-
C) Is susceptible to malleable signatures
-
D) None of the above
Click the reveal the answer
A,CQ31 When Contract A attempts to make a delegatecall to Contract B but a prior transaction to Contract B has executed a selfdestruct
-
A) The delegatecall reverts
-
B) The delegatecall returns a failure
-
C) The delegatecall returns a success
-
D) This scenario is not practically possible
Click the reveal the answer
C-
A) Destroys the contract whose address is given as argument
-
B) Destroys the contract executing the selfdestruct
-
C) Sends address’s balance to the calling contract
-
D) Sends executing contract’s balance to the address