White-Whale-Defi-Platform/white-whale-core

Impossible to claim rewards on first epoch if bonding occurs before epoch creation

Opened this issue · 0 comments

If you want to report a security issue, please follow our security policy: https://github.com/White-Whale-Defi-Platform/migaloo-core/blob/main/SECURITY.md


Steps to Reproduce

  1. Execute X transaction on the vault contract
  2. ...
  3. ...

Expected results:

Actual results:

There's an edge case that prevents users from claiming rewards from the first epoch if they bond before said epoch is created.

This might have to do with how the weight is calculated.

How to reproduce:

  1. Deploy liquidity hub
  2. Bond assets to whale lair
  3. Set the genesis epoch to start in the future
  4. Create the first epoch when the time comes
  5. Try to claim with the account that bonded before

Expected:
Claim successful

Actual:
Can't claim


Additional context

Add any other context about the problem here, code snippets, json responses and so on.

Code sample
Logs