Skip to content

Commit

Permalink
rename
Browse files Browse the repository at this point in the history
  • Loading branch information
deanmlittle committed Oct 30, 2024
1 parent 77cdd3e commit e151b75
Show file tree
Hide file tree
Showing 18 changed files with 164 additions and 2 deletions.
1 change: 0 additions & 1 deletion programs/memo
Submodule memo deleted from cfb9ed
1 change: 0 additions & 1 deletion programs/token
Submodule token deleted from cfb9ed
15 changes: 15 additions & 0 deletions programs1/memo/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
[package]
name = "mollusk-memo"
version = "0.1.0"
edition = "2021"

[features]
default = ["memo", "memo-v1"]
memo = []
memo-v1 = []

[lib]

[dependencies]
mollusk-svm = { workspace = true }
solana-sdk = { workspace = true }
Binary file added programs1/memo/src/elf/memo-v1.so
Binary file not shown.
Binary file added programs1/memo/src/elf/memo.so
Binary file not shown.
5 changes: 5 additions & 0 deletions programs1/memo/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
// Last updated at mainnet-beta slot height: 298485997
#[cfg(feature = "memo")]
pub mod memo;
#[cfg(feature = "memo-v1")]
pub mod memo_v1;
23 changes: 23 additions & 0 deletions programs1/memo/src/memo.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use {
mollusk_svm::Mollusk,
solana_sdk::{account::AccountSharedData, pubkey::Pubkey},
};

pub const ID: Pubkey = solana_sdk::pubkey!("MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr");

pub fn add_program(mollusk: &mut Mollusk) {
mollusk.add_program_with_elf_and_loader(
&ID,
include_bytes!("elf/memo.so"),
&mollusk_svm::program::loader_keys::LOADER_V2,
);
}

pub fn account() -> AccountSharedData {
mollusk_svm::program::create_program_account_loader_v3(&ID)
}

/// Get the key and account for the system program.
pub fn keyed_account() -> (Pubkey, AccountSharedData) {
(ID, account())
}
23 changes: 23 additions & 0 deletions programs1/memo/src/memo_v1.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use {
mollusk_svm::Mollusk,
solana_sdk::{account::AccountSharedData, pubkey::Pubkey},
};

pub const ID: Pubkey = solana_sdk::pubkey!("Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo");

pub fn add_program(mollusk: &mut Mollusk) {
//BPFLoader1111111111111111111111111111111111
mollusk.add_program_with_elf_and_loader(
&ID,
include_bytes!("elf/memo-v1.so"),
&mollusk_svm::program::loader_keys::LOADER_V1,
);
}

/// Get the key and account for the system program.
pub fn keyed_account() -> (Pubkey, AccountSharedData) {
(
ID,
mollusk_svm::program::create_program_account_loader_v3(&ID),
)
}
3 changes: 3 additions & 0 deletions programs1/memo/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
solana program dump MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr ./src/elf/memo.so -u mainnet-beta
solana program dump Memo1UhkJRfHyvLMcVucJwxXeuD728EqVDDwQDxFMNo ./src/elf/memo-v1.so -u mainnet-beta
solana slot -u mainnet-beta | xargs -I {} sed -i '' 's|// Last updated at mainnet-beta slot height: .*|// Last updated at mainnet-beta slot height: {}|' ./src/lib.rs
16 changes: 16 additions & 0 deletions programs1/token/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[package]
name = "mollusk-token"
version = "0.1.0"
edition = "2021"

[features]
default = ["token", "associated-token", "token-2022"]
token = []
associated-token = []
token-2022 = []

[lib]

[dependencies]
mollusk-svm = { workspace = true }
solana-sdk = { workspace = true }
22 changes: 22 additions & 0 deletions programs1/token/src/associated_token.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
use {
mollusk_svm::Mollusk,
solana_sdk::{account::AccountSharedData, pubkey::Pubkey},
};

pub const ID: Pubkey = solana_sdk::pubkey!("ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL");

pub fn add_program(mollusk: &mut Mollusk) {
mollusk.add_program_with_elf_and_loader(
&ID,
include_bytes!("elf/associated_token.so"),
&mollusk_svm::program::loader_keys::LOADER_V2,
);
}

/// Get the key and account for the system program.
pub fn keyed_account() -> (Pubkey, AccountSharedData) {
(
ID,
mollusk_svm::program::create_program_account_loader_v3(&ID),
)
}
Binary file added programs1/token/src/elf/associated_token.so
Binary file not shown.
Binary file added programs1/token/src/elf/token.so
Binary file not shown.
Binary file added programs1/token/src/elf/token_2022.so
Binary file not shown.
7 changes: 7 additions & 0 deletions programs1/token/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#[cfg(feature = "associated-token")]
pub mod associated_token;
// Last updated at mainnet-beta slot height: 298486032
#[cfg(feature = "token")]
pub mod token;
#[cfg(feature = "token-2022")]
pub mod token2022;
23 changes: 23 additions & 0 deletions programs1/token/src/token.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use {
mollusk_svm::Mollusk,
solana_sdk::{account::AccountSharedData, pubkey::Pubkey},
};

pub const ID: Pubkey = solana_sdk::pubkey!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA");

pub fn add_program(mollusk: &mut Mollusk) {
mollusk.add_program_with_elf_and_loader(
&ID,
include_bytes!("elf/token.so"),
&mollusk_svm::program::loader_keys::LOADER_V2,
);
}

pub fn account() -> AccountSharedData {
mollusk_svm::program::create_program_account_loader_v3(&ID)
}

/// Get the key and account for the system program.
pub fn keyed_account() -> (Pubkey, AccountSharedData) {
(ID, account())
}
23 changes: 23 additions & 0 deletions programs1/token/src/token2022.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use {
mollusk_svm::Mollusk,
solana_sdk::{account::AccountSharedData, pubkey::Pubkey},
};

pub const ID: Pubkey = solana_sdk::pubkey!("TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb");

pub fn add_program(mollusk: &mut Mollusk) {
mollusk.add_program_with_elf_and_loader(
&ID,
include_bytes!("elf/token_2022.so"),
&mollusk_svm::program::loader_keys::LOADER_V2,
);
}

pub fn account() -> AccountSharedData {
mollusk_svm::program::create_program_account_loader_v3(&ID)
}

/// Get the key and account for the system program.
pub fn keyed_account() -> (Pubkey, AccountSharedData) {
(ID, account())
}
4 changes: 4 additions & 0 deletions programs1/token/update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
solana program dump TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA ./src/elf/token.so -u mainnet-beta
solana program dump TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb ./src/elf/token_2022.so -u mainnet-beta
solana program dump ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL ./src/elf/associated_token.so -u mainnet-beta
solana slot -u mainnet-beta | xargs -I {} sed -i '' 's|// Last updated at mainnet-beta slot height: .*|// Last updated at mainnet-beta slot height: {}|' ./src/lib.rs

0 comments on commit e151b75

Please sign in to comment.