Expand description
§tribewarez-vault
PTtC Vault and Escrow Program for Tribewarez DeFi.
This crate provides secure vault and escrow functionality for PTtC tokens on Solana. It enables time-locked vaults, conditional asset release, and treasury management with optional tensor network support for dynamic locktime reduction based on network conditions.
§Core Features
- Token Deposits: Securely deposit and hold PTtC tokens in vaults
- Time-Locked Withdrawals: Enforce minimum lock periods before withdrawal
- Escrow Services: Create conditional escrow agreements with release conditions
- Treasury Management: Centralized treasury for managing network assets
- Tensor-Aware Locks: v0.2.0 feature for dynamic locktime reduction based on network activity
- Multi-Signature Support: Allow multiple authorizers for critical operations
§Key Instructions
initialize_treasury: Set up the main treasury account (admin-only)create_vault: Create a time-locked vault for token depositsdeposit: Deposit tokens into a vaultwithdraw: Withdraw tokens after lock period expirescreate_escrow: Create a conditional escrow agreementrelease_escrow: Release escrowed assets when conditions are metextend_lock: Extend the locktime of an existing vault
§Events
This program emits events for vault creation, deposits, withdrawals, and escrow operations.
See the events module for detailed event documentation.
§Security Model
- Timestamps checked against Solana clock for temporal enforcement
- SPL Token program used for all token transfers via CPI
- Vault ownership validated before withdrawal
- Escrow conditions verified before release
Modules§
- accounts
- An Anchor generated module, providing a set of structs
mirroring the structs deriving
Accounts, where each field is aPubkey. This is useful for specifying accounts for a client. - events
- instruction
- An Anchor generated module containing the program’s set of
instructions, where each method handler in the
#[program]mod is associated with a struct defining the input arguments to the method. These should be used directly, when one wants to serialize Anchor instruction data, for example, when speciying instructions on a client. - program
- Module representing the program.
- services
- tribewarez_
vault - Tribewarez Vault Program Secure escrow and vault functionality for PTtC tokens. Supports deposits, withdrawals, time-locked vaults, and multi-sig operations.
Structs§
- Cancel
Escrow - Cancel
Escrow Bumps - Create
Escrow - Create
Escrow Bumps - Create
Vault - Create
Vault Bumps - Deposit
- Deposit
Bumps - Escrow
- Escrow account for conditional token release. Holds tokens until release conditions are met.
- Initialize
Treasury - Initialize
Treasury Bumps - Release
Escrow - Release
Escrow Bumps - Treasury
- Central treasury account managing all vaults and escrows. This is a singleton account created by the program authority.
- Update
Vault - Update
Vault Bumps - User
Vault - Individual user vault with time-locked token storage. Created when a user wants to deposit and lock tokens for a period.
- Withdraw
- Withdraw
Bumps
Enums§
Statics§
- ID
- The static program ID
Functions§
- check_
id - Confirms that a given pubkey is equivalent to the program ID
- entry
- The Anchor codegen exposes a programming model where a user defines
a set of methods inside of a
#[program]module in a way similar to writing RPC request handlers. The macro then generates a bunch of code wrapping these user defined methods into something that can be executed on Solana. - entrypoint⚠
- Safety
- id
- Returns the program ID