Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add setMaxLockDuration function to add-veLON-impplementation #65

Open
wants to merge 10 commits into
base: add-veLON-implementation
Choose a base branch
from

Conversation

zeqing-guo
Copy link

Add setMaxLockDuration function to add-veLON-impplementation branch.

Given the correctness and fairness, the code guarantees that if old_power_A > old_power_B, then after updating the maxLockDuration we have new_power_A >= new_power_B.

Code details are as follows:

  • if NFT's lock.end > maxEndTime, we set the lock.end = maxEndTime. Then we update NFT's slope and bias
  • if NFT's lock.end <= maxEndTime, we update NFT's slope and bias directly

After updating every NFT's end, slope, and bias, we will update the global slope and bias.

@charlesjhongc
Copy link
Contributor

No particular issue at the first glance. However this function may consume lots of gas and perhaps exceed block limit? Need some test for gas consumption.

@charlesjhongc
Copy link
Contributor

This one can be closed since we decided to use fixed maxDuration instead.

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

Successfully merging this pull request may close these issues.

2 participants