hapi_core/state/
network.rs

1use anchor_lang::prelude::*;
2
3#[account]
4pub struct Network {
5    /// Community account, which this network belongs to
6    pub community: Pubkey,
7
8    /// Seed bump for PDA
9    pub bump: u8,
10
11    /// Network name (i.e. ethereum, solana, near)
12    pub name: [u8; 32],
13
14    // Network address schema
15    pub schema: NetworkSchema,
16
17    /// Reward token mint account
18    pub reward_mint: Pubkey,
19
20    /// Reward signer PDA
21    pub reward_signer: Pubkey,
22
23    /// Seed bump for reward signer PDA
24    pub reward_signer_bump: u8,
25
26    /// Reward amount for tracers that report addresses to this network
27    pub address_tracer_reward: u64,
28
29    /// Reward amount for tracers and validators that confirm addresses on this network
30    pub address_confirmation_reward: u64,
31
32    /// Reward amount for tracers that report assets to this network
33    pub asset_tracer_reward: u64,
34
35    /// Reward amount for tracers and validators that confirm assets on this network
36    pub asset_confirmation_reward: u64,
37
38    /// Replication price amount
39    pub replication_price: u64,
40}
41
42#[derive(Clone, PartialEq, AnchorDeserialize, AnchorSerialize)]
43pub enum NetworkSchema {
44    Plain,
45    Solana,
46    Ethereum,
47    Bitcoin,
48    Near,
49}
50
51impl Default for NetworkSchema {
52    fn default() -> Self {
53        NetworkSchema::Plain
54    }
55}