tokenlon-contracts
tokenlon-contracts copied to clipboard
Add `setMaxLockDuration` function to `add-veLON-impplementation`
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 thelock.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.
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.
This one can be closed since we decided to use fixed maxDuration instead.