P2p payment

//First import LibraAccount library
import 0x0.LibraAccount;
import 0x0.LibraCoin;

//Define two parameters
main(payee: address, amount: u64){
 //Create a coin variable, the type would be of LibraCoin
  let coin: R#LibraCoin.T;
//We grab the amount from the sender
  coin = LibraAccount.withdraw_from_sender(move(amount));
//Transfer or deposit this ammount to other user
  LibraAccount.deposit(move(payee), move(coin))

  return;
}

Last updated

Was this helpful?