Skip to content

Commit 68c6bfc

Browse files
committed
add const keys
1 parent 63cd598 commit 68c6bfc

File tree

5 files changed

+50
-2
lines changed

5 files changed

+50
-2
lines changed

Cargo.lock

Lines changed: 24 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,6 @@ edition = "2021"
1212
# In general, keep default-features = false in workspace
1313
# and enable individual features in indiv crates
1414
borsh = { version = "^1", default-features = false }
15+
const-crypto = { version = "^0.3", default-features = false }
1516

1617
# workspace members

core/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[package]
2-
name = "sanctum-solido-legacy-core"
2+
name = "solido-legacy-core"
33
version = "0.1.0"
44
edition.workspace = true
55

66
[dependencies]
77
borsh = { workspace = true, features = ["derive"] }
8+
const-crypto = { workspace = true }

core/src/keys.rs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
use const_crypto::{bs58, ed25519::derive_program_address};
2+
3+
pub const PROGRAM_ID_STR: &str = "CrX7kMhLC3cSsXJdT7JDgqrRVWGnUpX3gfEfxxU2NVLi";
4+
pub const PROGRAM_ID: [u8; 32] = bs58::decode_pubkey(PROGRAM_ID_STR);
5+
6+
pub const LIDO_STATE_ADDR_STR: &str = "49Yi1TKkNyYjPAFdR9LBvoHcUjuPX4Df5T5yv39w2XTn";
7+
pub const LIDO_STATE_ADDR: [u8; 32] = bs58::decode_pubkey(LIDO_STATE_ADDR_STR);
8+
9+
pub const VALIDATOR_LIST_ADDR_STR: &str = "GL9kqRNUTUosW3RsDoXHCuXUZn73SgQQmBvtp1ng2co4";
10+
pub const VALIDATOR_LIST_ADDR: [u8; 32] = bs58::decode_pubkey(VALIDATOR_LIST_ADDR_STR);
11+
12+
pub const STSOL_MINT_ADDR_STR: &str = "7dHbWXmci3dT8UFYWYZweBLXgycu7Y3iL6trKn1Y7ARj";
13+
pub const STSOL_MINT_ADDR: [u8; 32] = bs58::decode_pubkey(STSOL_MINT_ADDR_STR);
14+
15+
const STAKE_AUTH_PDA_TUP: ([u8; 32], u8) = derive_program_address(
16+
&[b"stake_authority", LIDO_STATE_ADDR.as_slice()],
17+
&PROGRAM_ID,
18+
);
19+
pub const STAKE_AUTH_PDA: [u8; 32] = STAKE_AUTH_PDA_TUP.0;
20+
pub const STAKE_AUTH_PDA_BUMP: u8 = STAKE_AUTH_PDA_TUP.1;
21+
pub const STAKE_AUTH_PDA_STR: &str = bs58::encode_pubkey(&STAKE_AUTH_PDA).str();

core/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
#![cfg_attr(not(test), no_std)]
22

33
mod internal_utils;
4+
mod keys;
45
mod state;
56
mod typedefs;
67

8+
pub use keys::*;
79
pub use state::*;
810
pub use typedefs::*;

0 commit comments

Comments
 (0)