Blockchain CBDE Practice Test - Questions Answers, Page 7
List of questions
Related questions
Question 61
A version pragma is a great way to make it clear:
A.
for which compiler version a smart contract was developed for. It helps to avoid breaking changes.
B.
for which blockchain a smart contract was developed for. It helps to avoid confusion with beta-customers.
C.
for which blockchain node a smart contract was developed for. It helps to avoid mixing up different versions of go-ethereum.
Suggested answer: A
Question 62
Variables of the type address store:
A.
a 20 bytes value
B.
a 32 bytes value
C.
a string
D.
a 20 characters long hex number
Suggested answer: A
Question 63
Address.send():
A.
will cascade exceptions and address.transfer() will return a false on error.
B.
will return false on error while address.transfer() will cascade transactions.
Suggested answer: B
Question 64
Address.call.value():
A.
sends the gas stipend of 2300 gas and returns a false on error.
B.
sends all the gas along and cascades exceptions.
C.
sends all the gas along and returns a false on error.
D.
sends the gas stipend of 2300 gas and cascades exceptions.
Suggested answer: C
Question 65
Address.send() and address.transfer() are considered:
A.
safe against reentrancy because of the small gas stipend of 2300 gas.
B.
dangerous because they send all gas along, it's better to use address.call.value()().
Suggested answer: B
Question 66
When defining a new datatype:
A.
its best to use a contract with public storage variables, so it can be used like a class.
B.
it's best to use a struct, which is cheaper than deploying a new contract.
C.
it's not possible to generate new datatypes in Solidity.
Suggested answer: B
Question 67
What's the difference between Ethereum Request for Comments (ERC) and Ethereum Improvement Proposals (EIP)?
A.
ERC are here to define standards for the usage of Ethereum. EIP are here to improve the Ethereum Protocol itself.
B.
ERC are here to propose new distributed applications on top of the Ethereum layer, while EIP are here to improve existing mining software.
C.
ERC are an open platform to discuss continuous forking of the Ethereum platform. Successful forks are then incorporated in the EIP for further voting by the Ethereum Consortium.
Suggested answer: A
Question 68
What is the difference between ERC20 and ERC721 Tokens in simple terms?
A.
The tokens of a certain ERC20 symbol are all the same, the tokens of an ERC721 symbol are all different. So, ERC20 tokens are fungible, while ERC721 tokens are non-fungible.
B.
The tokens of a certain ERC20 symbol are all different, the tokens of an ERC721 symbol are all the same. So, ERC20 tokens are non-fungible while ERC721 tokens are fungible.
Suggested answer: A
Question 69
In order to implement an ERC20 token contract, you'd need at least to implement the following functions and events in order to fulfill the interface requirements:
A.
totalSupply(), balanceOf(address), allowance(address,address), transfer(address,uint256), approve(address,uint256), transferFrom(address,address,uint256). Events: Transfer(address,address,uint256), Approval(address,address,uint256)
B.
name(), symbol(), totalSupply(), balanceOf(address), ownerOf(uint26),approve(address,uint256), takeOwnership(uint256),transfer(address,uint256),Events: Transfer(address,address,uint256), Approval(address,address,uint256)
Suggested answer: A
Question 70
Why is it important to follow the same Interfaces?
A.
Websites that try to interface with the Token would have to know the exact ABI. It is upfront clear how the interaction has to be with the standard Interfaces.
B.
The Ethereum Foundation can easily validate the Tokens and approve any audits by following the standard interface.
Suggested answer: A
Question