This assignment implements an asset manager's vault on the Solana blockchain. The vault allows customers to deposit SPL tokens of their choice, while preventing the vault manager from withdrawing the deposited funds.
- Create a new vault
- Deposit SPL tokens into the vault
- Withdraw tokens from the vault (restricted to non-manager users)
- Support for multiple token types within a single vault
The main program logic is contained in lib.rs
and consists of the following key components:
create_vault
: Initializes a new vault for an asset managerdeposit_tokens
: Allows customers to deposit SPL tokens into the vaultwithdraw_tokens
: Enables withdrawal of tokens by non-manager usersVaultState
: Struct to store the vault's state, including asset manager, token mints, and balances