Anchor for EVM Developers
  • Anchor for EVM Developers
  • Program Address
  • Functions
  • Token
  • Validation
  • Mutation
  • Calling Other Contract
  • Wrap Native Token
  • Transfer Native Token
  • Transfer Fungible Token
  • Deploy A Fungible Token
  • Access Control
  • Address Mining
  • Events
  • Forking Mainnet
  • Function Selector
  • Feature Flags
  • Feature Dependencies
  • Migration / Scripts
  • Upgrade Programs
  • Block timestamp
Powered by GitBook
On this page

Transfer Native Token

EVM

payable(recipient){value: amount}("");

Solana

  1. From regular accounts

let ix = transfer(&from.key(), &to.key(), amount);

invoke(
    &ix,
    &[
        from.to_account_info(),
        to.to_account_info(),
        system_program.to_account_info(),
    ],
)?;
  1. From PDAs

let ix = transfer(&from.key(), &to.key(), amount);

invoke_signed(
    &ix,
    &[
        from.to_account_info(),
        to.to_account_info(),
        system_program.to_account_info(),
    ],
    &[signer_seeds],
)?;

PreviousWrap Native TokenNextTransfer Fungible Token

Last updated 2 months ago