Skip to content

Conversation

@jalextowle
Copy link
Contributor

This is the first of several voting vaults that we're going to add to Council. This one allows HD to be linearly vested over a three month timespan.

uint256 hdAmount = amount * conversionMultiplier;

// Pull the HD tokens from the source.
if (!token.transferFrom(hdTreasury, address(this), hdAmount)) {
Copy link

Choose a reason for hiding this comment

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

what happens to the extra tokens pulled from treasury if someone withdraws early?

Copy link

Choose a reason for hiding this comment

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

hmm actually, they should just continue vesting. sorry, just thinking outloud

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No worries, thinking out loud is good

ELFI.approve(address(vault), amount);
vm.expectEmit(true, true, true, true);
emit Transfer(alice, address(vault), amount);
vault.migrate(amount, bob);
Copy link

Choose a reason for hiding this comment

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

I'm probably not seeing something here, but shouldn't you do the vm.roll(halfwayBlock) first then call migrate()? That would fit the description of the test better.

ELFI.approve(address(vault), amount);
vm.expectEmit(true, true, true, true);
emit Transfer(alice, address(vault), amount);
vault.migrate(amount, bob);
Copy link

Choose a reason for hiding this comment

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

Same question here. Probably on me, but it seems like you'd want to do vm.roll(vault.globalExpiration()) before calling migrate() to verify that if someone migrates after expiration, then they can claim all the HD immediately

Copy link

@Sean329 Sean329 left a comment

Choose a reason for hiding this comment

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

Looks good and my comments are resolved. Approved once Jonny's comments are resolved.

@jalextowle jalextowle merged commit 8423f8f into main Feb 25, 2025
0 of 2 checks passed
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.

4 participants