The calculateReward
function in the MiniByte
contract computes the total reward for a specified user based on their registered power grants. It checks if the user is registered, iterates through their power grants to calculate the reward based on the duration of each grant, and returns the total accumulated reward.
userAddr
(address
): The Ethereum address of the user for whom the reward is being calculated.uint256
: The total reward calculated for the user, returned as a uint256
value.