Skip to content

Commit

Permalink
[Token] make transfer function public entry
Browse files Browse the repository at this point in the history
  • Loading branch information
areshand committed Oct 14, 2022
1 parent 0fec65e commit ade46e0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions aptos-move/framework/aptos-token/sources/token.move
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ade46e0

Please sign in to comment.