Skip to content

[Bug]: claimRewards() is always sending 0 DIP rewards and resets user's rewardsBalance when called before unstake() #2

Description

@rapidddenis

What happened?

Steps to reproduce:

  1. Create fresh risk bundle and stake some USDT.
    https://mumbai.polygonscan.com/tx/0xe0535fb6ec7782dceb8a488675425b40a97901a5bbd7eeed23eb5f4c5b2f48c0
  2. Stake some DIP into this bundle.
    https://mumbai.polygonscan.com/tx/0x036d950af16481c409ba7a3b168df5a3623d66ee072df4b9c7e9fd89dac721af
  3. Wait while some DIP rewards are accumulated.
  4. Claim rewards
    Expected behaviour: DIP transferred >= "Accumulated Rewards" value in staking UI
    Actual behaviour: DIP transferred = 0, "Accumulated Rewards" resets to 0.
    First claim:

Screenshot 2023-04-01 at 9 53 58

https://mumbai.polygonscan.com/tx/0x3626d3b0f1c9aeba6f724259a9fbd9a8d69cfc9d91f869957f9164e86e765af3

Second claim:
Screenshot 2023-04-01 at 10 05 36

https://mumbai.polygonscan.com/tx/0xff684a1b10c60e4e3ec3a9335598314b4e50cd186cc47973fb46b92e29f88402

  1. Close risk bundle
    https://mumbai.polygonscan.com/tx/0x2160d9fc129a9f40f0b9ab94bd33e02c889873a440d8227c6cbdb2b4172f5d05

  2. Unstake DIP without claiming rewards.
    https://mumbai.polygonscan.com/tx/0xd6633cce0acf2c401ea9fd14db999750dd307de9453c7575c69e313481ae4be6

  3. Claim rewards. This time DIP transferred > 0 but value is smaller than first and second claims combined.
    https://mumbai.polygonscan.com/tx/0x0763820d43e80609555ea51643a5e1b5a80b7f5c235d8f1485e652a55651da67

What operating system are you seeing the problem on?

Mac OS

What browsers are you seeing the problem on?

Safari

What wallet extension are you using?

Metamask

Rules

  • I agree to follow this project's rules

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions