Free EC-Council Certified Blockchain Professional practice — 6 questions on Smart Contracts and Blockchain Implementation, with explanations. No sign-up.
Full 12-question mixed test →
Question 1 of 6 · Smart Contracts and Blockchain Implementation
A team spins up a new private Ethereum network for internal testing using a custom genesis.json but forgets to change the default 'chainId' value copied from a public testnet template. Six months later, a developer accidentally broadcasts a signed transaction meant for the private network to the public testnet, and it is accepted and mined there. What is the ROOT cause of this security failure?
EIP-155 replay protection binds a signed transaction to a specific chainId. Reusing a public chainId on a private network means transactions are valid on both chains, enabling exactly this cross-chain replay scenario. The exam expects candidates to know a unique chainId must be set in genesis.json for private networks.
Question 2 of 6 · Smart Contracts and Blockchain Implementation
A Solidity contract must accept plain Ether transfers (no calldata) sent via a simple `.transfer()` call from an EOA, but the developer wants any call that includes data with no matching function selector to explicitly revert instead of silently succeeding. Given Solidity >=0.6.0, which combination of functions achieves this?
Since Solidity 0.6.0, plain Ether transfers with empty calldata route to `receive()`. Calls with non-empty calldata that don't match any function selector route to `fallback()`. Defining `receive()` as payable handles plain transfers, while a non-payable `fallback()` that reverts rejects unrecognized calls with data — exactly the required behavior.
Question 3 of 6 · Smart Contracts and Blockchain Implementation
A Solidity contract declares state variables `uint8 a; uint8 b; uint256 c;` in that order. A developer wants to minimize gas costs for storage writes by exploiting the EVM's storage slot packing rules. Which statement is TRUE about this layout?
Solidity packs consecutive state variables into a single 32-byte storage slot when their combined size fits, in declaration order. Two uint8 values (1 byte each) fit together in one slot; the following uint256 (32 bytes) cannot share that slot and starts a new one. This is a heavily tested gas-optimization concept.
Question 4 of 6 · Smart Contracts and Blockchain Implementation
Which command sequence correctly compiles a Solidity project and runs its test suite against a locally running Ganache instance using the Truffle framework?
`truffle compile` compiles contracts into build artifacts, and `truffle test --network development` runs the Mocha/Chai-based test suite against the network defined as 'development' in truffle-config.js — the conventional name for a local Ganache instance. This is the standard workflow tested on the exam.
Question 5 of 6 · Smart Contracts and Blockchain Implementation
A DApp front-end uses web3.js to interact with a deployed smart contract. The developer calls `myContract.methods.getBalance(address).call()` and separately calls `myContract.methods.withdraw(amount).send({from: account})`. A junior developer asks why `getBalance` doesn't require gas or a transaction hash but `withdraw` does. What is the correct explanation?
`.call()` executes the function as a local read-only simulation against current state and returns the result immediately without creating a transaction or consuming gas from the caller's account. `.send()` creates and broadcasts an actual transaction that must be mined, consuming gas and altering state. This distinction is core to DApp interaction and heavily tested.
Question 6 of 6 · Smart Contracts and Blockchain Implementation
While monitoring a private Ethereum network, an engineer inspects a transaction receipt and finds the field `status: 0x0`. The transaction consumed all the gas specified in the gas limit. What does this combination indicate?
Since the Byzantium hard fork, transaction receipts include a `status` field: `0x1` for success, `0x0` for failure. When a transaction fails by running out of gas, ALL supplied gas is consumed (unlike an early explicit revert, which typically returns unused gas). Seeing full gas consumption alongside status 0x0 is a classic signal of an out-of-gas failure, an important monitoring/debugging pattern tested on the exam.
Ready for the real thing?
The full course has two full-length practice tests, video lessons for every exam domain, hands-on labs and detailed answer explanations.