diff --git a/programs/memo b/programs/memo deleted file mode 160000 index cfb9ede1..00000000 --- a/programs/memo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cfb9ede113488d45a3c6d55d7657fbef600979e4 diff --git a/programs/token b/programs/token deleted file mode 160000 index cfb9ede1..00000000 --- a/programs/token +++ /dev/null @@ -1 +0,0 @@ -Subproject commit cfb9ede113488d45a3c6d55d7657fbef600979e4 diff --git a/programs1/memo/Cargo.toml b/programs1/memo/Cargo.toml new file mode 100644 index 00000000..0ca441d4 --- /dev/null +++ b/programs1/memo/Cargo.toml @@ -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 } \ No newline at end of file diff --git a/programs1/memo/src/elf/memo-v1.so b/programs1/memo/src/elf/memo-v1.so new file mode 100644 index 00000000..7f4bcc3b Binary files /dev/null and b/programs1/memo/src/elf/memo-v1.so differ diff --git a/programs1/memo/src/elf/memo.so b/programs1/memo/src/elf/memo.so new file mode 100644 index 00000000..88385a01 Binary files /dev/null and b/programs1/memo/src/elf/memo.so differ diff --git a/programs1/memo/src/lib.rs b/programs1/memo/src/lib.rs new file mode 100644 index 00000000..ec93b9fd --- /dev/null +++ b/programs1/memo/src/lib.rs @@ -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; diff --git a/programs1/memo/src/memo.rs b/programs1/memo/src/memo.rs new file mode 100644 index 00000000..2d974f1c --- /dev/null +++ b/programs1/memo/src/memo.rs @@ -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()) +} diff --git a/programs1/memo/src/memo_v1.rs b/programs1/memo/src/memo_v1.rs new file mode 100644 index 00000000..46ed2104 --- /dev/null +++ b/programs1/memo/src/memo_v1.rs @@ -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), + ) +} diff --git a/programs1/memo/update.sh b/programs1/memo/update.sh new file mode 100755 index 00000000..ecb2d271 --- /dev/null +++ b/programs1/memo/update.sh @@ -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 \ No newline at end of file diff --git a/programs1/token/Cargo.toml b/programs1/token/Cargo.toml new file mode 100644 index 00000000..b1583ae7 --- /dev/null +++ b/programs1/token/Cargo.toml @@ -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 } \ No newline at end of file diff --git a/programs1/token/src/associated_token.rs b/programs1/token/src/associated_token.rs new file mode 100644 index 00000000..bee3b5b5 --- /dev/null +++ b/programs1/token/src/associated_token.rs @@ -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), + ) +} diff --git a/programs1/token/src/elf/associated_token.so b/programs1/token/src/elf/associated_token.so new file mode 100644 index 00000000..01fcb69b Binary files /dev/null and b/programs1/token/src/elf/associated_token.so differ diff --git a/programs1/token/src/elf/token.so b/programs1/token/src/elf/token.so new file mode 100644 index 00000000..9eeed9a0 Binary files /dev/null and b/programs1/token/src/elf/token.so differ diff --git a/programs1/token/src/elf/token_2022.so b/programs1/token/src/elf/token_2022.so new file mode 100644 index 00000000..a2032694 Binary files /dev/null and b/programs1/token/src/elf/token_2022.so differ diff --git a/programs1/token/src/lib.rs b/programs1/token/src/lib.rs new file mode 100644 index 00000000..7ff9ba09 --- /dev/null +++ b/programs1/token/src/lib.rs @@ -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; diff --git a/programs1/token/src/token.rs b/programs1/token/src/token.rs new file mode 100644 index 00000000..2d423fb1 --- /dev/null +++ b/programs1/token/src/token.rs @@ -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()) +} diff --git a/programs1/token/src/token2022.rs b/programs1/token/src/token2022.rs new file mode 100644 index 00000000..55762a06 --- /dev/null +++ b/programs1/token/src/token2022.rs @@ -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()) +} diff --git a/programs1/token/update.sh b/programs1/token/update.sh new file mode 100755 index 00000000..6d3f8629 --- /dev/null +++ b/programs1/token/update.sh @@ -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 \ No newline at end of file