Creating a vesting contract

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

The sender wallet needs to be the wallet connected to the UI

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

Once you have set up all the vesting schedules click Submit and approve the transaction in the pop-up.

Vesting seed

After approving the transaction a pop-up containing the vesting seed will appear. The vesting seed is the simply the address 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.