Skip to main content

Crate tribewarez_vault

Crate tribewarez_vault 

Source
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 deposits
  • deposit: Deposit tokens into a vault
  • withdraw: Withdraw tokens after lock period expires
  • create_escrow: Create a conditional escrow agreement
  • release_escrow: Release escrowed assets when conditions are met
  • extend_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 a Pubkey. 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§

CancelEscrow
CancelEscrowBumps
CreateEscrow
CreateEscrowBumps
CreateVault
CreateVaultBumps
Deposit
DepositBumps
Escrow
Escrow account for conditional token release. Holds tokens until release conditions are met.
InitializeTreasury
InitializeTreasuryBumps
ReleaseEscrow
ReleaseEscrowBumps
Treasury
Central treasury account managing all vaults and escrows. This is a singleton account created by the program authority.
UpdateVault
UpdateVaultBumps
UserVault
Individual user vault with time-locked token storage. Created when a user wants to deposit and lock tokens for a period.
Withdraw
WithdrawBumps

Enums§

VaultError

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