From 12fa25209b37e8e44bcaadf542ba2571536d8728 Mon Sep 17 00:00:00 2001 From: Bo Wu Date: Mon, 10 Oct 2022 14:13:58 -0700 Subject: [PATCH] [Token] make transfer function public entry --- .../framework/aptos-token/sources/token.move | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/aptos-move/framework/aptos-token/sources/token.move b/aptos-move/framework/aptos-token/sources/token.move index a9b567267b48f..abc564fbea17a 100644 --- a/aptos-move/framework/aptos-token/sources/token.move +++ b/aptos-move/framework/aptos-token/sources/token.move @@ -462,6 +462,21 @@ module aptos_token::token { *opt_in_flag = opt_in; } + /// Transfers `amount` of tokens from `from` to `to`. + /// The receiver `to` has to opt-in direct transfer first + public entry fun transfer_with_opt_in( + from: &signer, + creator: address, + collection_name: String, + token_name: String, + token_property_version: u64, + to: address, + amount: u64, + ) acquires TokenStore { + let token_id = create_token_id_raw(creator, collection_name, token_name, token_property_version); + transfer(from, token_id, to, amount); + } + /// Burn a token by creator when the token's BURNABLE_BY_CREATOR is true /// The token is owned at address owner public entry fun burn_by_creator(