0
0
Blockchain / Solidityprogramming~10 mins

Event declaration in Blockchain / Solidity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to declare an event named Transfer.

Blockchain / Solidity
event [1](address indexed from, address indexed to, uint256 value);
Drag options to blanks, or click blank then click option'
ATransfer
BEvent
CLog
DNotify
Attempts:
3 left
💡 Hint
Common Mistakes
Using a keyword like 'Event' instead of the event name.
Using a generic word like 'Log' or 'Notify' which are not event names.
2fill in blank
medium

Complete the code to declare an event named Approval with three parameters.

Blockchain / Solidity
event Approval(address indexed owner, address indexed [1], uint256 value);
Drag options to blanks, or click blank then click option'
Areceiver
Bspender
Csender
Dcaller
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'receiver' or 'sender' which are not standard names here.
Confusing the parameter with the owner address.
3fill in blank
hard

Fix the error in the event declaration by completing the missing keyword.

Blockchain / Solidity
event Deposit(address indexed from, uint256 amount) [1];
Drag options to blanks, or click blank then click option'
Aemit
Bpublic
Cexternal
Danonymous
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'emit' which is for calling events, not declaring them.
Using visibility keywords like 'public' or 'external' which are invalid here.
4fill in blank
hard

Fill both blanks to declare an event named OwnershipTransferred with two indexed address parameters.

Blockchain / Solidity
event OwnershipTransferred(address indexed [1], address indexed [2]);
Drag options to blanks, or click blank then click option'
ApreviousOwner
BnewOwner
Cowner
Dadmin
Attempts:
3 left
💡 Hint
Common Mistakes
Using generic names like 'owner' or 'admin' instead of descriptive ones.
Mixing the order of parameters.
5fill in blank
hard

Fill all three blanks to declare an event named TokenMinted with an indexed address minter, a tokenId, and a value.

Blockchain / Solidity
event TokenMinted(address indexed [1], uint256 [2], uint256 [3]);
Drag options to blanks, or click blank then click option'
Aminter
BtokenId
Camount
Downer
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'owner' instead of 'minter' for the first parameter.
Confusing 'tokenId' with 'amount'.