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
Let's take the following example with
receiverand FIDA as the token being vested
In this example:
- The mint is:
- The token address of the sender:
- The token address of the receiver:
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
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.
Make sure to save the vesting seed and send it to the receiver of the vested tokens.