@@ -17,6 +17,7 @@ modified from https://github.com/move-language/move/tree/main/language/documenta
1717- [ Function ` destroy_mint_cap ` ] ( #0x1_aptos_coin_destroy_mint_cap )
1818- [ Function ` configure_accounts_for_test ` ] ( #0x1_aptos_coin_configure_accounts_for_test )
1919- [ Function ` mint ` ] ( #0x1_aptos_coin_mint )
20+ - [ Function ` destroy_mint_capability_from ` ] ( #0x1_aptos_coin_destroy_mint_capability_from )
2021- [ Function ` delegate_mint_capability ` ] ( #0x1_aptos_coin_delegate_mint_capability )
2122- [ Function ` claim_mint_capability ` ] ( #0x1_aptos_coin_claim_mint_capability )
2223- [ Function ` find_delegation ` ] ( #0x1_aptos_coin_find_delegation )
@@ -209,8 +210,8 @@ Can only called during genesis to initialize the Aptos coin.
209210
210211 <b >let</b > (burn_cap, freeze_cap, mint_cap) = <a href =" coin.md#0x1_coin_initialize_with_parallelizable_supply " >coin::initialize_with_parallelizable_supply</a >< ; <a href =" aptos_coin.md#0x1_aptos_coin_AptosCoin " >AptosCoin</a >> ; (
211212 aptos_framework,
212- <a href =" ../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8 " >string::utf8</a >(b"Aptos Coin"),
213- <a href =" ../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8 " >string::utf8</a >(b"APT "),
213+ <a href =" ../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8 " >string::utf8</a >(b"Move Coin"),
214+ <a href =" ../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_utf8 " >string::utf8</a >(b"MOVE "),
214215 8, // decimals
215216 <b >true</b >, // monitor_supply
216217 );
@@ -260,7 +261,7 @@ Only called during genesis to destroy the aptos framework account's mint capabil
260261and accounts have been initialized during genesis.
261262
262263
263- <pre ><code ><b >public</b >(<b >friend</b >) <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_destroy_mint_cap " >destroy_mint_cap</a >(aptos_framework : &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >)
264+ <pre ><code ><b >public</b >(<b >friend</b >) <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_destroy_mint_cap " >destroy_mint_cap</a >(< a href = " account.md#0x1_account " >account</ a > : &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >)
264265</code ></pre >
265266
266267
@@ -269,8 +270,8 @@ and accounts have been initialized during genesis.
269270<summary >Implementation</summary >
270271
271272
272- <pre ><code ><b >public</b >(<b >friend</b >) <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_destroy_mint_cap " >destroy_mint_cap</a >(aptos_framework : &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >) <b >acquires</b > <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a > {
273- <a href =" system_addresses.md#0x1_system_addresses_assert_aptos_framework " >system_addresses::assert_aptos_framework</a >(aptos_framework );
273+ <pre ><code ><b >public</b >(<b >friend</b >) <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_destroy_mint_cap " >destroy_mint_cap</a >(< a href = " account.md#0x1_account " >account</ a > : &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >) <b >acquires</b > <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a > {
274+ <a href =" system_addresses.md#0x1_system_addresses_assert_aptos_framework " >system_addresses::assert_aptos_framework</a >(< a href = " account.md#0x1_account " >account</ a > );
274275 <b >let</b > <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a > { mint_cap } = <b >move_from</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a >> ; (@aptos_framework);
275276 <a href =" coin.md#0x1_coin_destroy_mint_cap " >coin::destroy_mint_cap</a >(mint_cap);
276277}
@@ -358,6 +359,33 @@ Create new coins and deposit them into dst_addr's account.
358359
359360
360361
362+ </details >
363+
364+ <a id =" 0x1_aptos_coin_destroy_mint_capability_from " ></a >
365+
366+ ## Function ` destroy_mint_capability_from `
367+
368+ Desroy the mint capability from the account.
369+
370+
371+ <pre ><code ><b >public</b > <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_destroy_mint_capability_from " >destroy_mint_capability_from</a >(<a href =" account.md#0x1_account " >account</a >: &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >, from: <b >address</b >)
372+ </code ></pre >
373+
374+
375+
376+ <details >
377+ <summary >Implementation</summary >
378+
379+
380+ <pre ><code ><b >public</b > <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_destroy_mint_capability_from " >destroy_mint_capability_from</a >(<a href =" account.md#0x1_account " >account</a >: &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >, from: <b >address</b >) <b >acquires</b > <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a > {
381+ <a href =" system_addresses.md#0x1_system_addresses_assert_aptos_framework " >system_addresses::assert_aptos_framework</a >(<a href =" account.md#0x1_account " >account</a >);
382+ <b >let</b > <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a > { mint_cap } = <b >move_from</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a >> ; (from);
383+ <a href =" coin.md#0x1_coin_destroy_mint_cap " >coin::destroy_mint_cap</a >(mint_cap);
384+ }
385+ </code ></pre >
386+
387+
388+
361389</details >
362390
363391<a id =" 0x1_aptos_coin_delegate_mint_capability " ></a >
@@ -378,8 +406,11 @@ Create delegated token for the address so the account could claim MintCapability
378406
379407
380408<pre ><code ><b >public</b > entry <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_delegate_mint_capability " >delegate_mint_capability</a >(<a href =" account.md#0x1_account " >account</a >: <a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >, <b >to</b >: <b >address</b >) <b >acquires</b > <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a > {
381- <a href =" system_addresses.md#0x1_system_addresses_assert_core_resource " >system_addresses::assert_core_resource</a >(&<a href =" account.md#0x1_account " >account</a >);
382- <b >let</b > delegations = &<b >mut</b > <b >borrow_global_mut</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a >> ; (@core_resources).inner;
409+ <a href =" system_addresses.md#0x1_system_addresses_assert_aptos_framework " >system_addresses::assert_aptos_framework</a >(&<a href =" account.md#0x1_account " >account</a >);
410+ <b >let</b > delegations = &<b >mut</b > <b >borrow_global_mut</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a >> ; (@aptos_framework).inner;
411+ <b >if</b > (!<b >exists</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a >> ; (<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of " >signer::address_of</a >(&<a href =" account.md#0x1_account " >account</a >))) {
412+ <b >move_to</b >(&<a href =" account.md#0x1_account " >account</a >, <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a > { inner: <a href =" ../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector " >vector</a >[] });
413+ };
383414 <a href =" ../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_for_each_ref " >vector::for_each_ref</a >(delegations, |element| {
384415 <b >let</b > element: &<a href =" aptos_coin.md#0x1_aptos_coin_DelegatedMintCapability " >DelegatedMintCapability</a > = element;
385416 <b >assert</b >!(element.<b >to</b > != <b >to</b >, <a href =" ../../aptos-stdlib/../move-stdlib/doc/error.md#0x1_error_invalid_argument " >error::invalid_argument</a >(<a href =" aptos_coin.md#0x1_aptos_coin_EALREADY_DELEGATED " >EALREADY_DELEGATED</a >));
@@ -413,11 +444,11 @@ Claim the delegated mint capability and destroy the delegated token.
413444 <b >let</b > maybe_index = <a href =" aptos_coin.md#0x1_aptos_coin_find_delegation " >find_delegation</a >(<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of " >signer::address_of</a >(<a href =" account.md#0x1_account " >account</a >));
414445 <b >assert</b >!(<a href =" ../../aptos-stdlib/../move-stdlib/doc/option.md#0x1_option_is_some " >option::is_some</a >(&maybe_index), <a href =" aptos_coin.md#0x1_aptos_coin_EDELEGATION_NOT_FOUND " >EDELEGATION_NOT_FOUND</a >);
415446 <b >let</b > idx = *<a href =" ../../aptos-stdlib/../move-stdlib/doc/option.md#0x1_option_borrow " >option::borrow</a >(&maybe_index);
416- <b >let</b > delegations = &<b >mut</b > <b >borrow_global_mut</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a >> ; (@core_resources ).inner;
447+ <b >let</b > delegations = &<b >mut</b > <b >borrow_global_mut</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a >> ; (@aptos_framework ).inner;
417448 <b >let</b > <a href =" aptos_coin.md#0x1_aptos_coin_DelegatedMintCapability " >DelegatedMintCapability</a > { <b >to</b >: _ } = <a href =" ../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_swap_remove " >vector::swap_remove</a >(delegations, idx);
418449
419450 // Make a <b >copy</b > of mint cap and give it <b >to</b > the specified <a href =" account.md#0x1_account " >account</a >.
420- <b >let</b > mint_cap = <b >borrow_global</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a >> ; (@core_resources ).mint_cap;
451+ <b >let</b > mint_cap = <b >borrow_global</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a >> ; (@aptos_framework ).mint_cap;
421452 <b >move_to</b >(<a href =" account.md#0x1_account " >account</a >, <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a > { mint_cap });
422453}
423454</code ></pre >
@@ -442,7 +473,7 @@ Claim the delegated mint capability and destroy the delegated token.
442473
443474
444475<pre ><code ><b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_find_delegation " >find_delegation</a >(addr: <b >address</b >): Option< ; u64> ; <b >acquires</b > <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a > {
445- <b >let</b > delegations = &<b >borrow_global</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a >> ; (@core_resources ).inner;
476+ <b >let</b > delegations = &<b >borrow_global</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_Delegations " >Delegations</a >> ; (@aptos_framework ).inner;
446477 <b >let</b > i = 0;
447478 <b >let</b > len = <a href =" ../../aptos-stdlib/../move-stdlib/doc/vector.md#0x1_vector_length " >vector::length</a >(delegations);
448479 <b >let</b > index = <a href =" ../../aptos-stdlib/../move-stdlib/doc/option.md#0x1_option_none " >option::none</a >();
@@ -513,7 +544,7 @@ Claim the delegated mint capability and destroy the delegated token.
513544
514545
515546<pre ><code ><b >pragma</b > verify = <b >true</b >;
516- <b >pragma</b > aborts_if_is_partial ;
547+ <b >pragma</b > aborts_if_is_strict ;
517548</code ></pre >
518549
519550
@@ -529,12 +560,10 @@ Claim the delegated mint capability and destroy the delegated token.
529560
530561
531562
532- <pre ><code ><b >pragma</b > verify = <b >false</b >;
533- <b >aborts_if</b > <a href =" permissioned_signer.md#0x1_permissioned_signer_spec_is_permissioned_signer " >permissioned_signer::spec_is_permissioned_signer</a >(aptos_framework);
534- <b >let</b > addr = <a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of " >signer::address_of</a >(aptos_framework);
563+ <pre ><code ><b >let</b > addr = <a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of " >signer::address_of</a >(aptos_framework);
535564<b >aborts_if</b > addr != @aptos_framework;
536- <b >aborts_if</b > !<a href =" ../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_spec_internal_check_utf8 " >string::spec_internal_check_utf8</a >(b"Aptos Coin");
537- <b >aborts_if</b > !<a href =" ../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_spec_internal_check_utf8 " >string::spec_internal_check_utf8</a >(b"APT ");
565+ <b >aborts_if</b > !<a href =" ../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_spec_internal_check_utf8 " >string::spec_internal_check_utf8</a >(b"Move Coin");
566+ <b >aborts_if</b > !<a href =" ../../aptos-stdlib/../move-stdlib/doc/string.md#0x1_string_spec_internal_check_utf8 " >string::spec_internal_check_utf8</a >(b"MOVE ");
538567<b >aborts_if</b > <b >exists</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a >> ; (addr);
539568<b >aborts_if</b > <b >exists</b >< ; <a href =" coin.md#0x1_coin_CoinInfo " >coin::CoinInfo</a >< ; <a href =" aptos_coin.md#0x1_aptos_coin_AptosCoin " >AptosCoin</a >> ;> ; (addr);
540569<b >aborts_if</b > !<b >exists</b >< ; <a href =" aggregator_factory.md#0x1_aggregator_factory_AggregatorFactory " >aggregator_factory::AggregatorFactory</a >> ; (addr);
@@ -554,13 +583,13 @@ Claim the delegated mint capability and destroy the delegated token.
554583### Function ` destroy_mint_cap `
555584
556585
557- <pre ><code ><b >public</b >(<b >friend</b >) <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_destroy_mint_cap " >destroy_mint_cap</a >(aptos_framework : &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >)
586+ <pre ><code ><b >public</b >(<b >friend</b >) <b >fun</b > <a href =" aptos_coin.md#0x1_aptos_coin_destroy_mint_cap " >destroy_mint_cap</a >(< a href = " account.md#0x1_account " >account</ a > : &<a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer " >signer</a >)
558587</code ></pre >
559588
560589
561590
562591
563- <pre ><code ><b >let</b > addr = <a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of " >signer::address_of</a >(aptos_framework );
592+ <pre ><code ><b >let</b > addr = <a href =" ../../aptos-stdlib/../move-stdlib/doc/signer.md#0x1_signer_address_of " >signer::address_of</a >(< a href = " account.md#0x1_account " >account</ a > );
564593<b >aborts_if</b > addr != @aptos_framework;
565594<b >aborts_if</b > !<b >exists</b >< ; <a href =" aptos_coin.md#0x1_aptos_coin_MintCapStore " >MintCapStore</a >> ; (@aptos_framework);
566595</code ></pre >
0 commit comments