marsh_api/state/
treasury.rs

1use bytemuck::{Pod, Zeroable};
2use marsh_utils::*;
3use solana_program::pubkey::Pubkey;
4
5use crate::consts::TREASURY;
6
7use super::MarshAccount;
8
9/// Treasury is a singleton account which is the mint authority for the MARSH token and the authority of
10/// the program's global token account.
11#[repr(C)]
12#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
13pub struct Treasury {}
14
15/// Derive the PDA of the treasury account.
16pub fn treasury_pda() -> (Pubkey, u8) {
17    Pubkey::find_program_address(&[TREASURY], &crate::id())
18}
19
20account!(MarshAccount, Treasury);