0
0
Blockchain / Solidityprogramming~5 mins

Event declaration in Blockchain / Solidity - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Aevent
Bemit
Clog
Dfunction
What does the emit keyword do in Solidity?
ADeclares an event
BModifies contract storage
CFilters events
DTriggers an event to be logged
How many parameters can be marked as indexed in a single event?
A1
B2
C3
DUnlimited
Can events change the state of a smart contract?
AYes, always
BNo, events only log data
COnly if indexed
DOnly during deployment
Why use events in blockchain smart contracts?
ATo communicate with external apps
BTo store data permanently
CTo speed up transactions
DTo encrypt contract code
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.