Skip to content
Discussion options

You must be logged in to vote

Move scripts

Yes, it's possible with a Move script. Check out about Move scripts here:

https://aptos.dev/move/move-on-aptos/scripts/

Move script Example

script {
  use aptos_framework::aptos_account;

  /// Transfers the same amount to two accounts
  fun transfer_two<Coin>(caller: &signer, receiver1: address, receiver2: address, amount: u64) {
    // Send amount to receiver1
    aptos_account::transfer_coins<Coin>(caller, receiver1, amount);

    // Send amount to receiver2
    aptos_account::transfer_coins<Coin>(caller, receiver2, amount);
  }
}

Typescript Associated:

First precompile the script above:

# Create a directory for the script
mkdir temp
cd temp

# Initialize the directory
apt…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by gregnazario
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
move-script Move script lets you call multiple functions in 1 tx
1 participant