This repo contains a staking contract that allows users to create staking pools and stake tokens, all incorporating the new Token 20222 program!
Initializes a new staking pool. The pool is a pda with the address of the token mint that the pool is intended for and "state" as seeds.
Initializes an account to hold state about a user's stake position. PDA with the User's pubkey, mint of token, and "stake_entry" as seeds.
Transfers tokens from a User token account to the program token vault, where they are kept while staked.
Transfers tokens from the staking pool back to a user.
User can call this at any time.
Users can only unstake tokens that they have staked themselves.