Recall & Review
beginner
What is an event declaration in blockchain smart contracts?
An event declaration is a way to define a message that the smart contract can emit to the blockchain logs. It helps external applications listen and react to specific actions inside the contract.
Click to reveal answer
beginner
How do you declare an event in Solidity?
You use the
event keyword followed by the event name and parameters inside parentheses. For example: event Transfer(address indexed from, address indexed to, uint256 value);Click to reveal answer
intermediate
What does the
indexed keyword mean in event parameters?The
indexed keyword marks parameters that can be used to filter events efficiently when searching logs. You can have up to 3 indexed parameters per event.Click to reveal answer
beginner
Why are events important in blockchain applications?
Events allow smart contracts to communicate with external apps by logging important actions. This helps frontends or other services track contract activity without reading contract storage directly.
Click to reveal answer
beginner
Can events modify the blockchain state?
No, events only log information and do not change the blockchain state. They are used for off-chain communication and do not affect contract logic or storage.
Click to reveal answer
Which keyword is used to declare an event in Solidity?
✗ Incorrect
The
event keyword declares an event. emit is used to trigger it.What does the
emit keyword do in Solidity?✗ Incorrect
emit triggers the event to be recorded in the blockchain logs.How many parameters can be marked as
indexed in a single event?✗ Incorrect
Up to 3 parameters can be
indexed for efficient filtering.Can events change the state of a smart contract?
✗ Incorrect
Events only log information; they do not modify contract state.
Why use events in blockchain smart contracts?
✗ Incorrect
Events help external apps listen to contract actions via logs.
Explain how to declare and use an event in a blockchain smart contract.
Think about how contracts send messages to the outside world.
You got /5 concepts.
Describe the role of the
indexed keyword in event parameters and why it matters.Consider how external apps find specific events quickly.
You got /4 concepts.