C
C
Community Help Center
English
Search
⌃K

Creating a vesting contract

Creating a vesting contract can be made through the Rust CLI or JS client:
In order to create a vesting contract you need the following:
  • The mint of the SPL token you want to vest
  • The token address that will deposit the tokens in the smart contract (the sender)
  • The token address of the receiver
  • The vesting schedules

Addresses

A token address is not a SOL address
Let's take the following example with sender and receiver and FIDA as the token being vested
Wallet
SOL Address
FIDA Address
sender
3riY7qahCV9pcK7UD78Mv2tYXExizPmKsQJEL7bMdjH3
7nY6YiULjLLrmjmbqChPzbEd7ZRHY5WDWcmxroFrM9XL
receiver
9J8UiDaU81Nno1L7oB5Uuv8bqWFcDUQN6EpixS6aW75Y
EktiMG5XdvgXfzv6hGfgCDGxMqB4zX8ZUXcAvrQYquuq
Token Name
Token Mint
FIDA
EchesyfXePKdLtoiZSL8pBe8Myagyy8ZRqsACNCFGnvp
In this example:
  • The mint is: EchesyfXePKdLtoiZSL8pBe8Myagyy8ZRqsACNCFGnvp
  • The token address of the sender: 7nY6YiULjLLrmjmbqChPzbEd7ZRHY5WDWcmxroFrM9XL
  • The token address of the receiver: EktiMG5XdvgXfzv6hGfgCDGxMqB4zX8ZUXcAvrQYquuq
You can use the Solana Explorer to find this information
Use associated token account

Schedules

A schedule is a made of a date and an amount of token to unlock, for example let''s say you want the received to receive 1,000 FIDA on 01/01/2022 and 2,000 on 01/02/2022
There is no limit on how many schedules you can use

Vesting seed

After approving the transaction a pop-up containing the vesting seed will appear. The vesting seed is the simply the seed of the public key of the vesting contract. Only the receiver will be able to interact with this token vesting contract.
The vesting seed is safe to share
Make sure to save the vesting seed and send it to the receiver of the vested tokens.