Skip to content

Commit

Permalink
update v2
Browse files Browse the repository at this point in the history
  • Loading branch information
rahxephon89 committed Nov 5, 2024
1 parent 277d1ae commit 321f2eb
Show file tree
Hide file tree
Showing 85 changed files with 4,911 additions and 4,643 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,11 @@ B2:
27: LdU64(1)
28: Add
29: StLoc[3](loc2: u64)
30: Branch(34)
30: Branch(17)
B3:
31: MoveLoc[2](loc1: &mut vector<InnerStruct>)
32: Pop
33: Branch(35)
B4:
34: Branch(17)
B5:
35: Ret
33: Ret
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ key 0x1::coin::CoinStore<0x1::aptos_coin::AptosCoin> {
}
frozen: false
deposit_events: store 0x1::event::EventHandle<0x1::coin::DepositEvent> {
counter: 2
counter: 0
guid: drop store 0x1::guid::GUID {
id: copy drop store 0x1::guid::ID {
creation_num: 2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ Events:
type: 0x3::token::CreateCollection
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b7300006400000000000000"
}
{
key: 0400000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
seq_num: 0
type: 0x3::token::CreateCollectionEvent
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b7300006400000000000000"
}
{
type: 0x1::transaction_fee::FeeStatement
data: "65000000000000000400000000000000030000000000000028720100000000000000000000000000"
Expand All @@ -21,34 +15,16 @@ return values: 0
task 2 'run'. lines 9-9:
Events:
{
type: 0x3::token::CreateTokenData
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00640000000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6010000000000000000000000000000000a6765656b5f746f6b656e0000000000000000"
}
{
key: 0500000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
seq_num: 0
type: 0x3::token::CreateTokenDataEvent
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00640000000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6010000000000000000000000000000000a6765656b5f746f6b656e0000000000000000"
type: 0x3::token::TokenDataCreation
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00640000000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6010000000000000000000000000000000a6765656b5f746f6b656e0000000000000000"
}
{
type: 0x3::token::MintToken
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e0a00000000000000"
type: 0x3::token::Mint
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e0a00000000000000"
}
{
key: 0600000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
seq_num: 0
type: 0x3::token::MintTokenEvent
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e0a00000000000000"
}
{
type: 0x3::token::Deposit
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000a00000000000000"
}
{
key: 0700000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
seq_num: 0
type: 0x3::token::DepositEvent
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000a00000000000000"
type: 0x3::token::TokenDeposit
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000a00000000000000"
}
{
type: 0x1::transaction_fee::FeeStatement
Expand All @@ -65,7 +41,7 @@ key 0x3::token::Collections {
handle: 630c3a2b1a1f2a5a9d112eb98bfe1b35265a16f1482e6224950abd8ad4c76d52
}
create_collection_events: store 0x1::event::EventHandle<0x3::token::CreateCollectionEvent> {
counter: 1
counter: 0
guid: drop store 0x1::guid::GUID {
id: copy drop store 0x1::guid::ID {
creation_num: 4
Expand All @@ -74,7 +50,7 @@ key 0x3::token::Collections {
}
}
create_token_data_events: store 0x1::event::EventHandle<0x3::token::CreateTokenDataEvent> {
counter: 1
counter: 0
guid: drop store 0x1::guid::GUID {
id: copy drop store 0x1::guid::ID {
creation_num: 5
Expand All @@ -83,7 +59,7 @@ key 0x3::token::Collections {
}
}
mint_token_events: store 0x1::event::EventHandle<0x3::token::MintTokenEvent> {
counter: 1
counter: 0
guid: drop store 0x1::guid::GUID {
id: copy drop store 0x1::guid::ID {
creation_num: 6
Expand All @@ -99,56 +75,32 @@ task 4 'view_table'. lines 13-15:
task 5 'run'. lines 16-18:
Events:
{
type: 0x3::token::Withdraw
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
}
{
key: 0800000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
seq_num: 0
type: 0x3::token::WithdrawEvent
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
type: 0x3::token::TokenWithdraw
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
}
{
type: 0x3::token_transfers::TokenOffer
data: "9c3b634ac05d0af393e0f93b9b19b61e7cac1c519f566276aa0c6fd15dac12aaf75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
}
{
key: 0b00000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
seq_num: 0
type: 0x3::token_transfers::TokenOfferEvent
data: "9c3b634ac05d0af393e0f93b9b19b61e7cac1c519f566276aa0c6fd15dac12aaf75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
type: 0x3::token_transfers::Offer
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb69c3b634ac05d0af393e0f93b9b19b61e7cac1c519f566276aa0c6fd15dac12aaf75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
}
{
type: 0x1::transaction_fee::FeeStatement
data: "6c000000000000000600000000000000040000000000000018820100000000000000000000000000"
data: "6c000000000000000500000000000000040000000000000018820100000000000000000000000000"
}mutable inputs after call: local#0: 0
return values: 0

task 6 'run'. lines 19-19:
Events:
{
type: 0x3::token::Deposit
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
}
{
key: 04000000000000009c3b634ac05d0af393e0f93b9b19b61e7cac1c519f566276aa0c6fd15dac12aa
seq_num: 0
type: 0x3::token::DepositEvent
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
}
{
type: 0x3::token_transfers::TokenClaim
type: 0x3::token::TokenDeposit
data: "9c3b634ac05d0af393e0f93b9b19b61e7cac1c519f566276aa0c6fd15dac12aaf75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
}
{
key: 0d00000000000000f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb6
seq_num: 0
type: 0x3::token_transfers::TokenClaimEvent
data: "9c3b634ac05d0af393e0f93b9b19b61e7cac1c519f566276aa0c6fd15dac12aaf75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
type: 0x3::token_transfers::Claim
data: "f75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb69c3b634ac05d0af393e0f93b9b19b61e7cac1c519f566276aa0c6fd15dac12aaf75daa73fc071f93593335eb9033da804777eb94491650dd3f095ce6f778acb60b6170746f735f70756e6b730a6765656b5f746f6b656e00000000000000000100000000000000"
}
{
type: 0x1::transaction_fee::FeeStatement
data: "6c0000000000000006000000000000000400000000000000b88201000000000058bb000000000000"
data: "6c0000000000000005000000000000000400000000000000b88201000000000058bb000000000000"
}mutable inputs after call: local#0: 0
return values: 0

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- [Resource `Account`](#0x1_account_Account)
- [Struct `KeyRotationEvent`](#0x1_account_KeyRotationEvent)
- [Struct `CoinRegisterEvent`](#0x1_account_CoinRegisterEvent)
- [Struct `CoinRegister`](#0x1_account_CoinRegister)
- [Struct `CapabilityOffer`](#0x1_account_CapabilityOffer)
- [Struct `RotationCapability`](#0x1_account_RotationCapability)
- [Struct `SignerCapability`](#0x1_account_SignerCapability)
Expand Down Expand Up @@ -276,6 +277,40 @@ Resource representing an account.
</dl>


</details>

<a id="0x1_account_CoinRegister"></a>

## Struct `CoinRegister`



<pre><code>#[<a href="event.md#0x1_event">event</a>]
<b>struct</b> <a href="account.md#0x1_account_CoinRegister">CoinRegister</a> <b>has</b> drop, store
</code></pre>



<details>
<summary>Fields</summary>


<dl>
<dt>
<code><a href="account.md#0x1_account">account</a>: <b>address</b></code>
</dt>
<dd>

</dd>
<dt>
<code><a href="../../../aptos-stdlib/tests/compiler-v2-doc/type_info.md#0x1_type_info">type_info</a>: <a href="../../../aptos-stdlib/tests/compiler-v2-doc/type_info.md#0x1_type_info_TypeInfo">type_info::TypeInfo</a></code>
</dt>
<dd>

</dd>
</dl>


</details>

<a id="0x1_account_CapabilityOffer"></a>
Expand Down Expand Up @@ -1542,7 +1577,7 @@ Revoke the rotation capability offer given to <code>to_be_revoked_recipient_addr
<pre><code><b>public</b> entry <b>fun</b> <a href="account.md#0x1_account_revoke_rotation_capability">revoke_rotation_capability</a>(<a href="account.md#0x1_account">account</a>: &<a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/signer.md#0x1_signer">signer</a>, to_be_revoked_address: <b>address</b>) <b>acquires</b> <a href="account.md#0x1_account_Account">Account</a> {
<b>assert</b>!(<a href="account.md#0x1_account_exists_at">exists_at</a>(to_be_revoked_address), <a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/error.md#0x1_error_not_found">error::not_found</a>(<a href="account.md#0x1_account_EACCOUNT_DOES_NOT_EXIST">EACCOUNT_DOES_NOT_EXIST</a>));
<b>let</b> addr = <a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/signer.md#0x1_signer_address_of">signer::address_of</a>(<a href="account.md#0x1_account">account</a>);
<b>let</b> account_resource = <b>borrow_global_mut</b>&lt;<a href="account.md#0x1_account_Account">Account</a>&gt;(addr);
<b>let</b> account_resource = <b>borrow_global</b>&lt;<a href="account.md#0x1_account_Account">Account</a>&gt;(addr);
<b>assert</b>!(
<a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/option.md#0x1_option_contains">option::contains</a>(&account_resource.rotation_capability_offer.for, &to_be_revoked_address),
<a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/error.md#0x1_error_not_found">error::not_found</a>(<a href="account.md#0x1_account_ENO_SUCH_ROTATION_CAPABILITY_OFFER">ENO_SUCH_ROTATION_CAPABILITY_OFFER</a>)
Expand Down Expand Up @@ -1712,7 +1747,7 @@ has a signer capability offer from <code><a href="account.md#0x1_account">accoun
<pre><code><b>public</b> entry <b>fun</b> <a href="account.md#0x1_account_revoke_signer_capability">revoke_signer_capability</a>(<a href="account.md#0x1_account">account</a>: &<a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/signer.md#0x1_signer">signer</a>, to_be_revoked_address: <b>address</b>) <b>acquires</b> <a href="account.md#0x1_account_Account">Account</a> {
<b>assert</b>!(<a href="account.md#0x1_account_exists_at">exists_at</a>(to_be_revoked_address), <a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/error.md#0x1_error_not_found">error::not_found</a>(<a href="account.md#0x1_account_EACCOUNT_DOES_NOT_EXIST">EACCOUNT_DOES_NOT_EXIST</a>));
<b>let</b> addr = <a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/signer.md#0x1_signer_address_of">signer::address_of</a>(<a href="account.md#0x1_account">account</a>);
<b>let</b> account_resource = <b>borrow_global_mut</b>&lt;<a href="account.md#0x1_account_Account">Account</a>&gt;(addr);
<b>let</b> account_resource = <b>borrow_global</b>&lt;<a href="account.md#0x1_account_Account">Account</a>&gt;(addr);
<b>assert</b>!(
<a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/option.md#0x1_option_contains">option::contains</a>(&account_resource.signer_capability_offer.for, &to_be_revoked_address),
<a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/error.md#0x1_error_not_found">error::not_found</a>(<a href="account.md#0x1_account_ENO_SUCH_SIGNER_CAPABILITY">ENO_SUCH_SIGNER_CAPABILITY</a>)
Expand Down Expand Up @@ -1889,14 +1924,15 @@ in the event of key recovery.
old_authentication_key: account_resource.authentication_key,
new_authentication_key: new_auth_key_vector,
});
} <b>else</b> {
<a href="event.md#0x1_event_emit_event">event::emit_event</a>&lt;<a href="account.md#0x1_account_KeyRotationEvent">KeyRotationEvent</a>&gt;(
&<b>mut</b> account_resource.key_rotation_events,
<a href="account.md#0x1_account_KeyRotationEvent">KeyRotationEvent</a> {
old_authentication_key: account_resource.authentication_key,
new_authentication_key: new_auth_key_vector,
}
);
};
<a href="event.md#0x1_event_emit_event">event::emit_event</a>&lt;<a href="account.md#0x1_account_KeyRotationEvent">KeyRotationEvent</a>&gt;(
&<b>mut</b> account_resource.key_rotation_events,
<a href="account.md#0x1_account_KeyRotationEvent">KeyRotationEvent</a> {
old_authentication_key: account_resource.authentication_key,
new_authentication_key: new_auth_key_vector,
}
);

// Update the <a href="account.md#0x1_account">account</a> resource's authentication key.
account_resource.authentication_key = new_auth_key_vector;
Expand Down Expand Up @@ -2109,12 +2145,21 @@ Coin management methods.

<pre><code><b>public</b>(<b>friend</b>) <b>fun</b> <a href="account.md#0x1_account_register_coin">register_coin</a>&lt;CoinType&gt;(account_addr: <b>address</b>) <b>acquires</b> <a href="account.md#0x1_account_Account">Account</a> {
<b>let</b> <a href="account.md#0x1_account">account</a> = <b>borrow_global_mut</b>&lt;<a href="account.md#0x1_account_Account">Account</a>&gt;(account_addr);
<a href="event.md#0x1_event_emit_event">event::emit_event</a>&lt;<a href="account.md#0x1_account_CoinRegisterEvent">CoinRegisterEvent</a>&gt;(
&<b>mut</b> <a href="account.md#0x1_account">account</a>.coin_register_events,
<a href="account.md#0x1_account_CoinRegisterEvent">CoinRegisterEvent</a> {
<a href="../../../aptos-stdlib/tests/compiler-v2-doc/type_info.md#0x1_type_info">type_info</a>: <a href="../../../aptos-stdlib/tests/compiler-v2-doc/type_info.md#0x1_type_info_type_of">type_info::type_of</a>&lt;CoinType&gt;(),
},
);
<b>if</b> (std::features::module_event_migration_enabled()) {
<a href="event.md#0x1_event_emit">event::emit</a>(
<a href="account.md#0x1_account_CoinRegister">CoinRegister</a> {
<a href="account.md#0x1_account">account</a>: account_addr,
<a href="../../../aptos-stdlib/tests/compiler-v2-doc/type_info.md#0x1_type_info">type_info</a>: <a href="../../../aptos-stdlib/tests/compiler-v2-doc/type_info.md#0x1_type_info_type_of">type_info::type_of</a>&lt;CoinType&gt;(),
},
);
} <b>else</b> {
<a href="event.md#0x1_event_emit_event">event::emit_event</a>&lt;<a href="account.md#0x1_account_CoinRegisterEvent">CoinRegisterEvent</a>&gt;(
&<b>mut</b> <a href="account.md#0x1_account">account</a>.coin_register_events,
<a href="account.md#0x1_account_CoinRegisterEvent">CoinRegisterEvent</a> {
<a href="../../../aptos-stdlib/tests/compiler-v2-doc/type_info.md#0x1_type_info">type_info</a>: <a href="../../../aptos-stdlib/tests/compiler-v2-doc/type_info.md#0x1_type_info_type_of">type_info::type_of</a>&lt;CoinType&gt;(),
},
);
}
}
</code></pre>

Expand Down Expand Up @@ -2194,7 +2239,7 @@ Capability based functions for efficient use.
signed_message_bytes: <a href="../../../aptos-stdlib/../move-stdlib/tests/compiler-v2-doc/vector.md#0x1_vector">vector</a>&lt;u8&gt;,
message: T,
) <b>acquires</b> <a href="account.md#0x1_account_Account">Account</a> {
<b>let</b> account_resource = <b>borrow_global_mut</b>&lt;<a href="account.md#0x1_account_Account">Account</a>&gt;(<a href="account.md#0x1_account">account</a>);
<b>let</b> account_resource = <b>borrow_global</b>&lt;<a href="account.md#0x1_account_Account">Account</a>&gt;(<a href="account.md#0x1_account">account</a>);
// Verify that the `<a href="account.md#0x1_account_SignerCapabilityOfferProofChallengeV2">SignerCapabilityOfferProofChallengeV2</a>` <b>has</b> the right information and is signed by the <a href="account.md#0x1_account">account</a> owner's key
<b>if</b> (account_scheme == <a href="account.md#0x1_account_ED25519_SCHEME">ED25519_SCHEME</a>) {
<b>let</b> pubkey = <a href="../../../aptos-stdlib/tests/compiler-v2-doc/ed25519.md#0x1_ed25519_new_unvalidated_public_key_from_bytes">ed25519::new_unvalidated_public_key_from_bytes</a>(account_public_key);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -330,10 +330,9 @@ Destroys an aggregator and removes it from its <code>AggregatorFactory</code>.



<pre><code><b>pragma</b> opaque;
<pre><code><b>pragma</b> intrinsic;
// This enforces <a id="high-level-req-1.2" href="#high-level-req">high-level requirement 1</a>:
<b>aborts_if</b> <b>false</b>;
<b>ensures</b> [abstract] result == <a href="aggregator.md#0x1_aggregator_spec_get_limit">spec_get_limit</a>(<a href="aggregator.md#0x1_aggregator">aggregator</a>);
<b>aborts_if</b> [abstract] <b>false</b>;
</code></pre>


Expand Down
Loading

0 comments on commit 321f2eb

Please sign in to comment.