Staking Mechanism Simulation
📖 Scenario: You are building a simple simulation of a staking mechanism for a blockchain project. Users can stake tokens, and the system will calculate rewards based on the amount staked and a reward rate.
🎯 Goal: Create a program that stores user stakes, sets a reward rate, calculates rewards for each user, and then displays the rewards.
📋 What You'll Learn
Create a dictionary to hold user stakes with exact user names and stake amounts
Create a variable for the reward rate as a decimal
Use a dictionary comprehension to calculate rewards for each user based on their stake and the reward rate
Print the rewards dictionary showing each user and their reward
💡 Why This Matters
🌍 Real World
Staking is a common way in blockchain projects to encourage users to hold tokens and secure the network while earning rewards.
💼 Career
Understanding staking mechanisms is important for blockchain developers and engineers working on decentralized finance (DeFi) platforms.
Progress0 / 4 steps