Skip to content

feat: add XanV2#104

Open
heueristik wants to merge 6 commits into
mainfrom
feature/unlock
Open

feat: add XanV2#104
heueristik wants to merge 6 commits into
mainfrom
feature/unlock

Conversation

@heueristik

@heueristik heueristik commented Jun 25, 2026

Copy link
Copy Markdown
Collaborator
  • adds unlock, vesting, ERC20Votes, Ownable
  • removes ERC20Burnable

@heueristik heueristik force-pushed the feature/unlock branch 11 times, most recently from 50c91fb to 458b696 Compare June 26, 2026 14:34
@heueristik heueristik changed the title feat: add unlock, vesting, and ERC20Votes feat: add unlock, vesting, ERC20Votes, Ownable, and remove ERC20Burnable Jun 26, 2026
@heueristik heueristik changed the title feat: add unlock, vesting, ERC20Votes, Ownable, and remove ERC20Burnable feat: add XanV2 Jun 26, 2026
@heueristik heueristik force-pushed the feature/unlock branch 3 times, most recently from c2e327c to 0f825aa Compare June 26, 2026 23:06
Comment thread script/UpgradeToXanV2.s.sol Outdated

// 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, ())});

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can the address for implV2 be address(0)? I don't think so. So, add a require statement to check that.

Comment thread script/UpgradeToXanV2.s.sol Outdated
Comment on lines +15 to +17
(address implV2, uint48 endTime) = XanV1(proxy).scheduledCouncilUpgrade();

require(endTime <= Time.timestamp(), XanV1.DelayPeriodNotEnded({endTime: endTime}));

@jonaprieto jonaprieto Jun 29, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/interfaces/IXanV2.sol Outdated
/// @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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets use account for consistency, same for lockedBalanceOf

Comment thread src/XanV2.sol
require(initialOwner != address(0), ZeroOwnerNotAllowed());
_INITIAL_OWNER = initialOwner;
_VESTING_START = vestingStartTimestamp;
_VESTING_DURATION = vestingDuration;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

check the duration is not zero

Comment thread src/XanV2.sol
if (elapsed > _VESTING_DURATION - 1) {
return vested = principal;
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

_VESTING_DURATION is greather than zero,

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants