gemachain_sdk/
entrypoint.rs1pub use gemachain_program::entrypoint::*;
2
3#[macro_export]
4#[deprecated(
5 since = "1.4.3",
6 note = "use gemachain_program::entrypoint::entrypoint instead"
7)]
8macro_rules! entrypoint {
9 ($process_instruction:ident) => {
10 #[cfg(all(not(feature = "custom-heap"), not(test)))]
11 #[global_allocator]
12 static A: $crate::entrypoint::BumpAllocator = $crate::entrypoint::BumpAllocator {
13 start: $crate::entrypoint::HEAP_START_ADDRESS,
14 len: $crate::entrypoint::HEAP_LENGTH,
15 };
16
17 #[no_mangle]
19 pub unsafe extern "C" fn entrypoint(input: *mut u8) -> u64 {
20 let (program_id, accounts, instruction_data) =
21 unsafe { $crate::entrypoint::deserialize(input) };
22 match $process_instruction(&program_id, &accounts, &instruction_data) {
23 Ok(()) => $crate::entrypoint::SUCCESS,
24 Err(error) => error.into(),
25 }
26 }
27 };
28}