2020-11-30 13:06:11 -08:00
|
|
|
use solana_program::{
|
|
|
|
account_info::AccountInfo, entrypoint, entrypoint::ProgramResult, pubkey::Pubkey,
|
|
|
|
};
|
|
|
|
|
|
|
|
entrypoint!(process_instruction);
|
2020-12-13 17:26:34 -08:00
|
|
|
#[allow(clippy::unnecessary_wraps)]
|
2020-11-30 13:06:11 -08:00
|
|
|
fn process_instruction(
|
|
|
|
_program_id: &Pubkey,
|
|
|
|
accounts: &[AccountInfo],
|
|
|
|
_instruction_data: &[u8],
|
|
|
|
) -> ProgramResult {
|
|
|
|
let from = &accounts[0];
|
|
|
|
let to = &accounts[1];
|
|
|
|
|
|
|
|
let to_balance = to.lamports();
|
|
|
|
**to.lamports.borrow_mut() = to_balance + from.lamports();
|
|
|
|
**from.lamports.borrow_mut() = 0u64;
|
|
|
|
|
|
|
|
Ok(())
|
|
|
|
}
|