0
0
Blockchain / Solidityprogramming~10 mins

Indexed parameters 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 indexed parameter in an event.

Blockchain / Solidity
event Transfer(address [1] from, address to, uint256 value);
Drag options to blanks, or click blank then click option'
Aindexed
Bpublic
Cmemory
Dpayable
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'public' or 'memory' instead of 'indexed' for event parameters.
Forgetting to add 'indexed' before the parameter name.
2fill in blank
medium

Complete the event declaration to index the 'to' address parameter.

Blockchain / Solidity
event Transfer(address from, address [1] to, uint256 value);
Drag options to blanks, or click blank then click option'
Apublic
Bpayable
Cmemory
Dindexed
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'memory' or 'payable' instead of 'indexed'.
Placing 'indexed' after the parameter name.
3fill in blank
hard

Fix the error in the event declaration by correctly indexing the 'owner' parameter.

Blockchain / Solidity
event Approval(address [1] owner, address spender, uint256 value);
Drag options to blanks, or click blank then click option'
Apublic
Bindexed
Cmemory
Dpayable
Attempts:
3 left
💡 Hint
Common Mistakes
Placing 'indexed' after the parameter name.
Using incorrect keywords like 'payable' or 'memory'.
4fill in blank
hard

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

Blockchain / Solidity
event Transfer(address [1] from, address [2] to, uint256 value);
Drag options to blanks, or click blank then click option'
Aindexed
Bpayable
Cmemory
Dpublic
Attempts:
3 left
💡 Hint
Common Mistakes
Indexing only one parameter when two are needed.
Using wrong keywords like 'payable' or 'memory'.
5fill in blank
hard

Fill all three blanks to declare an event with three indexed parameters: two addresses and one uint.

Blockchain / Solidity
event Approval(address [1] owner, address [2] spender, uint256 [3] value);
Drag options to blanks, or click blank then click option'
Aindexed
Bpayable
Cmemory
Dpublic
Attempts:
3 left
💡 Hint
Common Mistakes
Indexing fewer than three parameters.
Using incorrect keywords like 'payable' or 'memory'.