-
Notifications
You must be signed in to change notification settings - Fork 0
Migration Vesting Vault #1
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
Migration Vesting Vault #1
Conversation
| uint256 hdAmount = amount * conversionMultiplier; | ||
|
|
||
| // Pull the HD tokens from the source. | ||
| if (!token.transferFrom(hdTreasury, address(this), hdAmount)) { |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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
Sean329
left a comment
There was a problem hiding this 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.
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.