ore_relayer_api/state/
escrow.rs

1use bytemuck::{Pod, Zeroable};
2use ore_utils::*;
3use solana_program::pubkey::Pubkey;
4
5use super::AccountDiscriminator;
6
7/// Escrow account
8#[repr(C)]
9#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
10pub struct Escrow {
11    /// The signer authorized to use this relay account.
12    pub authority: Pubkey,
13
14    /// The bump used for signing CPIs.
15    pub bump: u64,
16
17    /// The last hash this relayer has collected commission on.
18    pub last_hash: [u8; 32],
19
20    /// The last observed balance of the escrowed proof acount.
21    pub last_balance: u64,
22}
23
24impl Default for Escrow {
25    fn default() -> Self {
26        Escrow {
27            authority: Pubkey::new_from_array([0; 32]),
28            bump: 0,
29            last_hash: [0; 32],
30            last_balance: 0,
31        }
32    }
33}
34
35account!(AccountDiscriminator, Escrow);