sol_cerberus/state/
app.rs1use anchor_lang::prelude::*;
2
3#[repr(u8)]
7pub enum AccountTypes {
8 Basic = 0,
9 Free = 1,
10}
11
12#[repr(u8)]
16pub enum CacheUpdated {
17 Roles = 0,
18 Rules = 1,
19}
20
21#[derive(AnchorSerialize, AnchorDeserialize, Default, Debug)]
22pub struct AppData {
23 pub id: Pubkey,
24 pub recovery: Option<Pubkey>,
25 pub name: String,
26 pub cached: bool,
27}
28
29#[derive(AnchorSerialize, AnchorDeserialize, Default, Debug)]
30pub struct UpdateAppData {
31 pub authority: Pubkey,
32 pub recovery: Option<Pubkey>,
33 pub name: String,
34 pub cached: bool,
35 pub fee: Option<u64>,
36 pub account_type: u8,
37 pub expires_at: Option<i64>,
38}
39
40#[account]
41pub struct App {
42 pub id: Pubkey,
43 pub authority: Pubkey,
44 pub recovery: Option<Pubkey>, pub bump: u8,
46 pub name: String,
47 pub roles_updated_at: i64,
48 pub rules_updated_at: i64,
49 pub cached: bool,
50 pub fee: Option<u64>,
51 pub account_type: u8,
52 pub expires_at: Option<i64>,
53}
54
55#[event]
56pub struct AppChanged {
57 pub time: i64,
58 #[index]
59 pub app_id: Pubkey,
60 pub authority: Pubkey,
61}
62
63#[account]
64pub struct Seed {
65 pub initialized: bool,
66}