sumasamurai / predictor-challenge

MIT License
3 stars 5 forks source link

Implementation of a reward Claim functionality for specific epochs #40

Open sumasamurai opened 11 months ago

sumasamurai commented 11 months ago

Implement functionality that allows users to claim rewards for specific epochs. To achieve this, you need to create a function with the following signature: function claimRewards(uint256[] calldata epochs) external; Steps for implementation:

  1. Create the claimRewards function with the epochs parameter.
  2. Within the function, verify if the user is eligible to claim rewards for the specified epochs.
  3. Distribute rewards to users for the specified epochs.
  4. Ensure proper error handling and data validation.
Lavishq commented 11 months ago

i think this is very bad design implementation to write the claimRewards(array)-

reasoning - taking epochs array which is inside of rounds mapping => Rounds.epoch (you wont be able to find all the epochs in efficient manner so i am doing it w/ just an epoch instead of an array pull over push method)

pull over push bc - it will leave no way to brick the contract via dos attack or gas greifs