feat: add XanV2#104
Open
heueristik wants to merge 6 commits into
Open
Conversation
50c91fb to
458b696
Compare
c2e327c to
0f825aa
Compare
0f825aa to
847475c
Compare
jonaprieto
reviewed
Jun 29, 2026
|
|
||
| // The owner and vesting start are baked into `implV2` at deployment (see `ScheduleCouncilUpgradeToXanV2`), | ||
| // so `reinitializeFromV1` takes no arguments and executing this upgrade cannot influence them. | ||
| UnsafeUpgrades.upgradeProxy({proxy: proxy, newImpl: implV2, data: abi.encodeCall(XanV2.reinitializeFromV1, ())}); |
There was a problem hiding this comment.
Can the address for implV2 be address(0)? I don't think so. So, add a require statement to check that.
jonaprieto
reviewed
Jun 29, 2026
Comment on lines
+15
to
+17
| (address implV2, uint48 endTime) = XanV1(proxy).scheduledCouncilUpgrade(); | ||
|
|
||
| require(endTime <= Time.timestamp(), XanV1.DelayPeriodNotEnded({endTime: endTime})); |
There was a problem hiding this comment.
Can the endTime be zero? I mean, if there is a remote possibility that happend, the next require's cond. would hold true, just to be aware.
jonaprieto
reviewed
Jun 29, 2026
| /// @notice Returns the unlocked (spendable) token balance of an account. | ||
| /// @param from The account to query. | ||
| /// @return unlockedBalance The unlocked balance. | ||
| function unlockedBalanceOf(address from) external view returns (uint256 unlockedBalance); |
There was a problem hiding this comment.
lets use account for consistency, same for lockedBalanceOf
jonaprieto
reviewed
Jun 29, 2026
| require(initialOwner != address(0), ZeroOwnerNotAllowed()); | ||
| _INITIAL_OWNER = initialOwner; | ||
| _VESTING_START = vestingStartTimestamp; | ||
| _VESTING_DURATION = vestingDuration; |
jonaprieto
reviewed
Jun 29, 2026
| if (elapsed > _VESTING_DURATION - 1) { | ||
| return vested = principal; | ||
| } | ||
|
|
There was a problem hiding this comment.
_VESTING_DURATION is greather than zero,
829f234 to
ae1f266
Compare
ae1f266 to
dea0a01
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Uh oh!
There was an error while loading. Please reload this page.