BTA Certified Blockchain Developer - Ethereum Questions and Answers
CBDE BTA Certified Blockchain Developer - Ethereum Questions and Answers
Questions 4
Address.Call vs. Address.Delegatecall:
Options:
A.
Address.call() is used for calling other contracts using the scope of the called contract in terms of storage variables. Address.delegatecall() is used for libraries, which uses the storage variables of the contract who called. Libraries are a great way to re-use already existing code and delegatecall can make sure that no storage is used from the library, instead it looks like the code is directly copied into the calling contract.
B.
Address.delegatecall() is used for calling other contracts using the scope of the called contract in terms of storage variables. Address.call() is used for libraries, which uses the storage variables of the contract who called. Libraries are a great way to re-use already existing code and call() can make sure that no storage is used from the library, instead it looks like the code is directly copied into the calling contract.
both are the same, just implemented in a different language.
B.
with Go-Ethereum you get a real blockchain node where you can create your own local private network, connect to Test-Networks or the Main-Net, while with Ganache you get an in-memory blockchain simulation.
C.
with Ganache you get a real blockchain node where you can connect to the Test-Networks Rinkeby and Ropsten.
useful when developing distributed applications with HTML and JavaScript, because it already implements the abstraction of the JSON-RPC interface of Ethereum Nodes.
B.
necessary when developing distributed applications with HTML and JavaScript, because the proprietary JSON-RPC interface of Ethereum Nodes is a closed source.
When you are programming a game like poker of battleships where you need to hide opponents values is:
Options:
A.
with private state variables. This way nobody else other than the smart contract itself can see the information
B.
with external contracts holding those values. This way we can make sure that the information flow is following a clear logic and nobody else can access this information.
C.
You can't hide anything on the blockchain, because the information is public, just the call is private which means only other smart contracts would be limited in accessing that information.
you should capitalize function names, events and contract names, to avoid confusion with JavaScript. You should use Tabs to indentation and a maximum of 80 characters per line.
B.
contract names should be capitalized, while functions should be mixedCase. You should use 4 spaces as indentation and a maximum of 79 (or 99) characters per line.
C.
contract should be mixedCase, as well as function names. Events should be capitalized. 2 spaces should be used as indentation and a maximum of 120 characters per line.