Skip to main content
Vesting holds the team slice of STK and releases it linearly after a cliff to one beneficiary. The deploy script funds it once; after fund the schedule, the beneficiary, and the total cannot change. release is permissionless and always pays the beneficiary, so anyone can push a release and nobody can redirect it. Nothing vests before start + cliff. After the cliff, the vested amount is linear from start, so the first release catches up to the schedule. Vesting lets you:
  • Fund the vest once with the team allocation
  • Release vested STK to the beneficiary at any time
  • Read the schedule and the amount vested at a timestamp
This contract is not deployed on a listed network yet. Watch Addresses. The source code is src/token/Vesting.sol on GitHub. The ABI is /abis/Vesting.json.

Write methods

fund

Pulls amount STK from the caller and locks the schedule. Callable once. Reverts with AlreadyFunded on a second call and ZeroAmount for 0.
One shot. The caller must approve Vesting for amount first.
Input parameters

release

Sends every unit vested since the last release to the beneficiary. Permissionless. Reverts with NotFunded before fund and ZeroAmount when nothing new has vested.

Read methods

vested

Returns the total STK vested at ts: zero before start + cliff, total at or after start + duration, and linear from start between. Input parameters Return values

Events

Funded

Fires once when the vest is funded.

Released

Fires on every release with the beneficiary and amount.

Errors

ZeroAddress

The token or beneficiary was zero at deployment.

ZeroAmount

fund got 0, or release found nothing new to pay.

InvalidSchedule

Duration was 0 or the cliff was longer than the duration.

AlreadyFunded

fund was called twice.

NotFunded

release was called before fund.