Question 1
Topic: Implement web3.js
Skill tested: Use web3.js providers and contract calls to distinguish reads from transactions.
A supply-chain dashboard uses web3.js to display a shipment's current status and let an authorized operator update it. The contract exposes a view function `statusOf(id)` and a state-changing function `setStatus(id, value)`. The dashboard must read the status without asking the user to sign a transaction, but updates must be submitted from the operator's wallet and report their mined transaction hash. Which implementation best meets these requirements?
A contract method invoked with `.call()` executes locally against the selected node's state and does not create a transaction, which fits the read-only status lookup. A state-changing method must be submitted with `.send()` and an account authorized to sign; the returned PromiEvent can provide transaction lifecycle events, including a transaction hash and receipt. A reverses the intended behavior. C incorrectly treats `.call()` as a state-committing operation. D needlessly creates a transaction for a read and does not use the normal return-value path.