generated from streamlit/support-tickets-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lib.rs
29 lines (25 loc) · 850 Bytes
/
lib.rs
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
use solana_program::{
account_info::AccountInfo,
entrypoint,
entrypoint::ProgramResult,
pubkey::Pubkey,
msg,
};
/// Define the program's entrypoint
entrypoint!(process_instruction);
/// Main function where program logic is handled
fn process_instruction(
program_id: &Pubkey, // The program ID of this program
accounts: &[AccountInfo], // List of accounts passed to the program
instruction_data: &[u8], // Instruction data passed to the program
) -> ProgramResult {
// Example: Print a debug message
msg!("Hello, Solana!");
// Add logic here (e.g., data manipulation or validation)
if instruction_data.is_empty() {
msg!("No instruction data provided.");
} else {
msg!("Instruction data: {:?}", instruction_data);
}
Ok(())
}