Skip to main content

solmail_program/
constants.rs

1/// Program constants and PDA seeds
2
3/// Oracle public key - the backend service that confirms deliveries
4#[cfg(not(feature = "test-oracle"))]
5pub const ORACLE_PUBKEY: [u8; 32] = [0u8; 32]; // TODO: Set actual oracle pubkey before deployment
6
7#[cfg(feature = "test-oracle")]
8pub const ORACLE_PUBKEY: [u8; 32] = [
9    193, 218, 116, 50, 245, 251, 7, 97, 24, 181, 84, 132, 197, 143, 16, 191,
10    165, 142, 75, 212, 244, 85, 169, 107, 234, 132, 53, 28, 67, 97, 249, 21,
11]; // E3itUEiaoNaZdygAjVGc7wRJDwi7nn39AkvcXtize8Fv
12
13/// USDC mint address on mainnet
14pub const USDC_MINT: [u8; 32] = [
15    198, 250, 122, 243, 190, 219, 173, 58, 61, 101, 243, 106, 171, 201, 116, 49,
16    177, 187, 228, 194, 210, 246, 224, 228, 124, 166, 2, 3, 69, 47, 93, 97,
17]; // EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v
18
19/// PDA Seeds
20pub const ESCROW_SEED: &[u8] = b"escrow";
21pub const ESCROW_VAULT_SEED: &[u8] = b"escrow_vault";
22pub const ESCROW_VAULT_USDC_SEED: &[u8] = b"escrow_vault_usdc";
23pub const CREDITS_SEED: &[u8] = b"credits";
24pub const CREDITS_VAULT_SOL_SEED: &[u8] = b"credits_vault_sol";
25pub const CREDITS_VAULT_USDC_SEED: &[u8] = b"credits_vault_usdc";
26pub const TREASURY_SEED: &[u8] = b"treasury";
27
28/// Default escrow timeout in seconds (7 days)
29pub const DEFAULT_TIMEOUT_SECONDS: i64 = 7 * 24 * 60 * 60;
30
31/// Minimum escrow amount in lamports (0.001 SOL)
32pub const MIN_ESCROW_LAMPORTS: u64 = 1_000_000;
33
34/// Minimum USDC amount (0.01 USDC = 10_000 with 6 decimals)
35pub const MIN_USDC_AMOUNT: u64 = 10_000;