hapi_core/state/
address.rs

1use anchor_lang::prelude::*;
2
3#[account]
4pub struct Address {
5    /// Community account, which this address belongs to
6    pub community: Pubkey,
7
8    /// Network account, which this address belongs to
9    pub network: Pubkey,
10
11    /// Actual address public key
12    pub address: [u8; 64],
13
14    /// Seed bump for PDA
15    pub bump: u8,
16
17    /// ID of the associated case
18    pub case_id: u64,
19
20    /// Reporter account public key
21    pub reporter: Pubkey,
22
23    /// Category of illicit activity identified with this address
24    pub category: Category,
25
26    /// Address risk score 0..10 (0 is safe, 10 is maximum risk)
27    pub risk: u8,
28
29    /// Confirmation count for this address
30    pub confirmations: u8,
31
32    /// Accumulated payment amount for report
33    pub replication_bounty: u64,
34}
35
36#[derive(Clone, PartialEq, AnchorDeserialize, AnchorSerialize)]
37pub enum Category {
38    // Tier 0
39    /// None
40    None = 0,
41
42    // Tier 1 - Low risk
43    /// Wallet service - custodial or mixed wallets
44    WalletService,
45
46    /// Merchant service
47    MerchantService,
48
49    /// Mining pool
50    MiningPool,
51
52    // Tier 2 - Medium risk
53    /// Exchange
54    Exchange,
55
56    /// DeFi application
57    DeFi,
58
59    /// OTC Broker
60    OTCBroker,
61
62    /// Cryptocurrency ATM
63    ATM,
64
65    /// Gambling
66    Gambling,
67
68    // Tier 3 - High risk
69    /// Illicit organization
70    IllicitOrganization,
71
72    /// Mixer
73    Mixer,
74
75    /// Darknet market or service
76    DarknetService,
77
78    /// Scam
79    Scam,
80
81    /// Ransomware
82    Ransomware,
83
84    /// Theft - stolen funds
85    Theft,
86
87    /// Counterfeit - fake assets
88    Counterfeit,
89
90    // Tier 4 - Severe risk
91    /// Terrorist financing
92    TerroristFinancing,
93
94    /// Sanctions
95    Sanctions,
96
97    /// Child abuse and porn materials
98    ChildAbuse,
99}
100
101impl Default for Category {
102    fn default() -> Self {
103        Category::None
104    }
105}