0
0
Blockchain / Solidityprogramming~30 mins

Event filtering in Blockchain / Solidity - Mini Project: Build & Apply

Choose your learning style9 modes available
Event Filtering in Blockchain
📋 What You'll Learn
💡 Why This Matters
🌍 Real World
Filtering blockchain events helps developers track specific user activities or transactions efficiently.
💼 Career
Blockchain developers often need to process and filter event logs to build user dashboards or analytics tools.
Progress0 / 4 steps
1
Create the event list
Create a list called events with these exact dictionaries: {'user': '0x123', 'action': 'deposit', 'amount': 100}, {'user': '0x456', 'action': 'withdraw', 'amount': 50}, {'user': '0x123', 'action': 'transfer', 'amount': 30}
Blockchain / Solidity
Need a hint?

Use a list with dictionaries exactly as shown.

2
Set the user address to filter
Create a variable called filter_user and set it to the string '0x123'
Blockchain / Solidity
Need a hint?

Set the variable exactly as shown.

3
Filter events by user address
Create a list called filtered_events using a list comprehension that includes only events where event['user'] == filter_user
Blockchain / Solidity
Need a hint?

Use a list comprehension with the condition event['user'] == filter_user.

4
Print the filtered events
Write a print statement to display the filtered_events list
Blockchain / Solidity
Need a hint?

Use print(filtered_events) to show the filtered list.