@@ -216,32 +216,31 @@ module aptos_framework::transaction_fee {
216
216
coin::destroy_zero (coin)
217
217
}
218
218
219
- /// Mints a specified amount of AptosCoin to a recipient's address.
220
- ///
221
- /// @param core_resource The signer representing the core resource account.
222
- /// @param recipient The address of the recipient to mint coins to.
223
- /// @param amount The amount of AptosCoin to mint.
224
- public fun mint_to (aptos_framework: &signer , recipient: address , amount: u64 ) acquires AptosCoinMintCapability {
225
- system_addresses::assert_aptos_framework (aptos_framework);
226
- coin::deposit (recipient, coin::mint (
227
- amount,
228
- &borrow_global <AptosCoinMintCapability >(@aptos_framework ).mint_cap
229
- ));
230
- }
231
-
232
219
/// Burns a specified amount of AptosCoin from an address.
233
220
///
234
221
/// @param core_resource The signer representing the core resource account.
235
- /// @param from The address from which to burn AptosCoin.
236
- /// @param amount The amount of AptosCoin to burn.
222
+ /// @param account The address from which to burn AptosCoin.
223
+ /// @param fee The amount of AptosCoin to burn.
237
224
/// @abort If the burn capability is not available.
238
- public fun burn_from (aptos_framework: &signer , from : address , amount : u64 ) acquires AptosCoinBurnCapability {
225
+ public fun burn_from (aptos_framework: &signer , account : address , fee : u64 ) acquires AptosFABurnCapabilities , AptosCoinCapabilities {
239
226
system_addresses::assert_aptos_framework (aptos_framework);
240
- coin::burn_from (
241
- from,
242
- amount,
243
- &borrow_global <AptosCoinBurnCapability >(@aptos_framework ).burn_cap,
244
- );
227
+ if (exists <AptosFABurnCapabilities >(@aptos_framework )) {
228
+ let burn_ref = &borrow_global <AptosFABurnCapabilities >(@aptos_framework ).burn_ref;
229
+ aptos_account::burn_from_fungible_store (burn_ref, account, fee);
230
+ } else {
231
+ let burn_cap = &borrow_global <AptosCoinCapabilities >(@aptos_framework ).burn_cap;
232
+ if (features::operations_default_to_fa_apt_store_enabled ()) {
233
+ let (burn_ref, burn_receipt) = coin::get_paired_burn_ref (burn_cap);
234
+ aptos_account::burn_from_fungible_store (&burn_ref, account, fee);
235
+ coin::return_paired_burn_ref (burn_ref, burn_receipt);
236
+ } else {
237
+ coin::burn_from <AptosCoin >(
238
+ account,
239
+ fee,
240
+ burn_cap,
241
+ );
242
+ };
243
+ };
245
244
}
246
245
247
246
/// Burn transaction fees in epilogue.
0 commit comments