ExamGecko
Home Home / Blockchain / CBDE

Blockchain CBDE Practice Test - Questions Answers, Page 8

Question list
Search
Search

If contract MyContractA is derived from Contract MyContractB, then this would be the right syntax:

A.
contract MyContractA is MyContractB { … }
A.
contract MyContractA is MyContractB { … }
Answers
B.
contract MyContractA inherit (MyContractB) {…}
B.
contract MyContractA inherit (MyContractB) {…}
Answers
C.
contract MyContractA extends MyContractB {…}
C.
contract MyContractA extends MyContractB {…}
Answers
D.
contract MyContractB derives MyContractA {…}
D.
contract MyContractB derives MyContractA {…}
Answers
Suggested answer: A

Inheritance is useful, because a contract that is derived from another contract can make use of:

A.
all public state variables and properties, public and internal functions and modifiers.
A.
all public state variables and properties, public and internal functions and modifiers.
Answers
B.
all public and private state variables, public, internal and external functions, but not modifiers
B.
all public and private state variables, public, internal and external functions, but not modifiers
Answers
C.
all public state variables and properties, public functions and modifiers, but not internal, external or private ones.
C.
all public state variables and properties, public functions and modifiers, but not internal, external or private ones.
Answers
Suggested answer: A

Finish the sentence: The

Library Web3.js is …:

A.
useful when developing distributed applications with HTML and JavaScript, because it already implements the abstraction of the JSON-RPC interface of Ethereum Nodes.
A.
useful when developing distributed applications with HTML and JavaScript, because it already implements the abstraction of the JSON-RPC interface of Ethereum Nodes.
Answers
B.
necessary when developing distributed applications with HTML and JavaScript, because the proprietary JSON-RPC interface of Ethereum Nodes is a closed source.
B.
necessary when developing distributed applications with HTML and JavaScript, because the proprietary JSON-RPC interface of Ethereum Nodes is a closed source.
Answers
Suggested answer: A

When solidity is compiled then also Metadata is generated:

A.
the Metadata contains the ABI Array, which defines the Interface to interact with the Smart Contract. Metadata can also contain the address of the smart contract when it gets deployed.
A.
the Metadata contains the ABI Array, which defines the Interface to interact with the Smart Contract. Metadata can also contain the address of the smart contract when it gets deployed.
Answers
B.
metadata contains the address, and the size of the smart contract. The ABI Array is generated externally upon deploying the smart contract.
B.
metadata contains the address, and the size of the smart contract. The ABI Array is generated externally upon deploying the smart contract.
Answers
C.
the ABI array and the Metadata are not generated when solidity is compiled to bytecode, its generated by a migration software which deploys the smart contract on the blockchain.
C.
the ABI array and the Metadata are not generated when solidity is compiled to bytecode, its generated by a migration software which deploys the smart contract on the blockchain.
Answers
Suggested answer: A

The difference between address.send() and address.transfer() is:

A.
.send returns a Boolean and .transfer throws an exception on error. Both just forward the gasstipend of 2300 gas and are considered safe against re-entrancy.
A.
.send returns a Boolean and .transfer throws an exception on error. Both just forward the gasstipend of 2300 gas and are considered safe against re-entrancy.
Answers
B.
.send throws an exception and .transfer returns a Boolean on error. Both just forward the gasstipend of 2300 gas and considered safe against re-entrancy
B.
.send throws an exception and .transfer returns a Boolean on error. Both just forward the gasstipend of 2300 gas and considered safe against re-entrancy
Answers
C.
.send returns a Boolean and .transfer throws an exception on error. .send is considered dangerous, because it sends all gas along, while .transfer only sends the gas stipend of 2300 gas along
C.
.send returns a Boolean and .transfer throws an exception on error. .send is considered dangerous, because it sends all gas along, while .transfer only sends the gas stipend of 2300 gas along
Answers
D.
.send and .transfer are both considered low-level functions which are dangerous, because they send all gas along. It's better to use address.call.value()() to control the gas-amount.
D.
.send and .transfer are both considered low-level functions which are dangerous, because they send all gas along. It's better to use address.call.value()() to control the gas-amount.
Answers
Suggested answer: A

All low-level functions on the address, so address.send(), address.call.valueQQ, address.callcode and address.delegatecall:

A.
are interrupting execution on error, because they throw an exception.
A.
are interrupting execution on error, because they throw an exception.
Answers
B.
continuing execution on error silently, which is the reason why they are so dangerous.
B.
continuing execution on error silently, which is the reason why they are so dangerous.
Answers
C.
returning Booleans to indicate an error during execution.
C.
returning Booleans to indicate an error during execution.
Answers
D.
.send() throws an exception, while the other functions are returning Booleans during execution to indicate an error.
D.
.send() throws an exception, while the other functions are returning Booleans during execution to indicate an error.
Answers
Suggested answer: C

When using assert to check invariants and it evaluates to false:

A.
all gas is consumed.
A.
all gas is consumed.
Answers
B.
all remaining gas is returned.
B.
all remaining gas is returned.
Answers
Suggested answer: A

When using require to check input parameters and it evaluates to false:

A.
all gas is consumed
A.
all gas is consumed
Answers
B.
all remaining gas is returned.
B.
all remaining gas is returned.
Answers
Suggested answer: B

To send ether to a contract without a function call:

A.
a fallback function must be declared and it must be made payable. If there is no fallback function or the fallback function is not payable it will throw an exception.
A.
a fallback function must be declared and it must be made payable. If there is no fallback function or the fallback function is not payable it will throw an exception.
Answers
B.
either a fallback function which is payable exists, or no fallback function at all exists.
B.
either a fallback function which is payable exists, or no fallback function at all exists.
Answers
C.
you cannot send ether to a contract without explicitly calling a function. The fallback function can never receive ether.
C.
you cannot send ether to a contract without explicitly calling a function. The fallback function can never receive ether.
Answers
Suggested answer: A

Using selfdestruct(beneficiary) with the beneficiary being a contract without a payable fallback function:

A.
will throw an exception, because the fallback function is non-payable and thus cannot receive ether.
A.
will throw an exception, because the fallback function is non-payable and thus cannot receive ether.
Answers
B.
it's impossible to secure a contract against receiving ether, because selfdestruct will always send ether to the address in the argument. This is a design decision of the Ethereum platform.
B.
it's impossible to secure a contract against receiving ether, because selfdestruct will always send ether to the address in the argument. This is a design decision of the Ethereum platform.
Answers
C.
selfdestruct doesn't send anything to a contract, it just re-assigns the owner of the contract to a new person. Sending ether must be done outside of selfdestruct.
C.
selfdestruct doesn't send anything to a contract, it just re-assigns the owner of the contract to a new person. Sending ether must be done outside of selfdestruct.
Answers
Suggested answer: B
Total 102 questions
Go to page: of 11