1
1
#![ allow( clippy:: result_large_err) ]
2
-
3
2
use anchor_lang:: {
4
3
prelude:: * ,
5
- solana_program:: { program:: invoke, system_instruction, system_program} ,
4
+ solana_program:: { program:: invoke, pubkey :: Pubkey , system_instruction, system_program} ,
6
5
} ;
7
6
use anchor_spl:: { associated_token:: AssociatedToken , token_interface:: TokenInterface } ;
8
7
use mpl_token_metadata:: types:: TokenStandard ;
9
- use solana_program:: pubkey;
10
8
use std:: slice:: Iter ;
11
9
use tensor_vipers:: prelude:: * ;
12
10
@@ -19,11 +17,15 @@ pub const TNSR_DISCOUNT_BPS: u64 = 2500;
19
17
pub const TAKER_FEE_BPS : u64 = 200 ;
20
18
pub const MAKER_BROKER_PCT : u64 = 80 ; // Out of 100
21
19
20
+ pub const fn pubkey ( base58str : & str ) -> Pubkey {
21
+ Pubkey :: new_from_array ( five8_const:: decode_32_const ( base58str) )
22
+ }
23
+
22
24
pub mod escrow {
23
25
use super :: * ;
24
26
declare_id ! ( "TSWAPaqyCSx2KABk68Shruf4rp7CxcNi8hAsbdwmHbN" ) ;
25
27
26
- pub const TSWAP_SINGLETON : Pubkey = pubkey ! ( "4zdNGgAtFsW1cQgHqkiWyRsxaAgxrSRRynnuunxzjxue" ) ;
28
+ pub const TSWAP_SINGLETON : Pubkey = pubkey ( "4zdNGgAtFsW1cQgHqkiWyRsxaAgxrSRRynnuunxzjxue" ) ;
27
29
}
28
30
29
31
pub mod fees {
@@ -35,7 +37,7 @@ pub mod marketplace {
35
37
use super :: * ;
36
38
declare_id ! ( "TCMPhJdwDryooaGtiocG1u3xcYbRpiJzb283XfCZsDp" ) ;
37
39
38
- pub const TCOMP_SINGLETON : Pubkey = pubkey ! ( "q4s8z5dRAt2fKC2tLthBPatakZRXPMx1LfacckSXd4f" ) ;
40
+ pub const TCOMP_SINGLETON : Pubkey = pubkey ( "q4s8z5dRAt2fKC2tLthBPatakZRXPMx1LfacckSXd4f" ) ;
39
41
}
40
42
41
43
pub mod mpl_token_auth_rules {
@@ -47,7 +49,7 @@ pub mod price_lock {
47
49
use super :: * ;
48
50
declare_id ! ( "TLoCKic2wGJm7VhZKumih4Lc35fUhYqVMgA4j389Buk" ) ;
49
51
50
- pub const TLOCK_SINGLETON : Pubkey = pubkey ! ( "CdXA5Vpg4hqvsmLSKC2cygnJVvsQTrDrrn428nAZQaKz" ) ;
52
+ pub const TLOCK_SINGLETON : Pubkey = pubkey ( "CdXA5Vpg4hqvsmLSKC2cygnJVvsQTrDrrn428nAZQaKz" ) ;
51
53
}
52
54
53
55
/// Calculates fee vault shard from a given AccountInfo or Pubkey. Relies on the Anchor `Key` trait.
0 commit comments