1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#![deny(missing_docs)]
#![forbid(unsafe_code)]
pub mod borsh_utils;
mod entrypoint;
pub mod instruction;
pub mod processor;
pub mod state;
pub use solana_program;
use solana_program::{program_pack::Pack, pubkey::Pubkey};
solana_program::declare_id!("badkenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8kn");
pub(crate) fn get_mint_address_with_seed(feature_proposal_address: &Pubkey) -> (Pubkey, u8) {
Pubkey::find_program_address(&[&feature_proposal_address.to_bytes(), br"mint"], &id())
}
pub(crate) fn get_delivery_token_address_with_seed(
feature_proposal_address: &Pubkey,
) -> (Pubkey, u8) {
Pubkey::find_program_address(&[&feature_proposal_address.to_bytes(), br"delivery"], &id())
}
pub(crate) fn get_acceptance_token_address_with_seed(
feature_proposal_address: &Pubkey,
) -> (Pubkey, u8) {
Pubkey::find_program_address(
&[&feature_proposal_address.to_bytes(), br"acceptance"],
&id(),
)
}
pub(crate) fn get_feature_id_address_with_seed(feature_proposal_address: &Pubkey) -> (Pubkey, u8) {
Pubkey::find_program_address(
&[&feature_proposal_address.to_bytes(), br"feature-id"],
&id(),
)
}
pub fn get_mint_address(feature_proposal_address: &Pubkey) -> Pubkey {
get_mint_address_with_seed(feature_proposal_address).0
}
pub fn get_delivery_token_address(feature_proposal_address: &Pubkey) -> Pubkey {
get_delivery_token_address_with_seed(feature_proposal_address).0
}
pub fn get_acceptance_token_address(feature_proposal_address: &Pubkey) -> Pubkey {
get_acceptance_token_address_with_seed(feature_proposal_address).0
}
pub fn get_feature_id_address(feature_proposal_address: &Pubkey) -> Pubkey {
get_feature_id_address_with_seed(feature_proposal_address).0
}