Prevent late lockers from having to claim many weeks of zero-value distributions #1218
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
We currently have a concept of a
tokenStartTime
so that the contract knows from when users should attempt to claim a particular token if they haven't interacted with it before. This means that if we add a new token to be distributed then people don't have to make zero-value claims all the way from_startTime
in order to sync the contract up to the current week.However the issue is we need the same concept for users (
userStartTime
), otherwise if someone were to lock veBAL in 2 years time and want to claim BAL tokens then they would have to go through all previous BAL distributions whilst we know that they won't receive any fees from before their first lock.We then save the timestamp of the first week which the user would be eligible for a distribution and when first claiming a token we can fast forward to this week.