Skip to content

Conversation

@Detoo
Copy link

@Detoo Detoo commented Dec 17, 2025

TODO

  • updateVestingStartTime()
  • updateUnlockStartTime()

Added

  • MetavestController.recipientOverride: Overrides all downstream metavest vaults's recipient addresses. Set by authority only
  • BaseAllocation.desiredRecipient: Specifies desired recipient of the tokens. Set by grantee only
  • Update start times
    • MetavestController.updateMetavestVestingStartTime()
    • MetavestController.updateMetavestUnlockStartTime()
    • BaseAllocation.updateVestingStartTime()
    • BaseAllocation.updateUnlockStartTime()
    • rules:
// It is not allowed to update start time if it has already passed, because
// the contract treats unlock tokens as permanent and therefore would not allow any change to the start time,
// which would change the number of unlock token at that very moment.
  • Corresponding tests

Updated

  • Add recipient fields to related events
  • Compiler version

@Detoo Detoo requested a review from merisman December 17, 2025 23:11
Copy link
Contributor

@merisman merisman left a comment

Choose a reason for hiding this comment

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

I know we aren't planning to use token options anytime soon, but I don't want this to slip through the cracks. The grantee will call, but the erc-20 transfer occurs on the set recipient, which would take some extra coordination for Approvals. Should we take the payment from the grantee, as they are making the call? I could see both ways being viable option, one is just complicated to organize the approval from a front end.
function exerciseTokenOption(uint256 _tokensToExercise) external nonReentrant onlyGrantee {
if(block.timestamp>shortStopTime && terminated) revert MetaVest_ShortStopDatePassed();
if (_tokensToExercise == 0) revert MetaVesT_ZeroAmount();
if (_tokensToExercise > getAmountExercisable()) revert MetaVesT_MoreThanAvailable();

    // Calculate paymentAmount
    uint256 paymentAmount = getPaymentAmount(_tokensToExercise);
    if(paymentAmount == 0) revert MetaVesT_TooSmallAmount();

    address recipient = getRecipient();
    safeTransferFrom(paymentToken, recipient, getAuthority(), paymentAmount);
    tokensExercised += _tokensToExercise;
    emit MetaVesT_TokenOptionExercised(grantee, recipient, _tokensToExercise, paymentAmount);
}

@Detoo
Copy link
Author

Detoo commented Dec 18, 2025

Should we take the payment from the grantee, as they are making the call?

yeah good point, I think so too. It's simpler to have the grantee address approve and send the payment so all interactions are coming from there. This way the recipient address could stay gas-less and passive as well.

Will do and add tests accordingly

@Detoo Detoo force-pushed the feat/abstract-beta branch from 8f7a282 to c2b87d7 Compare December 18, 2025 18:14
@Detoo
Copy link
Author

Detoo commented Dec 18, 2025

Done. And I just realized it makes no sense to report recipient when exercising because the token hasn't be withdrawn yet, so I removed it from the event (basically restored to where it was)
c2b87d7#diff-d28d9fb87a4a5f2f29d321e2469c6a5542c118f0d17f620485e3b7515441f7e5L15

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.

3 participants