Linear Vesting Contract

Hello,
I’m trying to create a vesting contract but I see that from the code --amounts 2000000000000,!
I see that only 2000 tokens are locked.
Does the token has 9 decimals? I saw the other comment on forum that the token has 4 decimals.
Therefore, I locked the wrong amount of token.
Can I get this token back?
My vesting period is starting in next 6 months.

Also, if I want to lock 200,000,000 tokens, I believe I have to put --amounts 200000000000000000,!
but I am getting

thread 'main' panicked at 'attempt to multiply with overflow', src/main.rs:572:28
stack backtrace:
   0: rust_begin_unwind
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/std/src/panicking.rs:498:5
   1: core::panicking::panic_fmt
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:107:14
   2: core::panicking::panic
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/panicking.rs:48:5
   3: vesting_contract_cli::main
             at ./src/main.rs:572:28
   4: core::ops::function::FnOnce::call_once
             at /rustc/db9d1b20bba1968c1ec1fc49616d4742c1725b4b/library/core/src/ops/function.rs:227:5

Here is the code I used to create the linear vesting contract

echo "RUST_BACKTRACE=1 ./target/debug/vesting-contract-cli      \
--url https://api.mainnet-beta.solana.com/                             \
--program_id $                                        \
create                                                          \
--mint_address $                                            \
--source_owner ~/.config/solana/sourceowner.json                   \
--source_token_address $                    \
--destination_token_address $                 \
--amounts 200000000000000000,!                                                  \
--release-frequency 'P1M'                                       \
--start-date-time '2022-03-01T12:00:00-05:00'                        \
--end-date-time '2024-03-01T12:00:00-05:00'                          \
--payer ~/.config/solana/payer.json"                         \
--verbose | bash

You have not specified the token you are talking about so I cannot confirm the number of decimals it has.

The amount you need to specify in the CLI is a raw token account i.e you need to specify the decimals. If the token has 9 decimals and you want to lock 1 token you will have to pass 1 * Math.pow(10, 9)

In Rust the max u64 is 18446744073709551615 which is greater than 200,000,000 * Math.pow(10, 9) so it should not overflow

Here is the token address that I am trying to vest on devnet: CcyqgRfg3SzAB2FXbjY61RvWWsfU5GuYvj7HrtKgEcDN This has 9 decimals. I am creating a linear vesting contract where I want to linearly distribute 20,000,000 tokens across two years. I believe since 20,000,000 * Math.pow(10,9) = 2,000,00,000,000,000,000 which I am putting into the command

echo "RUST_BACKTRACE=1 ./target/debug/vesting-contract-cli      \
--url https://api.mainnet-beta.solana.com/                             \
--program_id $                                        \
create                                                          \
--mint_address $                                            \
--source_owner ~/.config/solana/sourceowner.json                   \
--source_token_address $                    \
--destination_token_address $                 \
--amounts 200000000000000000,!                                                  \
--release-frequency 'P1M'                                       \
--start-date-time '2022-03-01T12:00:00-05:00'                        \
--end-date-time '2024-03-01T12:00:00-05:00'                          \
--payer ~/.config/solana/payer.json"                         \
--verbose | bash

But, I am being faced with the same error message

'attempt to multiply with overflow' 

The issue is coming from the multiplication by the release frequency (in s). This commit should fix it https://github.com/Bonfida/token-vesting/commit/c92b4d1b9a2349407da4e79611d0b6657700133d

Try again and let me know!

Thanks! I think it is working now.
For the live vesting contract, do we have a cli that we can cancel the vesting contract?
Since I put the wrong amount in previous vesting contract, I would like to remove it.

You cannot revoke a vesting contract