Wrong number of tokens is locked when creating linear vesting

Hi all! I’m trying to create a test linear vesting on devnet. The problem I’ve encountered is:
I was trying to lock 10 millions of tokens, but the vesting account holds only 10504.2 tokens for some reason. Could someone help me out with the issue?

echo "RUST_BACKTRACE=1 ./target/debug/vesting-contract-cli      \
--url https://api.devnet.solana.com                             \
--program_id C8t9cmghkTUtchfBcoBcadZfACCZVQQSyicR7A9Gu343           \
create                     \
--mint_address 2jQASzMzbibSd7Jhnux7uKctH52WArFXRZggqUBrsnvm    \
--source_owner ~/.config/solana/id_owner.json                   \
--source_token_address BNifsenNya5mYTgw4WBTpB1SZGkuDjNrrxqTyqBxnxVy      \
--destination_token_address 4sF35mgykwm4yZfFQN79XCJKcvaCQDiY7kZJ9ggyYv46    \
--amounts 100000000,!                                                  \
--release-frequency 'PT1H'                                       \
--start-date-time '2022-01-09T15:30:05.000Z'                        \
--end-date-time '2022-01-10T15:18:05.000Z'                          \
--payer ~/.config/solana/id_owner.json"                         \
--verbose | bash

The seed of the contract is: 8opHzTAnfzRpPEx21XtnrVTX28YQuCpAjcn1PczScQ6
Please write it down as it is needed to interact with the contract!
The vesting account pubkey: 5NDxfu1iM23ty9oK92GWVYduiTbvAqq1gYaKMt5ZmEtv

You need to add the decimals in the amount of tokens you want to lock. In your case the token has 4 decimals. 100000000 actually means 10,000 (100000000 / 10**4) tokens in human readable amount.

The linear unlock feature was introduced by a community member recently some fixes to cli docs, made cli more robust, remove deprecated calls · Bonfida/token-vesting@2505e08 · GitHub

The logic he uses to compute the schedules contains a bug token-vesting/main.rs at master · Bonfida/token-vesting · GitHub this is why there is an extra 504.2.

Thanks for reporting it

1 Like

cli: fix linear vesting · Bonfida/token-vesting@6dea012 · GitHub should fix it

I was so unsure something will happen so fast that started debugging the code myself. Thank you for the prompt fix!

1 Like