This repository contains the smart contract and client-side tools for creating and staking tokens in a staking vault.
-
Create Token:
spl-token create-token --decimals
-
Create Token Account:
spl-token create-account <token>
-
Mint Tokens:
spl-token mint <token>
-
Admin Key Pair:
- Add your key pair public key as the controller of the vault generation in the contract.
-
Reward Mint:
- Add the token that the contract holds and gives as a reward.
-
Compile:
cargo build-bpf
-
Deploy Contract:
solana program deploy /ft_staking/ft_stake_contract/target/deploy/staking.so
-
Edit and Compile Client Side:
- Change the
program_id. - Change the
reward_mint.
- Change the
-
Vault Generation (Client Side):
a. Generate Vault Address (with Admin Key Pair):
bash staking-tokens-client generate_vault_address -e dev -s <keypair.json> --min_lock_period <seconds>b. Stake Tokens:
bash staking-tokens-client stake -s <keypair.json> -e dev -a <token-amount> -l 2c. Unstake Tokens:
bash staking-tokens-client unstake -s <keypair.json> -e dev
Note: Replace placeholders such as <token>, <keypair.json>, <token-amount>, etc., with actual values.