shapeshift / lib

MIT License
22 stars 54 forks source link

investor-foxy: Wrong releaseTime #921

Open gomesalexandre opened 2 years ago

gomesalexandre commented 2 years ago

Overview

Taking over https://github.com/shapeshift/web/issues/2103

Currently in investor-foxy, getTimeUntilClaimable sometimes returns a wrong releaseTime:

https://github.com/shapeshift/lib/blob/d8e9491743d26e19192d6a0a2e2ef6ad9e03e6cb/packages/investor-foxy/src/api/api.ts#L985

The high-level reason for that is investor-foxy mimics the FOXy contract methods / state and has potential for a wrong reconciliation.

We should fix it so that getTimeUntilClaimable returns us the correct release time, making sure we don't disable the claim button when claims are actually available.

References and additional details

https://github.com/shapeshift/web/issues/2103 https://github.com/shapeshift/lib/blob/d8e9491743d26e19192d6a0a2e2ef6ad9e03e6cb/packages/investor-foxy/src/api/api.ts#L985

Acceptance Criteria

Need By Date

No response

Screenshots/Mockups

No response

Estimated effort

No response

gomesalexandre commented 2 years ago

@NeOMakinG Assigning you so you can add some context to this

toshiSat commented 2 years ago

We need to figure out the timeframe this is happening. I'm suspecting that a current rebase is pending, which would block the user from being able to claim. In V2 I added a rebase before the user claims on the claimWithdraw function. One way we could solve this is adding a rebase to the gelato bot if this is the reason. We really need more information to help debug this. When a user reports this we need their address so we can check the coolDownInfo and see what epoch their claim should be. If the epoch is correct then it is a problem in lib, but if not then adding a call to rebase on the gelato bot will fix this.

0xdef1cafe commented 2 years ago

@toshiSat you want this as a bounty?

toshiSat commented 2 years ago

I am finishing up 3 projects right now and am taking a much needed vacation. If this is still open after my break I can pick it up as a bounty. We will need to look into someones address that this is currently happening. I don't see how this could be wallet related as the description suggests.