Skip to main content

Linear Vesting Contract

The Linear Vesting contract locks tokens with a linear vesting schedule. The contract controls the release of tokens over time, ensuring that the recipient can only claim them gradually.

tip

Common use cases

  • Token compensation for employees, investors or ISPO delegators
  • DAO treasury token vesting
  • Installment payment plan

Contract API Endpoints

Maestro's API enables developers to integrate seamlessly with this contract using only the following 3 endpoints.

NameDescriptionEndpointState Transition
Lock AssetsLock asset into vesting contract and set vesting schedule/contracts/vesting/lockStart => Open
Collect AssetsCollect vested assets since last claim/contracts/vesting/collectOpen => Open
Vesting StateQuery the current state of the vesting contract/contracts/vesting/stateNone
note

Contract Auditor

Contract has been audited and is open-sourced here

info

Contract Fees

Linear Vesting has a 1% fee of vested assets going towards contract author Anastasia Labs

Step-by-Step Contract Interactions

1. Lock Tokens:

  • A predefined amount of tokens is sent to the smart contract. This is the total amount to be vested.
  • The start date (e.g., vestingPeriodStart) and end date (e.g., vestingPeriodEnd) of the vesting period are set.
  • The number of installments (e.g., totalInstallments) and first installment date (e.g., firstUnlockPossibleAfter) are set.
  • The beneficiary's address is specified, which is the only address that can claim the vested tokens.

2. Vesting Mechanism:

  • The contract calculates the total vesting duration, vestingPeriodLength = vestingPeriodEnd - vestingPeriodStart.
  • At any given time t, the amount of vested token is vestedTokens = (t - vestingPeriodStart) x totalVestingQty/ vestingPeriodLength.
  • If the beneficiary tries to claim tokens at time t, they receive the above amount of the total tokens, minus any tokens they've already claimed.
  • The amount of token remaining is remainingTokens = (vestingPeriodEnd - t) x totalVestingQty / vestingPeriodLength.

3. Claim Tokens:

  • The beneficiary can claim vested tokens at any point between vestingPeriodStart and vestingPeriodEnd. They don't have to claim them linearly; they might wait and claim a larger amount at once.
  • However, they can never claim more than the vested amount at time t.

4. Post-Vesting:

  • After the vestingPeriodEnd, the beneficiary can claim all remaining tokens in the smart contract.

Contract Off-chain Server

[🚧 IN PROGRESS 🚧 ]

Contract UI Widget

[🚧 IN PROGRESS 🚧 ]