Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

VestingComponent

Vesting Component

A component for the controlled release of ERC-20 tokens to a designated beneficiary according to a predefined vesting schedule. The implementing contract is required to implement Ownable component, so that the owner of the contract is the vesting beneficiary. It also means that ownership rights to the contract and to the vesting allocation can be assigned and transferred.

Vesting schedule is specified through the VestingScheduleTrait implementation. This trait can be used to implement any custom vesting schedules.

Any assets transferred to this contract will follow the vesting schedule as if they were locked from the beginning. Consequently, if the vesting has already started, any amount of tokens sent to this contract may be immediately releasable.

By setting the duration to 0, one can configure this contract to behave like an asset timelock that holds tokens for a beneficiary until a specified time.

NOTE:

  • A separate contract with a Vesting component must be deployed for each beneficiary.
  • Can be used to vest multiple tokens to a single beneficiary, provided that the core vesting parameters (start, duration, and cliff_duration) are identical.
  • When using this contract with any token whose balance is adjusted automatically (i.e. a rebase token), make sure to account for the supply/balance adjustment in the vesting schedule to ensure the vested amount is as intended.

Fully qualified path: openzeppelin_finance::vesting::vesting::VestingComponent

Modules

Free functions

Structs

Storage
AmountReleasedEmitted when vested tokens are released to the beneficiary.
ComponentState

Enums

Event

Traits

VestingScheduleTraitA trait that defines the logic for calculating the vested amount based on a given timestamp.
HasComponent
InternalTrait
UnsafeNewContractStateTraitForVestingImpl