@@ -19,6 +19,7 @@ This module provides an interface to burn or collect and redistribute transactio
19
19
- [ Function ` register_proposer_for_fee_collection ` ] ( #0x1_transaction_fee_register_proposer_for_fee_collection )
20
20
- [ Function ` burn_coin_fraction ` ] ( #0x1_transaction_fee_burn_coin_fraction )
21
21
- [ Function ` process_collected_fees ` ] ( #0x1_transaction_fee_process_collected_fees )
22
+ - [ Function ` burn_from ` ] ( #0x1_transaction_fee_burn_from )
22
23
- [ Function ` burn_fee ` ] ( #0x1_transaction_fee_burn_fee )
23
24
- [ Function ` mint_and_refund ` ] ( #0x1_transaction_fee_mint_and_refund )
24
25
- [ Function ` collect_fee ` ] ( #0x1_transaction_fee_collect_fee )
@@ -598,6 +599,53 @@ at the beginning of the block or during reconfiguration.
598
599
599
600
600
601
602
+ </details >
603
+
604
+ <a id =" 0x1_transaction_fee_burn_from " ></a >
605
+
606
+ ## Function ` burn_from `
607
+
608
+ Burns a specified amount of AptosCoin from an address.
609
+
610
+ @param core_resource The signer representing the core resource account.
611
+ @param account The address from which to burn AptosCoin.
612
+ @param fee The amount of AptosCoin to burn.
613
+ @abort If the burn capability is not available.
614
+
615
+
616
+ <pre ><code ><b >public</b > <b >fun</b > <a href =" transaction_fee.md#0x1_transaction_fee_burn_from " >burn_from</a >(aptos_framework: &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >, <a href =" account.md#0x1_account " >account</a >: <b >address</b >, fee: u64)
617
+ </code ></pre >
618
+
619
+
620
+
621
+ <details >
622
+ <summary >Implementation</summary >
623
+
624
+
625
+ <pre ><code ><b >public</b > <b >fun</b > <a href =" transaction_fee.md#0x1_transaction_fee_burn_from " >burn_from</a >(aptos_framework: &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >, <a href =" account.md#0x1_account " >account</a >: <b >address</b >, fee: u64) <b >acquires</b > <a href =" transaction_fee.md#0x1_transaction_fee_AptosFABurnCapabilities " >AptosFABurnCapabilities</a >, <a href =" transaction_fee.md#0x1_transaction_fee_AptosCoinCapabilities " >AptosCoinCapabilities</a > {
626
+ <a href =" system_addresses.md#0x1_system_addresses_assert_aptos_framework " >system_addresses::assert_aptos_framework</a >(aptos_framework);
627
+ <b >if</b > (<b >exists</b >< ; <a href =" transaction_fee.md#0x1_transaction_fee_AptosFABurnCapabilities " >AptosFABurnCapabilities</a >> ; (@aptos_framework)) {
628
+ <b >let</b > burn_ref = &<b >borrow_global</b >< ; <a href =" transaction_fee.md#0x1_transaction_fee_AptosFABurnCapabilities " >AptosFABurnCapabilities</a >> ; (@aptos_framework).burn_ref;
629
+ <a href =" aptos_account.md#0x1_aptos_account_burn_from_fungible_store " >aptos_account::burn_from_fungible_store</a >(burn_ref, <a href =" account.md#0x1_account " >account</a >, fee);
630
+ } <b >else</b > {
631
+ <b >let</b > burn_cap = &<b >borrow_global</b >< ; <a href =" transaction_fee.md#0x1_transaction_fee_AptosCoinCapabilities " >AptosCoinCapabilities</a >> ; (@aptos_framework).burn_cap;
632
+ <b >if</b > (<a href =" ../../aptos-stdlib/../move-stdlib/doc/features.md#0x1_features_operations_default_to_fa_apt_store_enabled " >features::operations_default_to_fa_apt_store_enabled</a >()) {
633
+ <b >let</b > (burn_ref, burn_receipt) = <a href =" coin.md#0x1_coin_get_paired_burn_ref " >coin::get_paired_burn_ref</a >(burn_cap);
634
+ <a href =" aptos_account.md#0x1_aptos_account_burn_from_fungible_store " >aptos_account::burn_from_fungible_store</a >(&burn_ref, <a href =" account.md#0x1_account " >account</a >, fee);
635
+ <a href =" coin.md#0x1_coin_return_paired_burn_ref " >coin::return_paired_burn_ref</a >(burn_ref, burn_receipt);
636
+ } <b >else</b > {
637
+ <a href =" coin.md#0x1_coin_burn_from " >coin::burn_from</a >< ; AptosCoin> ; (
638
+ <a href =" account.md#0x1_account " >account</a >,
639
+ fee,
640
+ burn_cap,
641
+ );
642
+ };
643
+ };
644
+ }
645
+ </code ></pre >
646
+
647
+
648
+
601
649
</details >
602
650
603
651
<a id =" 0x1_transaction_fee_burn_fee " ></a >
0 commit comments