CBDE Exam practice Questions

अब Quizwiz के साथ अपने होमवर्क और परीक्षाओं को एस करें!

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. 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. 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. 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

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.

If we divide two integers: 5/2, the result is a) 2, because the decimal is truncated b) 3, because it's always rounded c) 2.5, because it's automatically converted into a float.

a) 2, because the decimal is truncated

You interact with a smart contract and see a gas usage of 50,000 gas with a gas cost of 15Gwei, how much Ether would you have to pay to the miner? a) 750,000,000,000,000 Wei b) 750,000,000,000 Wei c) 750,000,000 Wei d) A flat fee of 1 Ether

a) 750,000,000,000,000 Wei

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

a) A 20 bytes value

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. b) Either a fallback function which is payable exists, or no fallback function at all exists. c) You cannot send ether to a contract without explicitly calling a function. The fallback function can never receive ether

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.

Function and Variable Visibility: a) A function marked as internal cannot be called by other contracts, unless the function is used by a derived contract. Private Functions cannot be called by any other outside contract and public variables are generating automatically a getter function. b) A function that is marked as external can never be called internally. Private functions can also be called by derived contracts using inheritance. Private variables are accessible also in derived contracts

a) A function marked as internal cannot be called by other contracts, unless the function is used by a derived contract. Private Functions cannot be called by any other outside contract and public variables are generating automatically a getter function.

When a new block is mined a) A list of transactions as well as uncles is incorporated in the block. All gas that is used during those transactions is added to the miners' balance. Also, the block reward is added to the miner. Then the same transactions are run again by every participating node in the network to achieve consensus. b) A list of transactions is incorporated in that block. Gas used during the execution is attached to the executing contracts while the block reward is automatically spread across the mining pool to ensure a fair spread. Consensus is reached by a special form of hash code

a) A list of transactions as well as uncles is incorporated in the block. All gas that is used during those transactions is added to the miners' balance. Also, the block reward is added to the miner. Then the same transactions are run again by every participating node in the network to achieve consensus.

Address.Call vs. Address.Delegatecall: 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.

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.

When using assert to check invariants and it evaluates to false a) All gas is consumed b) All remaining gas is returned

a) All gas is consumed

Address.send() and address.transfer() a) Are considered safe against re-entrancy because of the small gas stipend of 2300 gas b) Are considered dangerous because they send all gas along, it's better to use address.call.value()()

a) Are considered safe against re-entrancy because of the small gas stipend of 2300 gas

Why is it important to follow the same Interfaces? a) Because websites that try to interface with the Token would have to know the exact ABI. With the standard Interfaces it's clear how the interaction has to be defined. b) By following the standard interface the Ethereum Foundation can easily validate the Tokens and approve any audits. c) The Interface is a mere suggestion for the developer. The actual Token contract can look totally different and would still be considered an ERC20/ERC721 token.

a) Because websites that try to interface with the Token would have to know the exact ABI. With the standard Interfaces it's clear how the interaction has to be defined.

Having a bug-bounty program early on a) Can help to engage the community in testing your smart contracts and therefore help find bugs early. b) Might be a burden as it's mainly administrative overhead. c) Is completely useless. Who wants to test beta-ware software. Better start with the bug-bounty program after the contract is released on the main-net.

a) Can help to engage the community in testing your smart contracts and therefore help find bugs early.

Gas is used a) Depending on the instruction/opcode run by the Ethereum Blockchain b) Is a fixed amount for the length of your smart contract

a) Depending on the instruction/opcode run by the Ethereum Blockchain

Single line comments in Solidity are working with a) Either // or /// b) With /* comment */ or /** @.. natspec style */ c) Are not possible, all comments must be multi-line

a) Either // or ///

What's the difference between ERC and EIP? a) Ethereum Request for Comments (ERC) are used to define standards for the usage of Ethereum. Ethereum Improvement Proposals (EIP) are used to improve the Ethereum Protocol itself. b) Ethereum Request for Comments (ERC) are used to propose new distributed applications on top of the Ethereum layer, while Ethereum Improvement Proposals (EIP) are used to improve existing mining software. c) Ethereum Request for Comments (ERC) are an open platform to discuss continuous forking of the Ethereum platform. Successful forks are then incorporated in the Ethereum Improvement Proposals (EIP) for further voting by the Ethereum Consortium.

a) Ethereum Request for Comments (ERC) are used to define standards for the usage of Ethereum. Ethereum Improvement Proposals (EIP) are used to improve the Ethereum Protocol itself.

Files can be... a) Imported using relative and absolute paths, where the "." And the ".." depict that it's a relative path. b) Imported only via GitHub using the Repository and Username. c) Imported using the special requirefile(...) statement, which looks in a specific library path to import files

a) Imported using relative and absolute paths, where the "." And the ".." depict that it's a relative path.

Truffle: a) Is a framework that helps developers with Testing, Deployment and Management of Smart Contracts and Distributed Applications. b) Is a library that helps developers to connect to Ethereum nodes, because it abstracts the JSONRPC interface. c) Is a framework for Java, similar to Web3.js for JavaScript. It's a great way to develop distributed Java enterprise applications.

a) Is a framework that helps developers with Testing, Deployment and Management of Smart Contracts and Distributed Applications.

Integrating the community into your testing a) Is great, because they often find bugs which weren't considered before. b) Is not good, because you might give out secrets

a) Is great, because they often find bugs which weren't considered before.

Why is Unit-Testing so important? a) It helps you find bugs, regression bugs and sometimes also helps you to understand your code from different angles. b) It is a great way to spend time on something that you get paid for. But ultimately it will just slow down the development process.

a) It helps you find bugs, regression bugs and sometimes also helps you to understand your code from different angles.

What are Ethereum Nodes? a) Programs implementing the Ethereum Protocol to talk to each other and JSON-RPC interfaces to talk to the outside world b) A Java-Script library to compile and run Solidity Code c) A Framework for deploying and running smart contract in a decentralized way

a) Programs implementing the Ethereum Protocol to talk to each other and JSON-RPC interfaces to talk to the outside world

Unit-Testing on a local chain is important, because it helps you to a) Run tests quickly and especially for free, compared to continuous deployment on the MainNetwork. This way you save a lot of fees, time and costs. b) Run tests in an environment where logging is activated. On the Main-Net you have no access to transaction logs and this is ultimately the information you need to debug your contracts. c) Avoid regression bugs with contracts that are updated constantly on the main-net. Once you update a contract on the main-net, the address stays the same, but the code changes and this can have disastrous side-effects.

a) Run tests quickly and especially for free, compared to continuous deployment on the MainNetwork. This way you save a lot of fees, time and costs.

Gas costs accrue on a) Sending a transaction no matter the content b) Sending a transaction only with a new smart contract deployment c) Sending a transaction only interacting with an already deployed smart contract

a) Sending a transaction no matter the content

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. b) Metadata contains the address, and the size of the smart contract. The ABI Array is generated externally upon deploying the smart contract. c) The ABI array and the Metadata are not generated when solidity is compiled to bytecode, they are generated by migration software which deploys the smart contract on the blockchain.

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.

To communicate with an Ethereum node via JavaScript a) The library you use must make use of the JSON-RPC Interface of an Ethereum Node b) Must Implement the Ethereum Protocol to connect to other Ethereum Nodes c) Must use Web3.js, which is closed source to communicate to other Ethereum Nodes

a) The library you use must make use of the JSON-RPC Interface of an Ethereum Node

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. c) The ERC20 token standard was the first standard token contract out there which was superseded by ERC721 tokens in order to support different token standards. One of the token standards that was necessary was non-fungible tokens. Since ERC721 tokens exist there is no need for ERC20 tokens anymore.

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.

Assert is used a) To check internal states that should never happen b) To check input arguments from users

a) To check internal states that should never happen

A Struct is a great way a) To define a new datatype in Solidity, so you don't need to use objects of another contract b) To hold instances of other contracts c) To implement pointers to other contracts that can hold new datatypes

a) To define a new datatype in Solidity, so you don't need to use objects of another contract

A version pragma is a great way a) To make it clear for which compiler version a smart contract was developed. It helps to avoid breaking changes. b) To make it clear for which blockchain a smart contract was developed. It helps to avoid confusion with beta-customers. c) To make it clear for which blockchain node a smart contract was developed. It helps to avoid mixing up different versions of go-ethereum.

a) To make it clear for which compiler version a smart contract was developed. It helps to avoid breaking changes.

Truffle has an integrated in-memory blockchain which makes unit-testing very easy a) True, but it's still good to use Ganache, or even a real private network for testing. b) False, it's necessary to use Ganache or even a real private network for testing.

a) True, but it's still good to use Ganache, or even a real private network for testing.

To get the address that initiated the transaction you need to use a) Tx.origin b) Msg.sender

a) Tx.origin

If you need more fine-grained functionality than solidity offers out of the box a) You can incorporate inline-assembly to get better controls b) You have to import pre-compiled assembly files which are then hard-copied into the bytecode of the compiled solidity file c) You can use Viper, the experimental assembly like language specifically to offer more flexibility

a) You can incorporate inline-assembly to get better controls

When you do external calls to other smart contracts a) You should follow the checks-effects-interactions pattern and avoid state changes after the call. b) You should follow the effects-checks-interactions pattern and avoid state changes before the call. c) You should follow the checks-effects-interactions pattern, which is only necessary when you do calls to contracts where a direct contract call is not possible.

a) You should follow the checks-effects-interactions pattern and avoid state changes after the call.

Inhertiance 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. b) all public and private state variables, public, internal and external functions, but not modifiers. c) all public state variables and properties, public functions and modifiers, but not internal, external or private ones

a) all public state variables and properties, public and internal functions and modifiers.

If contract MyContractA is derived from Contract MyContractB, then this would be the right syntax: a) contract MyContractA is MyContractB { ... } b) contract MyContractA inherit (MyContractB) {...} c) contract MyContractA extends MyContractB {...} d) contract MyContractB derives MyContractA {...}

a) contract MyContractA is MyContractB { ... }

To store almost all data in the Ethereum Blockchain a) A Linked List with pointers to previous blocks hashes is used b) A Merkle Patricia Trie is used c) A Radix Trie is used because the Merkle Patricia Trie is too inefficient

b) A Merkle Patricia Trie is used

When using require to check input parameters and it evaluates to false a) All gas is consumed b) All remaining gas is returned

b) All remaining gas is returned

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)

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)

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. b) necessary when developing distributed applications with HTML and JavaScript, because the proprietary JSON-RPC interface of Ethereum Nodes is closed source. c) a great way to start with a boilerplate distributed application. Web3.js gives you a lot of options to start either with React or Vue.js apps.

a) useful when developing distributed applications with HTML and JavaScript, because it already implements the abstraction of the JSON-RPC interface of Ethereum Nodes.

What's the correct scientific notation? a. 1 Ether = 10^18 wei, 10^9 Gwei, 10^3 Finney b. 1 Ether = 10^19 wei, 10^13 Gwei, 10^3 Finney c. 1 Ether = 10^16 wei, 10^13 Gwei, 10^3 Finney d. 1 Ether = 10^18 wei, 10^6 Gwei, 10^6 Finney

a. 1 Ether = 10^18 wei, 10^9 Gwei, 10^3 Finney

EoA a. Externally Owned Accounts change their address every time a Transaction is sent because of the nonce b. Externally Owned Accounts keep their address, but on the blockchain a nonce is increased every time they send a transaction to avoid replay attacks

a. Externally Owned Accounts change their address every time a Transaction is sent because of the nonce

What does a Hashing Algorithm is deterministic mean? a. Given the same input it always produces the same output b. Given a long input it uses equally distributed data to produce the output c. Given the output it shouldn't be possible to re-generate the input

a. Given the same input it always produces the same output

DApps are... a. Great, because they cutout the middle man, run on a trusted platform, apply logic to the blockchain where already economic assets are running and thus allow peer to peer trade. b. An amazing way to create new applications. Those applications run entirely separated from other applications on the platform and allow for logical interactions. To add an additional layer of trust they can't access any funds. c. A new way of applying logical operations for banks and big financial institutions. This way they can reduce staff while operating at increased security.

a. Great, because they cutout the middle man, run on a trusted platform, apply logic to the blockchain where already economic assets are running and thus allow peer to peer trade.

Sending one Ether a. Is actually internally translated to Wei, so it will send the equivalent of 10^18 Wei b. Is actually internally translated to Finney, so it will send the equivalent of 10^3 Finney c. Is actually internally translated to Szabo, so it will send the equivalent of 10^6 Szabo

a. Is actually internally translated to Wei, so it will send the equivalent of 10^18 Wei

PoS a. PoS would be better, because it can reduce the amount of energy needed for mining b. PoS would be worse, because it would increase the amount of energy needed for mining

a. PoS would be better, because it can reduce the amount of energy needed for mining

Proof of Work (PoW) vs. Proof of Stake. a. PoW is computationally intensive which requires lots of energy. On the other hand, miners earn straightforward a reward for mining a block and incorporating transactions. b. PoW is better than PoS, because with PoS we increase the amount of energy spent on the network. c. PoS is mining with specialized new hardware that has to be purchased with a stack of Ether in the network. Hence the Name: Proof of Stake, which derives from Stack.

a. PoW is computationally intensive which requires lots of energy. On the other hand, miners earn straightforward a reward for mining a block and incorporating transactions.

What is the nonce-field in a transaction? a. To protect against replay attacks b. To have an additional checksum for transactions c. To sum up all ethers sent from that address

a. To protect against replay attacks

Loops in Solidity a) Are a great way to circumvent gas requirements, because a loop will only consume gas once b) Are dangerous when used with datastructures that grow, such as arrays or mapping, because it's hard to estimate the gas requirements c) Should be avoided where possible, because of unknown side-effects on the gas requirements

b) Are dangerous when used with datastructures that grow, such as arrays or mapping, because it's hard to estimate the gas requirements

Events a) Are stored on chain and are a great way to get a return value when a contract calls another contract b) Are stored in something like a side-chain and cannot be accessed by contracts c) Are used primarily for debugging exceptions in solidity

b) Are stored in something like a side-chain and cannot be accessed by contracts

Consensus is reached a) By the miner nodes which make sure that a transaction is valid b) By every single node in the blockchain network executing the same transaction c) By a cryptographic secure signature algorithm called ECDSA which makes sure that cheating is impossible

b) By every single node in the blockchain network executing the same transaction

Solidity gets compiled to a) Bytecode that can't be understood by humans b) Bytecodes which are essentially opcodes running instruction by instruction

b) Bytecodes which are essentially opcodes running instruction by instruction

View and Pure Functions a) Can only be accessed during calls b) Can be accessed during transactions and calls

b) Can be accessed during transactions and calls

The Fallback function a) Cannot receive Ether, not even by adding the payable modifier b) Can contain as much logic as you want, but it's better to keep it short and not exceed the gas stipend of 2300 gas c) Can be used to avoid receiving ether.

b) Can contain as much logic as you want, but it's better to keep it short and not exceed the gas stipend of 2300 gas

If a User calls contract A and that calls Contract B, then msg.sender in Contract B will contain the address of a) The User b) Contract A

b) Contract A

According to the official Style Guide a) 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.

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.

Checking the balance of an address inside a loop of a smart contract constantly a) Doesn't cost any gas b) Cost gas every time we check the balance

b) Cost gas every time we check the balance

With the truffle config file you can manage a) The amount of gas your contract deployment and transactions, against your contract, will need. This way you can essentially lower the gas costs over traditional web3.js dApps. b) Different Networks to deploy your contracts to. This way you can easily deploy to a local blockchain, the main-net or the Ropsten/Rinkeby Test-Net with only one parameter. c) You can manage your secret API keys to the Ethereum Network. This way you can get access to several different Ethereum nodes at the same time without the need to switch your keyfiles.

b) Different Networks to deploy your contracts to. This way you can easily deploy to a local blockchain, the main-net or the Ropsten/Rinkeby Test-Net with only one parameter.

In Solidity it's not possible to use inheritance from multiple sources a) True b) False

b) False

The following are value types in Solidity a) Integer, Boolean, Struct, Mapping and Enum b) Integer, Boolean, Enum and Addresses c) Integer, Boolean, Structs and Fixed Point Numbers

b) Integer, Boolean, Enum and Addresses

Using truffle-contract over Web3.js a) Is a must for every developer, because Web3.js changes so often b) Is a convenient way because Web3.js is currently still in beta and truffle-contract can handle transactions with JavaScript-promises. c) They are both completely different things. Truffle-Contract is a framework while Web3.js is a library.

b) Is a convenient way because Web3.js is currently still in beta and truffle-contract can handle transactions with JavaScript-promises.

Importing from GitHub... a) Works across all compilers and platforms the same way b) Is generally possible, but currently works only in Remix, but doesn't work in Truffle

b) Is generally possible, but currently works only in Remix, but doesn't work in Truffle

EVM assembly a) Is much better than Solidity and a viable alternative b) Is what every high-level language gets compiled to c) Is another language similar to LLL, more secure than Solidity.

b) Is what every high-level language gets compiled to

When defining a new datatype a) It's 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

b) It's best to use a struct, which is cheaper than deploying a new contract.

To avoid issues during Ethereum platform upgrades a) It's good to inform users about the updates via a newsletter. b) It's good to have the ability to pause a contract in order to manage the money at risk. c) Ethereum doesn't upgrade the platform. It's fixed and final.

b) It's good to have the ability to pause a contract in order to manage the money at risk.

To Iterate through a mapping you a) Can use the length parameter of the mapping b) You need an external helper variable c) You cannot iterate any mapping to make the overall language design more safe

b) You need an external helper variable

It's possible to access the blockchain via an Ethereum Node a) Only via JavaScript because there is the proprietary Web3.js library b) by any programming language, as long as it adheres to the JSON-RPC standard

b) by any programming language, as long as it adheres to the JSON-RPC standard

To develop smart contracts: a) It's good to start with a local in-memory blockchain with unit tests but then deploy to the mainnet as rapidly as possible. b) It's good to start with a local in-memory blockchain with unit-tests. Then, in the next step, debug and test the smart contract on a test-net like Ropsten or Rinkeby with beta customers to iron out last issues before deploying it to the main-net. c) It's good to start with a test-net with beta-customers like on the Rinkeby or Ropsten testnet, before testing it locally on an in-memory blockchain simulation such as Ganache. Then deploy it to the main-net.

b) It's good to start with a local in-memory blockchain with unit-tests. Then, in the next step, debug and test the smart contract on a test-net like Ropsten or Rinkeby with beta customers to iron out last issues before deploying it to the main-net.

When a smart contract pays out money a) It's good to use a push over a pull method. b) It's good to use a push and a pull method to ensure that participants can get their money no matter the contract state. In addition to pushing it should contain a withdraw method. c) It's good to use only pull and no push method

b) It's good to use a push and a pull method to ensure that participants can get their money no matter the contract state. In addition to pushing it should contain a withdraw method.

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 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. 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.

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.

Ethereum Nodes a) Must implement the Ethereum protocol and external access can only be done via the proprietary Ethereum Libraries like Web3.js b) Must Implement the Ethereum Protocol and a JSON-RPC to talk with clients c) Must implement Web3.js to interact with Websites

b) Must Implement the Ethereum Protocol and a JSON-RPC to talk with clients

Smart Contracts can be written in a) Java, C++, Solidity and JavaScript, because the Ethereum Blockchain is completely language agnostic and cross compilers for every major language exist. b) Solidity, Viper, LLL and Serpent, because those are high level languages that are compiled down to bytecode c) Solidity and JavaScript, because those are the official first implementations for Distributed applications and the Blockchain fully supports those languages

b) Solidity, Viper, LLL and Serpent, because those are high level languages that are compiled down to bytecode

Block Difficulty a) The Block Difficulty is determined by the Ethereum Committee every fortnight to reflect the average amount of transaction and it cannot be influenced by the network itself. b) The Block Difficulty increases when the time between mined blocks is below 10 seconds, while it decreases when the time is above 20 seconds. c) The Block Difficulty increases when the time between mined blocks is below 20 seconds, while it decreases when the tie is above 60 seconds

b) The Block Difficulty increases when the time between mined blocks is below 10 seconds, while it decreases when the time is above 20 seconds.

Require is used a) To check internal states that should never happen b) To check input arguments from users

b) To check input arguments from users

When considering smart contracts and the blockchain it's good a) To move all existing logic to the blockchain, so everything runs on the same system. This way it might be more complex, but easier to maintain. b) To move only those parts to the blockchain that really need the blockchain. This way smart contracts can be easier to read, easier to test and are not so complex. c) To move those parts to the blockchain that deal with Ether transfers. All other parts can remain in traditional database systems. This way only the value-transfer is on the blockchain.

b) To move only those parts to the blockchain that really need the blockchain. This way smart contracts can be easier to read, easier to test and are not so complex.

Truffle boxes are a great way a) To contribute to the box community which is the distributed file system for truffle b) To start with a pre-configured environment for most web-development needs c) To use tools that makes boxing of Dapps for different platforms very easy

b) To start with a pre-configured environment for most web-development needs

For Rapid Development Cycles it's good a) To deploy to the main-network as quickly as possible b) To use in-memory blockchain simulations, because mining works instantaneously c) To use a private network at all times, because this is the closest you get to the real network

b) To use in-memory blockchain simulations, because mining works instantaneously

.On a consortium network a) Everybody can become a miner, everybody can send transactions and everything is public b) Usually only a few selected nodes can be miners. Transactions can be further limited

b) Usually only a few selected nodes can be miners. Transactions can be further limited

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

b) Will return false on error while address.transfer() will cascade transactions

Multi-Line Comments in Solidity work with a) Either // or /// b) With /* comment */ or /** @.. natspec style */ c) Are not possible, all comments must be single-line

b) With /* comment */ or /** @.. natspec style */

Go-Ethereum vs. Ganache a) 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

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

Externally Owned Accounts a. Can be destroyed using the selfdestruct keyword. This way all remaining ether will be sent to the receiver address, regardless if they have a fallback function or not. b. Are bound to a private key which is necessary to sign transactions outgoing from that account c. Are logical opcodes running on the ethereum blockchain very similar to smart contracts.

b. Are bound to a private key which is necessary to sign transactions outgoing from that account

Select which statement is true about the EVM a. While the EVM is Sandboxed, it isn't as powerful as the Bitcoin Network, because it's not Turing Complete b. The EVM can't access hardware layers or anything outside a blockchain node because it's sandboxed c. The EVM is extremely powerful, turing complete and perfect for doing computational intensive things, because of the direct access to the graphics card.

b. The EVM can't access hardware layers or anything outside a blockchain node because it's sandboxed

Public Keys vs. Private Keys, select which is true: a. The Public Key is for Signing Transactions, the Private Key must be given out to verify the signature b. The Private Key signs transactions, the public key can verify the signature c. The Private Key is to generate a public key. The public key can sign transactions, the address is here to verify the transactions

b. The Private Key signs transactions, the public key can verify the signature

What Are Private Keys for? a. To Protect the Public Keys by being cryptographically significant b. To Sign Transactions And To Derive an Address From c. To Generate An Address which can sign transactions

b. To Sign Transactions And To Derive an Address From

To get most out of the blockchain it is best... a. To use it for all business logic. It's always best to have everything in once place. b. To use it only for those things which need the benefits of the blockchain

b. To use it only for those things which need the benefits of the blockchain

Transactions a. Transactions containing the same data to create the same smart contract always have the same signature b. Transactions containing the same data to create the same smart contract are having a different signature because of the nonce which changes upon every transaction

b. Transactions containing the same data to create the same smart contract are having a different signature because of the nonce which changes upon every transaction

A Private Network is a) A side Channel to the Ethereum Main Net which costs less gas to run smart contracts b) An exact clone of the Rinkeby Test-Network which can be started as virtual machine in the Azure Cloud c) A Network running only in a private area, where people cannot join freely and openly

c) A Network running only in a private area, where people cannot join freely and openly

View and Pure Functions: a) A function marked as pure can change the state, while a view function can only return static calls b) A function marked as view can never access state variables, while pure functions are here to return only one value c) A view function can access state variables, but not write to them. A Pure function cannot modify or read from state

c) A view function can access state variables, but not write to them. A Pure function cannot modify or read from state

If you are starting a new ERC20 token a) It would be best to start from scratch, just looking at the required interface. b) It is beneficial to copy and paste the already existing code from the Ethereum wiki and modify this until you like it. c) Best is to start with an audited implementation, for example from OpenZeppelin, in order to reuse already existing code.

c) Best is to start with an audited implementation, for example from OpenZeppelin, in order to reuse already existing code.

Solidity files... a) Can't be split across multiple files, everything should be in one single file b) Can be split across multiple files, but every contract must be in a file with the same name as the contract itself c) Can be spread across multiple files. To import all contract from a file you can use "import 'myfile.sol'. To import Contract MyContract from myfile.sol you use "import {MyContract as SomeContract} from 'myfile.sol';".

c) Can be spread across multiple files. To import all contract from a file you can use "import 'myfile.sol'. To import Contract MyContract from myfile.sol you use "import {MyContract as SomeContract} from 'myfile.sol';".

A Blockchain Node a) Can never become a mining node b) Can always become a mining node c) Can become a mining node, depending if the implementation has the functionality implemented

c) Can become a mining node, depending if the implementation has the functionality implemented

With truffle it's easy to write clean-room unit-tests a) For Java, JavaScript, and C++ b) For JavaScript using Web3.js c) For Solidity and JavaScript d) For any language, as long as it adheres to the open Testing-Interface from Truffle.

c) For Solidity and JavaScript

.GETH a) Is the reference implementation of the Ethereum protocol and every other node implementation internally uses the closed-source from Geth b) Is the library that is used for the blockchain node Go-Ethereum. It is also used by Parity is parts, because it's closed source c) Is one of the many blockchain nodes that implement the Ethereum Protocol. It's open source and everyone can contribute.

c) Is one of the many blockchain nodes that implement the Ethereum Protocol. It's open source and everyone can contribute.

To generate a random number a) It's good to use the block timestamp, as this is always different b) It's good to use the block hash as this is clearly always very different c) It's good to use the RANDAO smart contract d) It's not possible to have a random number in a deterministic environment such as the Ethereum blockchain.

c) It's good to use the RANDAO smart contract

All low-level functions on the address, specifically address.send(), address.call.value()(), address.callcode and address.delegatecall a) Interrupt execution on error, because they throw an exception. b) Continue execution on error silently, which is the reason why they are so dangerous. c) Return Booleans to indicate an error during execution d) .send() throws an exception, while the other functions return Booleans during execution to indicate an error.

c) Return Booleans to indicate an error during execution

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

c) Sends all the gas along and returns a false on error

Topic: Block Timestamp a) Because the timestamp is based on the time zone of the miner it changes the difficulty continuously to reflect network latency. b) The timestamp can't be influenced by a miner and is generally considered safe to be used for randomness on the blockchain. c) The timestamp can be influenced by a miner to a certain degree but it's always independent from the time-zone.

c) The timestamp can be influenced by a miner to a certain degree but it's always independent from the time-zone.

A Mapping consists of keys and value. a) The Keys can be anything, but the value can't be another mapping or struct b) The Value can be anything, but the key cannot be another mapping, struct, integer or Boolean c) The value can be anything, but the key cannot be another mapping, struct, enum or dynamically sized array

c) The value can be anything, but the key cannot be another mapping, struct, enum or dynamically sized array

To compare a String in Solidity you use a) String1 == string2 b) The internal function "str_compare(str1,str2)" c) You can't directly compare two strings, but one method would be to hash both strings and compare the hashes d) Bytes32(string1) == bytes32(string2)

c) You can't directly compare two strings, but one method would be to hash both strings and compare the hashes

When you are programming a game like poker or battleships where you need to hide opponents' values is 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.

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.

Smart Contracts a. Are always living on the same address, because the blockchain is deterministic. So, one account can always have one smart contract b. Are having the same address as the EOA c. Are sitting on their own address. The Address is created from the nonce and the EOA address and could be known in advance before deploying the smart contract. d. The address of the smart contract is a random address which gets generated by the miner who mines the contract-creation transaction.

c. Are sitting on their own address. The Address is created from the nonce and the EOA address and could be known in advance before deploying the smart contract.

Which is the right order for Denominations? a. Wei, Finney, Szabo, Ether, Tether b. Finney, Szabo, Mether, Gwei c. Gwei, Szabo, Finney, Ether

c. Gwei, Szabo, Finney, Ether

Hashing a. Mining uses Keccack256 while internally to hash values it's easy to use the DaggerHashimoto to create a meaningful hash b. Mining uses the Dagger-Hashimoto hashing while internally the EVM uses SHA256 which is an alias for Keccack256 c. Mining uses the Dagger-Hashimoto hashing while internally the EVM uses Keccack256 which is almost similar to SHA256, but has a different padding so produces different hashes

c. Mining uses the Dagger-Hashimoto hashing while internally the EVM uses Keccack256 which is almost similar to SHA256, but has a different padding so produces different hashes

.The JSON-RPC Protocol a) Is used to communicate between blockchain nodes b) Is used to ensure safe communication between miners c) Is a means of dumping the blockchain data in a so-called consensus export d) Is used to communicate between the blockchain node and externally running applications

d) Is used to communicate between the blockchain node and externally running applications


संबंधित स्टडी सेट्स

ECON-2302 Inquizitive Ch. 8 - Business Costs & Production

View Set

Chapter 17: The Middle East 1750-1900

View Set

CNA 234 | Ch.4, Configuring Group Policies

View Set

Resistance/ Conductance/ Ohm's Law

View Set

Critical Thinking, Implementing Nursing Care, Nursing Diagnosis, Planning Nursing Care

View Set