diff --git a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/diamond_clicker.v2_exp b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/diamond_clicker.v2_exp index 53f845c17f340..0a49bf4ec95ce 100644 --- a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/diamond_clicker.v2_exp +++ b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/diamond_clicker.v2_exp @@ -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) 32: Pop - 33: Branch(35) -B4: - 34: Branch(17) -B5: - 35: Ret + 33: Ret } } diff --git a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/execute_script.v2_exp b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/execute_script.v2_exp index 9ad667b2d127d..4e4c52a41593d 100644 --- a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/execute_script.v2_exp +++ b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/execute_script.v2_exp @@ -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 diff --git a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/table.v2_exp b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/table.v2_exp index d313008fc3358..b825359162a65 100644 --- a/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/table.v2_exp +++ b/aptos-move/aptos-transactional-test-harness/tests/aptos_test_harness/table.v2_exp @@ -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" @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/account.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/account.md index 76710e0da3f69..6352f52ac8676 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/account.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/account.md @@ -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) @@ -276,6 +277,40 @@ Resource representing an account. + + + + +## Struct `CoinRegister` + + + +
#[event]
+struct CoinRegister has drop, store
+
+ + + +
+Fields + + +
+
+account: address +
+
+ +
+
+type_info: type_info::TypeInfo +
+
+ +
+
+ +
@@ -1542,7 +1577,7 @@ Revoke the rotation capability offer given to to_be_revoked_recipient_addr
public entry fun revoke_rotation_capability(account: &signer, to_be_revoked_address: address) acquires Account {
     assert!(exists_at(to_be_revoked_address), error::not_found(EACCOUNT_DOES_NOT_EXIST));
     let addr = signer::address_of(account);
-    let account_resource = borrow_global_mut<Account>(addr);
+    let account_resource = borrow_global<Account>(addr);
     assert!(
         option::contains(&account_resource.rotation_capability_offer.for, &to_be_revoked_address),
         error::not_found(ENO_SUCH_ROTATION_CAPABILITY_OFFER)
@@ -1712,7 +1747,7 @@ has a signer capability offer from accoun
 
public entry fun revoke_signer_capability(account: &signer, to_be_revoked_address: address) acquires Account {
     assert!(exists_at(to_be_revoked_address), error::not_found(EACCOUNT_DOES_NOT_EXIST));
     let addr = signer::address_of(account);
-    let account_resource = borrow_global_mut<Account>(addr);
+    let account_resource = borrow_global<Account>(addr);
     assert!(
         option::contains(&account_resource.signer_capability_offer.for, &to_be_revoked_address),
         error::not_found(ENO_SUCH_SIGNER_CAPABILITY)
@@ -1889,14 +1924,15 @@ in the event of key recovery.
             old_authentication_key: account_resource.authentication_key,
             new_authentication_key: new_auth_key_vector,
         });
+    } else {
+        event::emit_event<KeyRotationEvent>(
+            &mut account_resource.key_rotation_events,
+            KeyRotationEvent {
+                old_authentication_key: account_resource.authentication_key,
+                new_authentication_key: new_auth_key_vector,
+            }
+        );
     };
-    event::emit_event<KeyRotationEvent>(
-        &mut account_resource.key_rotation_events,
-        KeyRotationEvent {
-            old_authentication_key: account_resource.authentication_key,
-            new_authentication_key: new_auth_key_vector,
-        }
-    );
 
     // Update the account resource's authentication key.
     account_resource.authentication_key = new_auth_key_vector;
@@ -2109,12 +2145,21 @@ Coin management methods.
 
 
public(friend) fun register_coin<CoinType>(account_addr: address) acquires Account {
     let account = borrow_global_mut<Account>(account_addr);
-    event::emit_event<CoinRegisterEvent>(
-        &mut account.coin_register_events,
-        CoinRegisterEvent {
-            type_info: type_info::type_of<CoinType>(),
-        },
-    );
+    if (std::features::module_event_migration_enabled()) {
+        event::emit(
+            CoinRegister {
+                account: account_addr,
+                type_info: type_info::type_of<CoinType>(),
+            },
+        );
+    } else {
+        event::emit_event<CoinRegisterEvent>(
+            &mut account.coin_register_events,
+            CoinRegisterEvent {
+                type_info: type_info::type_of<CoinType>(),
+            },
+        );
+    }
 }
 
@@ -2194,7 +2239,7 @@ Capability based functions for efficient use. signed_message_bytes: vector<u8>, message: T, ) acquires Account { - let account_resource = borrow_global_mut<Account>(account); + let account_resource = borrow_global<Account>(account); // Verify that the `SignerCapabilityOfferProofChallengeV2` has the right information and is signed by the account owner's key if (account_scheme == ED25519_SCHEME) { let pubkey = ed25519::new_unvalidated_public_key_from_bytes(account_public_key); diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator.md index 4d2bfca013199..be20daf6b83c1 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator.md @@ -330,10 +330,9 @@ Destroys an aggregator and removes it from its AggregatorFactory. -
pragma opaque;
+
pragma intrinsic;
 // This enforces high-level requirement 1:
-aborts_if false;
-ensures [abstract] result == spec_get_limit(aggregator);
+aborts_if [abstract] false;
 
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator_factory.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator_factory.md index 7f92cf43addf1..3dbc43e6c8f8a 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator_factory.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator_factory.md @@ -68,6 +68,15 @@ account can. ## Constants + + + + +
const MAX_U128: u128 = 340282366920938463463374607431768211455;
+
+ + + Aggregator factory is not published yet. @@ -78,6 +87,16 @@ Aggregator factory is not published yet. + + +Aggregator V1 only supports limit == MAX_U128. + + +
const EAGG_V1_LIMIT_DEPRECATED: u64 = 2;
+
+ + + ## Function `initialize_aggregator_factory` @@ -114,7 +133,7 @@ Creates a new factory for aggregators. Can only be called during genesis. Creates a new aggregator instance which overflows on exceeding a limit. -
public(friend) fun create_aggregator_internal(limit: u128): aggregator::Aggregator
+
public(friend) fun create_aggregator_internal(): aggregator::Aggregator
 
@@ -123,14 +142,14 @@ Creates a new aggregator instance which overflows on exceeding a limitImplementation -
public(friend) fun create_aggregator_internal(limit: u128): Aggregator acquires AggregatorFactory {
+
public(friend) fun create_aggregator_internal(): Aggregator acquires AggregatorFactory {
     assert!(
         exists<AggregatorFactory>(@aptos_framework),
         error::not_found(EAGGREGATOR_FACTORY_NOT_FOUND)
     );
 
     let aggregator_factory = borrow_global_mut<AggregatorFactory>(@aptos_framework);
-    new_aggregator(aggregator_factory, limit)
+    new_aggregator(aggregator_factory, MAX_U128)
 }
 
@@ -146,7 +165,8 @@ This is currently a function closed for public. This can be updated in the futur to allow any signer to call. -
public fun create_aggregator(account: &signer, limit: u128): aggregator::Aggregator
+
#[deprecated]
+public fun create_aggregator(account: &signer, limit: u128): aggregator::Aggregator
 
@@ -156,9 +176,15 @@ to allow any signer to call.
public fun create_aggregator(account: &signer, limit: u128): Aggregator acquires AggregatorFactory {
+    // deprecated. Currently used only in aptos-move/e2e-move-tests/src/tests/aggregator.data/pack/sources/aggregator_test.move
+
     // Only Aptos Framework (0x1) account can call this for now.
     system_addresses::assert_aptos_framework(account);
-    create_aggregator_internal(limit)
+    assert!(
+        limit == MAX_U128,
+        error::invalid_argument(EAGG_V1_LIMIT_DEPRECATED)
+    );
+    create_aggregator_internal()
 }
 
@@ -279,7 +305,7 @@ AggregatorFactory is not under the caller before creating the resource. ### Function `create_aggregator_internal` -
public(friend) fun create_aggregator_internal(limit: u128): aggregator::Aggregator
+
public(friend) fun create_aggregator_internal(): aggregator::Aggregator
 
@@ -287,7 +313,7 @@ AggregatorFactory is not under the caller before creating the resource.
// This enforces high-level requirement 2:
 include CreateAggregatorInternalAbortsIf;
-ensures aggregator::spec_get_limit(result) == limit;
+ensures aggregator::spec_get_limit(result) == MAX_U128;
 ensures aggregator::spec_aggregator_get_val(result) == 0;
 
@@ -309,7 +335,8 @@ AggregatorFactory is not under the caller before creating the resource. ### Function `create_aggregator` -
public fun create_aggregator(account: &signer, limit: u128): aggregator::Aggregator
+
#[deprecated]
+public fun create_aggregator(account: &signer, limit: u128): aggregator::Aggregator
 
@@ -320,6 +347,7 @@ AggregatorFactory existed under the @aptos_framework when Creating a new aggrega
let addr = signer::address_of(account);
 // This enforces high-level requirement 3:
 aborts_if addr != @aptos_framework;
+aborts_if limit != MAX_U128;
 aborts_if !exists<AggregatorFactory>(@aptos_framework);
 
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator_v2.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator_v2.md index 70e859a72b509..d5de489dfce6d 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator_v2.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aggregator_v2.md @@ -50,10 +50,14 @@ read, read_snapshot, read_derived_string - [Function `copy_snapshot`](#0x1_aggregator_v2_copy_snapshot) - [Function `string_concat`](#0x1_aggregator_v2_string_concat) - [Specification](#@Specification_1) + - [Struct `Aggregator`](#@Specification_1_Aggregator) + - [Function `max_value`](#@Specification_1_max_value) - [Function `create_aggregator`](#@Specification_1_create_aggregator) - [Function `create_unbounded_aggregator`](#@Specification_1_create_unbounded_aggregator) - [Function `try_add`](#@Specification_1_try_add) + - [Function `add`](#@Specification_1_add) - [Function `try_sub`](#@Specification_1_try_sub) + - [Function `sub`](#@Specification_1_sub) - [Function `is_at_least_impl`](#@Specification_1_is_at_least_impl) - [Function `read`](#@Specification_1_read) - [Function `snapshot`](#@Specification_1_snapshot) @@ -221,7 +225,7 @@ and any calls will raise this error. -Arguments passed to concat exceed max limit of 256 bytes (for prefix and suffix together). +Arguments passed to concat exceed max limit of 1024 bytes (for prefix and suffix together).
const ECONCAT_STRING_LENGTH_TOO_LARGE: u64 = 8;
@@ -709,7 +713,7 @@ Useful for when object is sometimes created via string_concat(), and sometimes d
 Concatenates before, snapshot and after into a single string.
 snapshot passed needs to have integer type - currently supported types are u64 and u128.
 Raises EUNSUPPORTED_AGGREGATOR_SNAPSHOT_TYPE if called with another type.
-If length of prefix and suffix together exceed 256 bytes, ECONCAT_STRING_LENGTH_TOO_LARGE is raised.
+If length of prefix and suffix together exceeds 1024 bytes, ECONCAT_STRING_LENGTH_TOO_LARGE is raised.
 
 Parallelism info: This operation enables parallelism.
 
@@ -783,6 +787,94 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
 ## Specification
 
 
+
+
+
+
+
native fun spec_get_max_value<IntElement>(aggregator: Aggregator<IntElement>): IntElement;
+
+ + + + + + + +
fun spec_get_string_value<IntElement>(aggregator: AggregatorSnapshot<IntElement>): String;
+
+ + + + + + + +
fun spec_read_snapshot<IntElement>(snapshot: AggregatorSnapshot<IntElement>): IntElement {
+   snapshot.value
+}
+
+ + + + + + + +
fun spec_read_derived_string(snapshot: DerivedStringSnapshot): String {
+   snapshot.value
+}
+
+ + + + + +### Struct `Aggregator` + + +
struct Aggregator<IntElement> has drop, store
+
+ + + +
+
+value: IntElement +
+
+ +
+
+max_value: IntElement +
+
+ +
+
+ + + +
pragma intrinsic;
+
+ + + + + +### Function `max_value` + + +
public fun max_value<IntElement: copy, drop>(aggregator: &aggregator_v2::Aggregator<IntElement>): IntElement
+
+ + + + +
pragma intrinsic;
+
+ + + ### Function `create_aggregator` @@ -794,7 +886,7 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI -
pragma opaque;
+
pragma intrinsic;
 
@@ -810,7 +902,7 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI -
pragma opaque;
+
pragma intrinsic;
 
@@ -826,7 +918,23 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI -
pragma opaque;
+
pragma intrinsic;
+
+ + + + + +### Function `add` + + +
public fun add<IntElement>(aggregator: &mut aggregator_v2::Aggregator<IntElement>, value: IntElement)
+
+ + + + +
pragma intrinsic;
 
@@ -842,7 +950,23 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI -
pragma opaque;
+
pragma intrinsic;
+
+ + + + + +### Function `sub` + + +
public fun sub<IntElement>(aggregator: &mut aggregator_v2::Aggregator<IntElement>, value: IntElement)
+
+ + + + +
pragma intrinsic;
 
@@ -858,7 +982,7 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI -
pragma opaque;
+
pragma intrinsic;
 
@@ -874,7 +998,7 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI -
pragma opaque;
+
pragma intrinsic;
 
@@ -891,6 +1015,8 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
pragma opaque;
+include AbortsIfIntElement<IntElement>;
+ensures [abstract] result.value == spec_get_value(aggregator);
 
@@ -907,6 +1033,8 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
pragma opaque;
+include AbortsIfIntElement<IntElement>;
+ensures [abstract] result.value == value;
 
@@ -923,6 +1051,8 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
pragma opaque;
+include AbortsIfIntElement<IntElement>;
+ensures [abstract] result == snapshot.value;
 
@@ -939,6 +1069,8 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
pragma opaque;
+aborts_if [abstract] false;
+ensures [abstract] result == snapshot.value;
 
@@ -955,6 +1087,8 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
pragma opaque;
+aborts_if [abstract] len(value.bytes) > 1024;
+ensures [abstract] result.value == value;
 
@@ -971,6 +1105,20 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
pragma opaque;
+include AbortsIfIntElement<IntElement>;
+ensures [abstract] result.value.bytes == concat(before.bytes, concat(spec_get_string_value(snapshot).bytes, after.bytes));
+aborts_if [abstract] len(before.bytes) + len(after.bytes) > 1024;
+
+ + + + + + + +
schema AbortsIfIntElement<IntElement> {
+    aborts_if [abstract] type_info::type_name<IntElement>().bytes != b"u64" && type_info::type_name<IntElement>().bytes != b"u128";
+}
 
@@ -988,6 +1136,7 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
pragma opaque;
+aborts_if [abstract] true;
 
@@ -1005,6 +1154,16 @@ DEPRECATED, use derive_string_concat() instead. always raises EAGGREGATOR_FUNCTI
pragma opaque;
+aborts_if [abstract] true;
+
+ + + + + + + +
native fun spec_get_value<IntElement>(aggregator: Aggregator<IntElement>): IntElement;
 
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aptos_account.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aptos_account.md index dbc4f7b687c04..246c00cda1402 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aptos_account.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aptos_account.md @@ -15,6 +15,9 @@ - [Function `batch_transfer_coins`](#0x1_aptos_account_batch_transfer_coins) - [Function `transfer_coins`](#0x1_aptos_account_transfer_coins) - [Function `deposit_coins`](#0x1_aptos_account_deposit_coins) +- [Function `batch_transfer_fungible_assets`](#0x1_aptos_account_batch_transfer_fungible_assets) +- [Function `transfer_fungible_assets`](#0x1_aptos_account_transfer_fungible_assets) +- [Function `deposit_fungible_assets`](#0x1_aptos_account_deposit_fungible_assets) - [Function `assert_account_exists`](#0x1_aptos_account_assert_account_exists) - [Function `assert_account_is_registered_for_apt`](#0x1_aptos_account_assert_account_is_registered_for_apt) - [Function `set_allow_direct_coin_transfers`](#0x1_aptos_account_set_allow_direct_coin_transfers) @@ -34,6 +37,9 @@ - [Function `batch_transfer_coins`](#@Specification_1_batch_transfer_coins) - [Function `transfer_coins`](#@Specification_1_transfer_coins) - [Function `deposit_coins`](#@Specification_1_deposit_coins) + - [Function `batch_transfer_fungible_assets`](#@Specification_1_batch_transfer_fungible_assets) + - [Function `transfer_fungible_assets`](#@Specification_1_transfer_fungible_assets) + - [Function `deposit_fungible_assets`](#@Specification_1_deposit_fungible_assets) - [Function `assert_account_exists`](#@Specification_1_assert_account_exists) - [Function `assert_account_is_registered_for_apt`](#@Specification_1_assert_account_is_registered_for_apt) - [Function `set_allow_direct_coin_transfers`](#@Specification_1_set_allow_direct_coin_transfers) @@ -411,6 +417,100 @@ This would create the recipient account first and register it to receive the Coi + + + + +## Function `batch_transfer_fungible_assets` + +Batch version of transfer_fungible_assets. + + +
public entry fun batch_transfer_fungible_assets(from: &signer, metadata: object::Object<fungible_asset::Metadata>, recipients: vector<address>, amounts: vector<u64>)
+
+ + + +
+Implementation + + +
public entry fun batch_transfer_fungible_assets(
+    from: &signer,
+    metadata: Object<Metadata>,
+    recipients: vector<address>,
+    amounts: vector<u64>
+) {
+    let recipients_len = vector::length(&recipients);
+    assert!(
+        recipients_len == vector::length(&amounts),
+        error::invalid_argument(EMISMATCHING_RECIPIENTS_AND_AMOUNTS_LENGTH),
+    );
+
+    vector::enumerate_ref(&recipients, |i, to| {
+        let amount = *vector::borrow(&amounts, i);
+        transfer_fungible_assets(from, metadata, *to, amount);
+    });
+}
+
+ + + +
+ + + +## Function `transfer_fungible_assets` + +Convenient function to deposit fungible asset into a recipient account that might not exist. +This would create the recipient account first to receive the fungible assets. + + +
public entry fun transfer_fungible_assets(from: &signer, metadata: object::Object<fungible_asset::Metadata>, to: address, amount: u64)
+
+ + + +
+Implementation + + +
public entry fun transfer_fungible_assets(from: &signer, metadata: Object<Metadata>, to: address, amount: u64) {
+    deposit_fungible_assets(to, primary_fungible_store::withdraw(from, metadata, amount));
+}
+
+ + + +
+ + + +## Function `deposit_fungible_assets` + +Convenient function to deposit fungible asset into a recipient account that might not exist. +This would create the recipient account first to receive the fungible assets. + + +
public fun deposit_fungible_assets(to: address, fa: fungible_asset::FungibleAsset)
+
+ + + +
+Implementation + + +
public fun deposit_fungible_assets(to: address, fa: FungibleAsset) {
+    if (!account::exists_at(to)) {
+        create_account(to);
+    };
+    primary_fungible_store::deposit(to, fa)
+}
+
+ + +
@@ -491,10 +591,11 @@ Set whether account can receiv if (std::features::module_event_migration_enabled()) { emit(DirectCoinTransferConfigUpdated { account: addr, new_allow_direct_transfers: allow }); + } else { + emit_event( + &mut direct_transfer_config.update_coin_transfer_events, + DirectCoinTransferConfigUpdatedEvent { new_allow_direct_transfers: allow }); }; - emit_event( - &mut direct_transfer_config.update_coin_transfer_events, - DirectCoinTransferConfigUpdatedEvent { new_allow_direct_transfers: allow }); } else { let direct_transfer_config = DirectTransferConfig { allow_arbitrary_coin_transfers: allow, @@ -502,10 +603,11 @@ Set whether account can receiv }; if (std::features::module_event_migration_enabled()) { emit(DirectCoinTransferConfigUpdated { account: addr, new_allow_direct_transfers: allow }); + } else { + emit_event( + &mut direct_transfer_config.update_coin_transfer_events, + DirectCoinTransferConfigUpdatedEvent { new_allow_direct_transfers: allow }); }; - emit_event( - &mut direct_transfer_config.update_coin_transfer_events, - DirectCoinTransferConfigUpdatedEvent { new_allow_direct_transfers: allow }); move_to(account, direct_transfer_config); }; } @@ -1022,6 +1124,54 @@ Limit the address of auth_key is not @vm_reserved / @aptos_framework / @aptos_to + + +### Function `batch_transfer_fungible_assets` + + +
public entry fun batch_transfer_fungible_assets(from: &signer, metadata: object::Object<fungible_asset::Metadata>, recipients: vector<address>, amounts: vector<u64>)
+
+ + + + +
pragma verify = false;
+
+ + + + + +### Function `transfer_fungible_assets` + + +
public entry fun transfer_fungible_assets(from: &signer, metadata: object::Object<fungible_asset::Metadata>, to: address, amount: u64)
+
+ + + + +
pragma verify = false;
+
+ + + + + +### Function `deposit_fungible_assets` + + +
public fun deposit_fungible_assets(to: address, fa: fungible_asset::FungibleAsset)
+
+ + + + +
pragma verify = false;
+
+ + + ### Function `assert_account_exists` diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aptos_governance.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aptos_governance.md index 1a666013b1907..64445190ff092 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aptos_governance.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/aptos_governance.md @@ -944,16 +944,17 @@ AptosGovernance. voting_duration_secs }, ) + } else { + let events = borrow_global_mut<GovernanceEvents>(@aptos_framework); + event::emit_event<UpdateConfigEvent>( + &mut events.update_config_events, + UpdateConfigEvent { + min_voting_threshold, + required_proposer_stake, + voting_duration_secs + }, + ); }; - let events = borrow_global_mut<GovernanceEvents>(@aptos_framework); - event::emit_event<UpdateConfigEvent>( - &mut events.update_config_events, - UpdateConfigEvent { - min_voting_threshold, - required_proposer_stake, - voting_duration_secs - }, - ); }
@@ -1318,18 +1319,19 @@ Return proposal_id when a proposal is successfully created. proposal_metadata, }, ); + } else { + let events = borrow_global_mut<GovernanceEvents>(@aptos_framework); + event::emit_event<CreateProposalEvent>( + &mut events.create_proposal_events, + CreateProposalEvent { + proposal_id, + proposer: proposer_address, + stake_pool, + execution_hash, + proposal_metadata, + }, + ); }; - let events = borrow_global_mut<GovernanceEvents>(@aptos_framework); - event::emit_event<CreateProposalEvent>( - &mut events.create_proposal_events, - CreateProposalEvent { - proposal_id, - proposer: proposer_address, - stake_pool, - execution_hash, - proposal_metadata, - }, - ); proposal_id }
@@ -1546,18 +1548,19 @@ cannot vote on the proposal even after partial governance voting is enabled. should_pass, }, ); + } else { + let events = borrow_global_mut<GovernanceEvents>(@aptos_framework); + event::emit_event<VoteEvent>( + &mut events.vote_events, + VoteEvent { + proposal_id, + voter: voter_address, + stake_pool, + num_votes: voting_power, + should_pass, + }, + ); }; - let events = borrow_global_mut<GovernanceEvents>(@aptos_framework); - event::emit_event<VoteEvent>( - &mut events.vote_events, - VoteEvent { - proposal_id, - voter: voter_address, - stake_pool, - num_votes: voting_power, - should_pass, - }, - ); let proposal_state = voting::get_proposal_state<GovernanceProposal>(@aptos_framework, proposal_id); if (proposal_state == PROPOSAL_STATE_SUCCEEDED) { @@ -2151,7 +2154,9 @@ Address @aptos_framework must exist GovernanceConfig and GovernanceEvents. let post new_governance_config = global<GovernanceConfig>(@aptos_framework); aborts_if addr != @aptos_framework; aborts_if !exists<GovernanceConfig>(@aptos_framework); -aborts_if !exists<GovernanceEvents>(@aptos_framework); +aborts_if !features::spec_is_enabled(features::MODULE_EVENT_MIGRATION) && !exists<GovernanceEvents>( + @aptos_framework +); modifies global<GovernanceConfig>(addr); ensures new_governance_config.voting_duration_secs == voting_duration_secs; ensures new_governance_config.min_voting_threshold == min_voting_threshold; @@ -2449,6 +2454,80 @@ The same as spec of + + +
schema CreateProposalAbortsIf {
+    proposer: &signer;
+    stake_pool: address;
+    execution_hash: vector<u8>;
+    metadata_location: vector<u8>;
+    metadata_hash: vector<u8>;
+    include VotingGetDelegatedVoterAbortsIf { sign: proposer };
+    include AbortsIfNotGovernanceConfig;
+    include GetVotingPowerAbortsIf { pool_address: stake_pool };
+    let staking_config = global<staking_config::StakingConfig>(@aptos_framework);
+    let allow_validator_set_change = staking_config.allow_validator_set_change;
+    let stake_pool_res = global<stake::StakePool>(stake_pool);
+    let stake_balance_0 = stake_pool_res.active.value + stake_pool_res.pending_active.value + stake_pool_res.pending_inactive.value;
+    let stake_balance_1 = stake_pool_res.active.value + stake_pool_res.pending_inactive.value;
+    let stake_balance_2 = 0;
+    let governance_config = global<GovernanceConfig>(@aptos_framework);
+    let required_proposer_stake = governance_config.required_proposer_stake;
+    // This enforces high-level requirement 2:
+    aborts_if allow_validator_set_change && stake_balance_0 < required_proposer_stake;
+    aborts_if !allow_validator_set_change && stake::spec_is_current_epoch_validator(stake_pool) && stake_balance_1 < required_proposer_stake;
+    aborts_if !allow_validator_set_change && !stake::spec_is_current_epoch_validator(stake_pool) && stake_balance_2 < required_proposer_stake;
+    aborts_if !exists<timestamp::CurrentTimeMicroseconds>(@aptos_framework);
+    let current_time = timestamp::spec_now_seconds();
+    let proposal_expiration = current_time + governance_config.voting_duration_secs;
+    aborts_if stake_pool_res.locked_until_secs < proposal_expiration;
+    include CreateProposalMetadataAbortsIf;
+    let addr = aptos_std::type_info::type_of<AptosCoin>().account_address;
+    aborts_if !exists<coin::CoinInfo<AptosCoin>>(addr);
+    let maybe_supply = global<coin::CoinInfo<AptosCoin>>(addr).supply;
+    let supply = option::spec_borrow(maybe_supply);
+    let total_supply = aptos_framework::optional_aggregator::optional_aggregator_value(supply);
+    let early_resolution_vote_threshold_value = total_supply / 2 + 1;
+    aborts_if option::spec_is_some(maybe_supply) && governance_config.min_voting_threshold > early_resolution_vote_threshold_value;
+    aborts_if len(execution_hash) == 0;
+    aborts_if !exists<voting::VotingForum<GovernanceProposal>>(@aptos_framework);
+    let voting_forum = global<voting::VotingForum<GovernanceProposal>>(@aptos_framework);
+    let proposal_id = voting_forum.next_proposal_id;
+    aborts_if proposal_id + 1 > MAX_U64;
+    let post post_voting_forum = global<voting::VotingForum<GovernanceProposal>>(@aptos_framework);
+    let post post_next_proposal_id = post_voting_forum.next_proposal_id;
+    ensures post_next_proposal_id == proposal_id + 1;
+    aborts_if !string::spec_internal_check_utf8(voting::IS_MULTI_STEP_PROPOSAL_KEY);
+    aborts_if !string::spec_internal_check_utf8(voting::IS_MULTI_STEP_PROPOSAL_IN_EXECUTION_KEY);
+    aborts_if table::spec_contains(voting_forum.proposals,proposal_id);
+    ensures table::spec_contains(post_voting_forum.proposals, proposal_id);
+    aborts_if !exists<GovernanceEvents>(@aptos_framework);
+}
+
+ + + + + + + +
schema VotingGetDelegatedVoterAbortsIf {
+    stake_pool: address;
+    sign: signer;
+    let addr = signer::address_of(sign);
+    let stake_pool_res = global<stake::StakePool>(stake_pool);
+    aborts_if !exists<stake::StakePool>(stake_pool);
+    aborts_if stake_pool_res.delegated_voter != addr;
+}
+
+ + @@ -2897,9 +2976,7 @@ Address @aptos_framework must exist ApprovedExecutionHashes and GovernancePropos framework: aptos_framework }; include stake::GetReconfigStartTimeRequirement; -include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply; requires chain_status::is_operating(); -requires exists<stake::ValidatorFees>(@aptos_framework); requires exists<CoinInfo<AptosCoin>>(@aptos_framework); requires exists<staking_config::StakingRewardsConfig>(@aptos_framework); include staking_config::StakingRewardsConfigRequirement; @@ -2974,9 +3051,7 @@ Address @aptos_framework must exist GovernanceConfig and GovernanceEvents. framework: aptos_framework }; include stake::GetReconfigStartTimeRequirement; -include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply; requires chain_status::is_operating(); -requires exists<stake::ValidatorFees>(@aptos_framework); requires exists<CoinInfo<AptosCoin>>(@aptos_framework); requires exists<staking_config::StakingRewardsConfig>(@aptos_framework); include staking_config::StakingRewardsConfigRequirement; diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/block.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/block.md index 5e56a8eac0dc7..908cd95b0b1c1 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/block.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/block.md @@ -54,7 +54,6 @@ This module defines a struct storing the metadata of the block and new block eve use 0x1::system_addresses; use 0x1::table_with_length; use 0x1::timestamp; -use 0x1::transaction_fee;
@@ -513,11 +512,12 @@ Can only be called as part of the Aptos governance proposal process established event::emit( UpdateEpochInterval { old_epoch_interval, new_epoch_interval }, ); + } else { + event::emit_event<UpdateEpochIntervalEvent>( + &mut block_resource.update_epoch_interval_events, + UpdateEpochIntervalEvent { old_epoch_interval, new_epoch_interval }, + ); }; - event::emit_event<UpdateEpochIntervalEvent>( - &mut block_resource.update_epoch_interval_events, - UpdateEpochIntervalEvent { old_epoch_interval, new_epoch_interval }, - ); }
@@ -593,7 +593,6 @@ Return epoch interval in seconds. let block_metadata_ref = borrow_global_mut<BlockResource>(@aptos_framework); block_metadata_ref.height = event::counter(&block_metadata_ref.new_block_events); - // Emit both event v1 and v2 for compatibility. Eventually only module events will be kept. let new_block_event = NewBlockEvent { hash, epoch, @@ -604,26 +603,7 @@ Return epoch interval in seconds. failed_proposer_indices, time_microseconds: timestamp, }; - let new_block_event_v2 = NewBlock { - hash, - epoch, - round, - height: block_metadata_ref.height, - previous_block_votes_bitvec, - proposer, - failed_proposer_indices, - time_microseconds: timestamp, - }; - emit_new_block_event(vm, &mut block_metadata_ref.new_block_events, new_block_event, new_block_event_v2); - - if (features::collect_and_distribute_gas_fees()) { - // Assign the fees collected from the previous block to the previous block proposer. - // If for any reason the fees cannot be assigned, this function burns the collected coins. - transaction_fee::process_collected_fees(); - // Set the proposer of this block as the receiver of the fees, so that the fees for this - // block are assigned to the right account. - transaction_fee::register_proposer_for_fee_collection(proposer); - }; + emit_new_block_event(vm, &mut block_metadata_ref.new_block_events, new_block_event); // Performance scores have to be updated before the epoch transition as the transaction that triggers the // transition is the last block in the previous epoch. @@ -759,7 +739,7 @@ Get the current block height Emit the event and update height and global timestamp -
fun emit_new_block_event(vm: &signer, event_handle: &mut event::EventHandle<block::NewBlockEvent>, new_block_event: block::NewBlockEvent, new_block_event_v2: block::NewBlock)
+
fun emit_new_block_event(vm: &signer, event_handle: &mut event::EventHandle<block::NewBlockEvent>, new_block_event: block::NewBlockEvent)
 
@@ -772,7 +752,6 @@ Emit the event and update height and global timestamp vm: &signer, event_handle: &mut EventHandle<NewBlockEvent>, new_block_event: NewBlockEvent, - new_block_event_v2: NewBlock ) acquires CommitHistory { if (exists<CommitHistory>(@aptos_framework)) { let commit_history_ref = borrow_global_mut<CommitHistory>(@aptos_framework); @@ -791,9 +770,6 @@ Emit the event and update height and global timestamp event::counter(event_handle) == new_block_event.height, error::invalid_argument(ENUM_NEW_BLOCK_EVENTS_DOES_NOT_MATCH_BLOCK_HEIGHT), ); - if (std::features::module_event_migration_enabled()) { - event::emit(new_block_event_v2); - }; event::emit_event<NewBlockEvent>(event_handle, new_block_event); }
@@ -835,16 +811,6 @@ reconfiguration event. failed_proposer_indices: vector::empty(), time_microseconds: 0, }, - NewBlock { - hash: genesis_id, - epoch: 0, - round: 0, - height: 0, - previous_block_votes_bitvec: vector::empty(), - proposer: @vm_reserved, - failed_proposer_indices: vector::empty(), - time_microseconds: 0, - } ); }
@@ -888,16 +854,6 @@ new block event for WriteSetPayload. failed_proposer_indices: vector::empty(), time_microseconds: timestamp::now_microseconds(), }, - NewBlock { - hash: fake_block_hash, - epoch: reconfiguration::current_epoch(), - round: MAX_U64, - height: block_metadata_ref.height, - previous_block_votes_bitvec: vector::empty(), - proposer: @vm_reserved, - failed_proposer_indices: vector::empty(), - time_microseconds: timestamp::now_microseconds(), - } ); }
@@ -1088,6 +1044,68 @@ The number of new events created does not exceed MAX_U64. + + + + +
schema BlockRequirement {
+    vm: signer;
+    hash: address;
+    epoch: u64;
+    round: u64;
+    proposer: address;
+    failed_proposer_indices: vector<u64>;
+    previous_block_votes_bitvec: vector<u8>;
+    timestamp: u64;
+    requires chain_status::is_operating();
+    requires system_addresses::is_vm(vm);
+    // This enforces high-level requirement 4:
+    requires proposer == @vm_reserved || stake::spec_is_current_epoch_validator(proposer);
+    requires (proposer == @vm_reserved) ==> (timestamp::spec_now_microseconds() == timestamp);
+    requires (proposer != @vm_reserved) ==> (timestamp::spec_now_microseconds() < timestamp);
+    requires exists<CoinInfo<AptosCoin>>(@aptos_framework);
+    include staking_config::StakingRewardsConfigRequirement;
+}
+
+ + + + + + + +
schema Initialize {
+    aptos_framework: signer;
+    epoch_interval_microsecs: u64;
+    let addr = signer::address_of(aptos_framework);
+    // This enforces high-level requirement 2:
+    aborts_if addr != @aptos_framework;
+    aborts_if epoch_interval_microsecs == 0;
+    aborts_if exists<BlockResource>(addr);
+    aborts_if exists<CommitHistory>(addr);
+    ensures exists<BlockResource>(addr);
+    ensures exists<CommitHistory>(addr);
+    ensures global<BlockResource>(addr).height == 0;
+}
+
+ + + + + + + +
schema NewEventHandle {
+    aptos_framework: signer;
+    let addr = signer::address_of(aptos_framework);
+    let account = global<account::Account>(addr);
+    aborts_if !exists<account::Account>(addr);
+    aborts_if account.guid_creation_num + 2 > MAX_U64;
+}
+
+ + + ### Function `update_epoch_interval_microsecs` @@ -1224,7 +1242,7 @@ The BlockResource existed under the @aptos_framework. ### Function `emit_new_block_event` -
fun emit_new_block_event(vm: &signer, event_handle: &mut event::EventHandle<block::NewBlockEvent>, new_block_event: block::NewBlockEvent, new_block_event_v2: block::NewBlock)
+
fun emit_new_block_event(vm: &signer, event_handle: &mut event::EventHandle<block::NewBlockEvent>, new_block_event: block::NewBlockEvent)
 
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/coin.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/coin.md index f232014d2925e..2a7bff1d84289 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/coin.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/coin.md @@ -53,13 +53,7 @@ This module provides the foundation for typesafe Coins. - [Function `convert_and_take_paired_burn_ref`](#0x1_coin_convert_and_take_paired_burn_ref) - [Function `return_paired_burn_ref`](#0x1_coin_return_paired_burn_ref) - [Function `borrow_paired_burn_ref`](#0x1_coin_borrow_paired_burn_ref) -- [Function `initialize_supply_config`](#0x1_coin_initialize_supply_config) - [Function `allow_supply_upgrades`](#0x1_coin_allow_supply_upgrades) -- [Function `initialize_aggregatable_coin`](#0x1_coin_initialize_aggregatable_coin) -- [Function `is_aggregatable_coin_zero`](#0x1_coin_is_aggregatable_coin_zero) -- [Function `drain_aggregatable_coin`](#0x1_coin_drain_aggregatable_coin) -- [Function `merge_aggregatable_coin`](#0x1_coin_merge_aggregatable_coin) -- [Function `collect_into_aggregatable_coin`](#0x1_coin_collect_into_aggregatable_coin) - [Function `calculate_amount_to_withdraw`](#0x1_coin_calculate_amount_to_withdraw) - [Function `maybe_convert_to_fungible_store`](#0x1_coin_maybe_convert_to_fungible_store) - [Function `migrate_to_fungible_store`](#0x1_coin_migrate_to_fungible_store) @@ -107,13 +101,7 @@ This module provides the foundation for typesafe Coins. - [Struct `AggregatableCoin`](#@Specification_1_AggregatableCoin) - [Function `coin_to_fungible_asset`](#@Specification_1_coin_to_fungible_asset) - [Function `fungible_asset_to_coin`](#@Specification_1_fungible_asset_to_coin) - - [Function `initialize_supply_config`](#@Specification_1_initialize_supply_config) - [Function `allow_supply_upgrades`](#@Specification_1_allow_supply_upgrades) - - [Function `initialize_aggregatable_coin`](#@Specification_1_initialize_aggregatable_coin) - - [Function `is_aggregatable_coin_zero`](#@Specification_1_is_aggregatable_coin_zero) - - [Function `drain_aggregatable_coin`](#@Specification_1_drain_aggregatable_coin) - - [Function `merge_aggregatable_coin`](#@Specification_1_merge_aggregatable_coin) - - [Function `collect_into_aggregatable_coin`](#@Specification_1_collect_into_aggregatable_coin) - [Function `maybe_convert_to_fungible_store`](#@Specification_1_maybe_convert_to_fungible_store) - [Function `coin_address`](#@Specification_1_coin_address) - [Function `balance`](#@Specification_1_balance) @@ -148,7 +136,6 @@ This module provides the foundation for typesafe Coins.
use 0x1::account;
 use 0x1::aggregator;
-use 0x1::aggregator_factory;
 use 0x1::create_signer;
 use 0x1::error;
 use 0x1::event;
@@ -201,12 +188,11 @@ Main structure representing a coin/token in an account's custody.
 
 ## Struct `AggregatableCoin`
 
-Represents a coin with aggregator as its value. This allows to update
-the coin in every transaction avoiding read-modify-write conflicts. Only
-used for gas fees distribution by Aptos Framework (0x1).
+DEPRECATED
 
 
-
struct AggregatableCoin<CoinType> has store
+
#[deprecated]
+struct AggregatableCoin<CoinType> has store
 
@@ -282,7 +268,8 @@ Configuration that controls the behavior of total coin supply. If the field is set, coin creators are allowed to upgrade to parallelizable implementations. -
struct SupplyConfig has key
+
#[deprecated]
+struct SupplyConfig has key
 
@@ -1000,16 +987,6 @@ Maximum possible aggregatable coin value. - - -Maximum possible coin supply. - - -
const MAX_U128: u128 = 340282366920938463463374607431768211455;
-
- - - Not enough coins to complete transaction @@ -1963,7 +1940,7 @@ Return the BurnRef with the hot potato receipt. let metadata = assert_paired_metadata_exists<CoinType>(); let metadata_addr = object_address(&metadata); assert!(exists<PairedFungibleAssetRefs>(metadata_addr), error::internal(EPAIRED_FUNGIBLE_ASSET_REFS_NOT_FOUND)); - let burn_ref_opt = &mut borrow_global_mut<PairedFungibleAssetRefs>(metadata_addr).burn_ref_opt; + let burn_ref_opt = &borrow_global<PairedFungibleAssetRefs>(metadata_addr).burn_ref_opt; assert!(option::is_some(burn_ref_opt), error::not_found(EBURN_REF_NOT_FOUND)); option::borrow(burn_ref_opt) } @@ -1971,32 +1948,6 @@ Return the BurnRef with the hot potato receipt. - - - - -## Function `initialize_supply_config` - -Publishes supply configuration. Initially, upgrading is not allowed. - - -
public(friend) fun initialize_supply_config(aptos_framework: &signer)
-
- - - -
-Implementation - - -
public(friend) fun initialize_supply_config(aptos_framework: &signer) {
-    system_addresses::assert_aptos_framework(aptos_framework);
-    move_to(aptos_framework, SupplyConfig { allow_upgrades: false });
-}
-
- - -
@@ -2007,63 +1958,7 @@ This should be called by on-chain governance to update the config and allow or disallow upgradability of total supply. -
public fun allow_supply_upgrades(aptos_framework: &signer, allowed: bool)
-
- - - -
-Implementation - - -
public fun allow_supply_upgrades(aptos_framework: &signer, allowed: bool) acquires SupplyConfig {
-    system_addresses::assert_aptos_framework(aptos_framework);
-    let allow_upgrades = &mut borrow_global_mut<SupplyConfig>(@aptos_framework).allow_upgrades;
-    *allow_upgrades = allowed;
-}
-
- - - -
- - - -## Function `initialize_aggregatable_coin` - -Creates a new aggregatable coin with value overflowing on limit. Note that this function can -only be called by Aptos Framework (0x1) account for now because of create_aggregator. - - -
public(friend) fun initialize_aggregatable_coin<CoinType>(aptos_framework: &signer): coin::AggregatableCoin<CoinType>
-
- - - -
-Implementation - - -
public(friend) fun initialize_aggregatable_coin<CoinType>(aptos_framework: &signer): AggregatableCoin<CoinType> {
-    let aggregator = aggregator_factory::create_aggregator(aptos_framework, MAX_U64);
-    AggregatableCoin<CoinType> {
-        value: aggregator,
-    }
-}
-
- - - -
- - - -## Function `is_aggregatable_coin_zero` - -Returns true if the value of aggregatable coin is zero. - - -
public(friend) fun is_aggregatable_coin_zero<CoinType>(coin: &coin::AggregatableCoin<CoinType>): bool
+
public fun allow_supply_upgrades(_aptos_framework: &signer, _allowed: bool)
 
@@ -2072,137 +1967,8 @@ Returns true if the value of aggregatable coin is zero. Implementation -
public(friend) fun is_aggregatable_coin_zero<CoinType>(coin: &AggregatableCoin<CoinType>): bool {
-    let amount = aggregator::read(&coin.value);
-    amount == 0
-}
-
- - - - - - - -## Function `drain_aggregatable_coin` - -Drains the aggregatable coin, setting it to zero and returning a standard coin. - - -
public(friend) fun drain_aggregatable_coin<CoinType>(coin: &mut coin::AggregatableCoin<CoinType>): coin::Coin<CoinType>
-
- - - -
-Implementation - - -
public(friend) fun drain_aggregatable_coin<CoinType>(coin: &mut AggregatableCoin<CoinType>): Coin<CoinType> {
-    spec {
-        // TODO: The data invariant is not properly assumed from CollectedFeesPerBlock.
-        assume aggregator::spec_get_limit(coin.value) == MAX_U64;
-    };
-    let amount = aggregator::read(&coin.value);
-    assert!(amount <= MAX_U64, error::out_of_range(EAGGREGATABLE_COIN_VALUE_TOO_LARGE));
-    spec {
-        update aggregate_supply<CoinType> = aggregate_supply<CoinType> - amount;
-    };
-    aggregator::sub(&mut coin.value, amount);
-    spec {
-        update supply<CoinType> = supply<CoinType> + amount;
-    };
-    Coin<CoinType> {
-        value: (amount as u64),
-    }
-}
-
- - - -
- - - -## Function `merge_aggregatable_coin` - -Merges coin into aggregatable coin (dst_coin). - - -
public(friend) fun merge_aggregatable_coin<CoinType>(dst_coin: &mut coin::AggregatableCoin<CoinType>, coin: coin::Coin<CoinType>)
-
- - - -
-Implementation - - -
public(friend) fun merge_aggregatable_coin<CoinType>(
-    dst_coin: &mut AggregatableCoin<CoinType>,
-    coin: Coin<CoinType>
-) {
-    spec {
-        update supply<CoinType> = supply<CoinType> - coin.value;
-    };
-    let Coin { value } = coin;
-    let amount = (value as u128);
-    spec {
-        update aggregate_supply<CoinType> = aggregate_supply<CoinType> + amount;
-    };
-    aggregator::add(&mut dst_coin.value, amount);
-}
-
- - - -
- - - -## Function `collect_into_aggregatable_coin` - -Collects a specified amount of coin form an account into aggregatable coin. - - -
public(friend) fun collect_into_aggregatable_coin<CoinType>(account_addr: address, amount: u64, dst_coin: &mut coin::AggregatableCoin<CoinType>)
-
- - - -
-Implementation - - -
public(friend) fun collect_into_aggregatable_coin<CoinType>(
-    account_addr: address,
-    amount: u64,
-    dst_coin: &mut AggregatableCoin<CoinType>,
-) acquires CoinStore, CoinConversionMap, CoinInfo, PairedCoinType {
-    // Skip collecting if amount is zero.
-    if (amount == 0) {
-        return
-    };
-
-    let (coin_amount_to_collect, fa_amount_to_collect) = calculate_amount_to_withdraw<CoinType>(
-        account_addr,
-        amount
-    );
-    let coin = if (coin_amount_to_collect > 0) {
-        let coin_store = borrow_global_mut<CoinStore<CoinType>>(account_addr);
-        extract(&mut coin_store.coin, coin_amount_to_collect)
-    } else {
-        zero()
-    };
-    if (fa_amount_to_collect > 0) {
-        let store_addr = primary_fungible_store::primary_store_address(
-            account_addr,
-            option::destroy_some(paired_metadata<CoinType>())
-        );
-        let fa = fungible_asset::withdraw_internal(store_addr, fa_amount_to_collect);
-        merge(&mut coin, fungible_asset_to_coin<CoinType>(fa));
-    };
-    merge_aggregatable_coin(dst_coin, coin);
+
public fun allow_supply_upgrades(_aptos_framework: &signer, _allowed: bool) {
+    abort error::invalid_state(ECOIN_SUPPLY_UPGRADE_NOT_SUPPORTED)
 }
 
@@ -2815,11 +2581,12 @@ Deposit the coin balance into the recipient's account and emit an event. event::emit( CoinDeposit { coin_type: type_name<CoinType>(), account: account_addr, amount: coin.value } ); + } else { + event::emit_event<DepositEvent>( + &mut coin_store.deposit_events, + DepositEvent { amount: coin.value }, + ); }; - event::emit_event<DepositEvent>( - &mut coin_store.deposit_events, - DepositEvent { amount: coin.value }, - ); merge(&mut coin_store.coin, coin); } else { let metadata = paired_metadata<CoinType>(); @@ -3080,7 +2847,7 @@ Upgrade total supply to use a parallelizable implementation if it is available. -
public entry fun upgrade_supply<CoinType>(account: &signer)
+
public entry fun upgrade_supply<CoinType>(_account: &signer)
 
@@ -3089,30 +2856,8 @@ available. Implementation -
public entry fun upgrade_supply<CoinType>(account: &signer) acquires CoinInfo, SupplyConfig {
-    let account_addr = signer::address_of(account);
-
-    // Only coin creators can upgrade total supply.
-    assert!(
-        coin_address<CoinType>() == account_addr,
-        error::invalid_argument(ECOIN_INFO_ADDRESS_MISMATCH),
-    );
-
-    // Can only succeed once on-chain governance agreed on the upgrade.
-    assert!(
-        borrow_global_mut<SupplyConfig>(@aptos_framework).allow_upgrades,
-        error::permission_denied(ECOIN_SUPPLY_UPGRADE_NOT_SUPPORTED)
-    );
-
-    let maybe_supply = &mut borrow_global_mut<CoinInfo<CoinType>>(account_addr).supply;
-    if (option::is_some(maybe_supply)) {
-        let supply = option::borrow_mut(maybe_supply);
-
-        // If supply is tracked and the current implementation uses an integer - upgrade.
-        if (!optional_aggregator::is_parallelizable(supply)) {
-            optional_aggregator::switch(supply);
-        }
-    }
+
public entry fun upgrade_supply<CoinType>(_account: &signer) {
+    abort error::invalid_state(ECOIN_SUPPLY_UPGRADE_NOT_SUPPORTED)
 }
 
@@ -3229,7 +2974,7 @@ Same as initialize but supply can be initialized to parallelizable decimals, supply: if (monitor_supply) { option::some( - optional_aggregator::new(MAX_U128, parallelizable) + optional_aggregator::new(parallelizable) ) } else { option::none() }, }; @@ -3439,11 +3184,12 @@ Withdraw specified amount of coin CoinType from the si coin_type: type_name<CoinType>(), account: account_addr, amount: coin_amount_to_withdraw } ); + } else { + event::emit_event<WithdrawEvent>( + &mut coin_store.withdraw_events, + WithdrawEvent { amount: coin_amount_to_withdraw }, + ); }; - event::emit_event<WithdrawEvent>( - &mut coin_store.withdraw_events, - WithdrawEvent { amount: coin_amount_to_withdraw }, - ); extract(&mut coin_store.coin, coin_amount_to_withdraw) } else { zero() @@ -3814,70 +3560,13 @@ initialize, initialize_internal, initialize_with_parallelizable_supply; - - - - -
fun spec_is_account_registered<CoinType>(account_addr: address): bool {
-   let paired_metadata_opt = spec_paired_metadata<CoinType>();
-   exists<CoinStore<CoinType>>(account_addr) || (option::spec_is_some(
-       paired_metadata_opt
-   ) && primary_fungible_store::spec_primary_store_exists(account_addr, option::spec_borrow(paired_metadata_opt)))
-}
-
- - - - - - - -
schema CoinSubAbortsIf<CoinType> {
-    amount: u64;
-    let addr = type_info::type_of<CoinType>().account_address;
-    let maybe_supply = global<CoinInfo<CoinType>>(addr).supply;
-    include (option::is_some(
-        maybe_supply
-    )) ==> optional_aggregator::SubAbortsIf { optional_aggregator: option::borrow(maybe_supply), value: amount };
-}
-
- - - - - - - -
schema CoinAddAbortsIf<CoinType> {
-    amount: u64;
-    let addr = type_info::type_of<CoinType>().account_address;
-    let maybe_supply = global<CoinInfo<CoinType>>(addr).supply;
-    include (option::is_some(
-        maybe_supply
-    )) ==> optional_aggregator::AddAbortsIf { optional_aggregator: option::borrow(maybe_supply), value: amount };
-}
-
- - - - - - - -
schema AbortsIfNotExistCoinInfo<CoinType> {
-    let addr = type_info::type_of<CoinType>().account_address;
-    aborts_if !exists<CoinInfo<CoinType>>(addr);
-}
-
- - - ### Struct `AggregatableCoin` -
struct AggregatableCoin<CoinType> has store
+
#[deprecated]
+struct AggregatableCoin<CoinType> has store
 
@@ -3932,147 +3621,19 @@ initialize, initialize_internal, initialize_with_parallelizable_supply; - - -### Function `initialize_supply_config` - - -
public(friend) fun initialize_supply_config(aptos_framework: &signer)
-
- - -Can only be initialized once. -Can only be published by reserved addresses. - - -
let aptos_addr = signer::address_of(aptos_framework);
-aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
-aborts_if exists<SupplyConfig>(aptos_addr);
-ensures !global<SupplyConfig>(aptos_addr).allow_upgrades;
-ensures exists<SupplyConfig>(aptos_addr);
-
- - - ### Function `allow_supply_upgrades` -
public fun allow_supply_upgrades(aptos_framework: &signer, allowed: bool)
+
public fun allow_supply_upgrades(_aptos_framework: &signer, _allowed: bool)
 
Can only be updated by @aptos_framework. -
modifies global<SupplyConfig>(@aptos_framework);
-let aptos_addr = signer::address_of(aptos_framework);
-aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
-aborts_if !exists<SupplyConfig>(aptos_addr);
-let post allow_upgrades_post = global<SupplyConfig>(@aptos_framework);
-ensures allow_upgrades_post.allow_upgrades == allowed;
-
- - - - - -### Function `initialize_aggregatable_coin` - - -
public(friend) fun initialize_aggregatable_coin<CoinType>(aptos_framework: &signer): coin::AggregatableCoin<CoinType>
-
- - - - -
include system_addresses::AbortsIfNotAptosFramework { account: aptos_framework };
-include aggregator_factory::CreateAggregatorInternalAbortsIf;
-
- - - - - -### Function `is_aggregatable_coin_zero` - - -
public(friend) fun is_aggregatable_coin_zero<CoinType>(coin: &coin::AggregatableCoin<CoinType>): bool
-
- - - - -
aborts_if false;
-ensures result == (aggregator::spec_read(coin.value) == 0);
-
- - - - - -### Function `drain_aggregatable_coin` - - -
public(friend) fun drain_aggregatable_coin<CoinType>(coin: &mut coin::AggregatableCoin<CoinType>): coin::Coin<CoinType>
-
- - - - -
aborts_if aggregator::spec_read(coin.value) > MAX_U64;
-ensures result.value == aggregator::spec_aggregator_get_val(old(coin).value);
-
- - - - - -### Function `merge_aggregatable_coin` - - -
public(friend) fun merge_aggregatable_coin<CoinType>(dst_coin: &mut coin::AggregatableCoin<CoinType>, coin: coin::Coin<CoinType>)
-
- - - - -
let aggr = dst_coin.value;
-let post p_aggr = dst_coin.value;
-aborts_if aggregator::spec_aggregator_get_val(aggr)
-    + coin.value > aggregator::spec_get_limit(aggr);
-aborts_if aggregator::spec_aggregator_get_val(aggr)
-    + coin.value > MAX_U128;
-ensures aggregator::spec_aggregator_get_val(aggr) + coin.value == aggregator::spec_aggregator_get_val(p_aggr);
-
- - - - - -### Function `collect_into_aggregatable_coin` - - -
public(friend) fun collect_into_aggregatable_coin<CoinType>(account_addr: address, amount: u64, dst_coin: &mut coin::AggregatableCoin<CoinType>)
-
- - - - -
pragma verify = false;
-let aggr = dst_coin.value;
-let post p_aggr = dst_coin.value;
-let coin_store = global<CoinStore<CoinType>>(account_addr);
-let post p_coin_store = global<CoinStore<CoinType>>(account_addr);
-aborts_if amount > 0 && !exists<CoinStore<CoinType>>(account_addr);
-aborts_if amount > 0 && coin_store.coin.value < amount;
-aborts_if amount > 0 && aggregator::spec_aggregator_get_val(aggr)
-    + amount > aggregator::spec_get_limit(aggr);
-aborts_if amount > 0 && aggregator::spec_aggregator_get_val(aggr)
-    + amount > MAX_U128;
-ensures aggregator::spec_aggregator_get_val(aggr) + amount == aggregator::spec_aggregator_get_val(p_aggr);
-ensures coin_store.coin.value - amount == p_coin_store.coin.value;
+
aborts_if true;
 
@@ -4215,6 +3776,64 @@ Get address by reflection. + + + + +
fun spec_is_account_registered<CoinType>(account_addr: address): bool {
+   let paired_metadata_opt = spec_paired_metadata<CoinType>();
+   exists<CoinStore<CoinType>>(account_addr) || (option::spec_is_some(
+       paired_metadata_opt
+   ) && primary_fungible_store::spec_primary_store_exists(account_addr, option::spec_borrow(paired_metadata_opt)))
+}
+
+ + + + + + + +
schema CoinSubAbortsIf<CoinType> {
+    amount: u64;
+    let addr = type_info::type_of<CoinType>().account_address;
+    let maybe_supply = global<CoinInfo<CoinType>>(addr).supply;
+    include (option::is_some(
+        maybe_supply
+    )) ==> optional_aggregator::SubAbortsIf { optional_aggregator: option::borrow(maybe_supply), value: amount };
+}
+
+ + + + + + + +
schema CoinAddAbortsIf<CoinType> {
+    amount: u64;
+    let addr = type_info::type_of<CoinType>().account_address;
+    let maybe_supply = global<CoinInfo<CoinType>>(addr).supply;
+    include (option::is_some(
+        maybe_supply
+    )) ==> optional_aggregator::AddAbortsIf { optional_aggregator: option::borrow(maybe_supply), value: amount };
+}
+
+ + + + + + + +
schema AbortsIfNotExistCoinInfo<CoinType> {
+    let addr = type_info::type_of<CoinType>().account_address;
+    aborts_if !exists<CoinInfo<CoinType>>(addr);
+}
+
+ + + ### Function `name` @@ -4519,7 +4138,7 @@ The value of zero_coin must be 0. ### Function `upgrade_supply` -
public entry fun upgrade_supply<CoinType>(account: &signer)
+
public entry fun upgrade_supply<CoinType>(_account: &signer)
 
@@ -4527,26 +4146,7 @@ The creator of CoinType must be @aptos_framework. SupplyConfig allow upgrade. -
let account_addr = signer::address_of(account);
-let coin_address = type_info::type_of<CoinType>().account_address;
-aborts_if coin_address != account_addr;
-aborts_if !exists<SupplyConfig>(@aptos_framework);
-// This enforces high-level requirement 1:
-aborts_if !exists<CoinInfo<CoinType>>(account_addr);
-let supply_config = global<SupplyConfig>(@aptos_framework);
-aborts_if !supply_config.allow_upgrades;
-modifies global<CoinInfo<CoinType>>(account_addr);
-let maybe_supply = global<CoinInfo<CoinType>>(account_addr).supply;
-let supply = option::spec_borrow(maybe_supply);
-let value = optional_aggregator::optional_aggregator_value(supply);
-let post post_maybe_supply = global<CoinInfo<CoinType>>(account_addr).supply;
-let post post_supply = option::spec_borrow(post_maybe_supply);
-let post post_value = optional_aggregator::optional_aggregator_value(post_supply);
-let supply_no_parallel = option::spec_is_some(maybe_supply) &&
-    !optional_aggregator::is_parallelizable(supply);
-aborts_if supply_no_parallel && !exists<aggregator_factory::AggregatorFactory>(@aptos_framework);
-ensures supply_no_parallel ==>
-    optional_aggregator::is_parallelizable(post_supply) && post_value == value;
+
aborts_if true;
 
@@ -4646,7 +4246,7 @@ Only the creator of CoinType can initialize. && coin_info.symbol == symbol && coin_info.decimals == decimals; ensures if (monitor_supply) { - value == 0 && limit == MAX_U128 + value == 0 && limit == MAX_U128 && (parallelizable == optional_aggregator::is_parallelizable(supply)) } else { option::spec_is_none(coin_info.supply) diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/consensus_config.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/consensus_config.md index d8f4179edd006..135965f75f104 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/consensus_config.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/consensus_config.md @@ -348,7 +348,6 @@ When setting now time must be later than last_reconfiguration_time.
pragma verify_duration_estimate = 600;
-include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
 include staking_config::StakingRewardsConfigRequirement;
 let addr = signer::address_of(account);
 // This enforces high-level requirement 2:
@@ -358,7 +357,6 @@ When setting now time must be later than last_reconfiguration_time.
 aborts_if !(len(config) > 0);
 requires chain_status::is_genesis();
 requires timestamp::spec_now_microseconds() >= reconfiguration::last_reconfiguration_time();
-requires exists<stake::ValidatorFees>(@aptos_framework);
 requires exists<CoinInfo<AptosCoin>>(@aptos_framework);
 ensures global<ConsensusConfig>(@aptos_framework).config == config;
 
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/delegation_pool.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/delegation_pool.md index 01029999242fe..2c76b2804a4ec 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/delegation_pool.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/delegation_pool.md @@ -2976,18 +2976,18 @@ Vote on a proposal with a voter's voting power. To successfully vote, the follow should_pass, } ); + } else { + event::emit_event( + &mut governance_records.vote_events, + VoteEvent { + voter: voter_address, + proposal_id, + delegation_pool: pool_address, + num_votes: voting_power, + should_pass, + } + ); }; - - event::emit_event( - &mut governance_records.vote_events, - VoteEvent { - voter: voter_address, - proposal_id, - delegation_pool: pool_address, - num_votes: voting_power, - should_pass, - } - ); }
@@ -3053,16 +3053,16 @@ voting power in THIS delegation pool must be not less than the minimum required delegation_pool: pool_address, } ); + } else { + event::emit_event( + &mut governance_records.create_proposal_events, + CreateProposalEvent { + proposal_id, + voter: voter_addr, + delegation_pool: pool_address, + } + ); }; - - event::emit_event( - &mut governance_records.create_proposal_events, - CreateProposalEvent { - proposal_id, - voter: voter_addr, - delegation_pool: pool_address, - } - ); }
@@ -4020,13 +4020,13 @@ this change won't take effects until the next lockup period. delegator: delegator_address, voter: new_voter, }) + } else { + event::emit_event(&mut governance_records.delegate_voting_power_events, DelegateVotingPowerEvent { + pool_address, + delegator: delegator_address, + voter: new_voter, + }); }; - - event::emit_event(&mut governance_records.delegate_voting_power_events, DelegateVotingPowerEvent { - pool_address, - delegator: delegator_address, - voter: new_voter, - }); }
@@ -4277,17 +4277,17 @@ Add amount of coins to the delegation pool pool_addresselse { + event::emit_event( + &mut pool.add_stake_events, + AddStakeEvent { + pool_address, + delegator_address, + amount_added: amount, + add_stake_fee, + }, + ); }; - - event::emit_event( - &mut pool.add_stake_events, - AddStakeEvent { - pool_address, - delegator_address, - amount_added: amount, - add_stake_fee, - }, - ); }
@@ -4380,16 +4380,16 @@ at most how much active stake there is on the stake pool. amount_unlocked: amount, }, ); + } else { + event::emit_event( + &mut pool.unlock_stake_events, + UnlockStakeEvent { + pool_address, + delegator_address, + amount_unlocked: amount, + }, + ); }; - - event::emit_event( - &mut pool.unlock_stake_events, - UnlockStakeEvent { - pool_address, - delegator_address, - amount_unlocked: amount, - }, - ); }
@@ -4450,16 +4450,16 @@ Move amount of coins from pending_inactive to active. amount_reactivated: amount, }, ); + } else { + event::emit_event( + &mut pool.reactivate_stake_events, + ReactivateStakeEvent { + pool_address, + delegator_address, + amount_reactivated: amount, + }, + ); }; - - event::emit_event( - &mut pool.reactivate_stake_events, - ReactivateStakeEvent { - pool_address, - delegator_address, - amount_reactivated: amount, - }, - ); }
@@ -4575,16 +4575,16 @@ Withdraw amount of owned inactive stake from the delegation pool at amount_withdrawn: amount, }, ); + } else { + event::emit_event( + &mut pool.withdraw_stake_events, + WithdrawStakeEvent { + pool_address, + delegator_address, + amount_withdrawn: amount, + }, + ); }; - - event::emit_event( - &mut pool.withdraw_stake_events, - WithdrawStakeEvent { - pool_address, - delegator_address, - amount_withdrawn: amount, - }, - ); }
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/execution_config.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/execution_config.md index 27d894d51a795..5702e22e171b2 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/execution_config.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/execution_config.md @@ -202,9 +202,7 @@ When setting now time must be later than last_reconfiguration_time.
pragma verify_duration_estimate = 600;
 let addr = signer::address_of(account);
-include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
 requires chain_status::is_genesis();
-requires exists<stake::ValidatorFees>(@aptos_framework);
 requires exists<staking_config::StakingRewardsConfig>(@aptos_framework);
 requires len(config) > 0;
 include features::spec_periodical_reward_rate_decrease_enabled() ==> staking_config::StakingRewardsConfigEnabledRequirement;
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/gas_schedule.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/gas_schedule.md
index 5ff6876819e9e..08b4c314e373d 100644
--- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/gas_schedule.md
+++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/gas_schedule.md
@@ -525,10 +525,8 @@ Only used in reconfigurations to apply the pending stake::ValidatorFees>(@aptos_framework);
 requires exists<CoinInfo<AptosCoin>>(@aptos_framework);
 requires chain_status::is_genesis();
-include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
 include staking_config::StakingRewardsConfigRequirement;
 // This enforces high-level requirement 2:
 include system_addresses::AbortsIfNotAptosFramework{ account: aptos_framework };
@@ -621,10 +619,8 @@ Only used in reconfigurations to apply the pending stake::ValidatorFees>(@aptos_framework);
 requires exists<CoinInfo<AptosCoin>>(@aptos_framework);
 include system_addresses::AbortsIfNotAptosFramework{ account: aptos_framework };
-include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
 include staking_config::StakingRewardsConfigRequirement;
 aborts_if !exists<StorageGasConfig>(@aptos_framework);
 ensures global<StorageGasConfig>(@aptos_framework) == config;
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/genesis.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/genesis.md
index 3136d00fa3994..b9895b4393743 100644
--- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/genesis.md
+++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/genesis.md
@@ -355,7 +355,6 @@ Genesis step 1: Initialize aptos framework account and core modules on chain.
 
     // Ensure we can create aggregators for supply, but not enable it for common use just yet.
     aggregator_factory::initialize_aggregator_factory(&aptos_framework_account);
-    coin::initialize_supply_config(&aptos_framework_account);
 
     chain_id::initialize(&aptos_framework_account, chain_id);
     reconfiguration::initialize(&aptos_framework_account);
@@ -1062,10 +1061,8 @@ The last step of genesis.
     requires chain_status::is_operating();
     requires len(execution_config) > 0;
     requires exists<staking_config::StakingRewardsConfig>(@aptos_framework);
-    requires exists<stake::ValidatorFees>(@aptos_framework);
     requires exists<coin::CoinInfo<AptosCoin>>(@aptos_framework);
     include CompareTimeRequires;
-    include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
 }
 
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/jwks.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/jwks.md index 347eeed64b94c..1818ab3902cec 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/jwks.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/jwks.md @@ -30,6 +30,7 @@ have a simple layout which is easily accessible in Rust. - [Resource `FederatedJWKs`](#0x1_jwks_FederatedJWKs) - [Constants](#@Constants_0) - [Function `patch_federated_jwks`](#0x1_jwks_patch_federated_jwks) +- [Function `update_federated_jwk_set`](#0x1_jwks_update_federated_jwk_set) - [Function `get_patched_jwk`](#0x1_jwks_get_patched_jwk) - [Function `try_get_patched_jwk`](#0x1_jwks_try_get_patched_jwk) - [Function `upsert_oidc_provider`](#0x1_jwks_upsert_oidc_provider) @@ -660,6 +661,15 @@ JWKs for federated keyless accounts are stored in this resource. + + + + +
const EINVALID_FEDERATED_JWK_SET: u64 = 9;
+
+ + + @@ -775,11 +785,8 @@ Note: If too large, validators waste work reading it for invalid TXN signatures. ## Function `patch_federated_jwks` Called by a federated keyless dapp owner to install the JWKs for the federated OIDC provider (e.g., Auth0, AWS -Cognito, etc). - -For type-safety, we explicitly use a struct FederatedJWKs { jwks: AllProviderJWKs } instead of -reusing PatchedJWKs { jwks: AllProviderJWKs }, which is a JWK-consensus-specific struct. We'd -need to be careful how we read it in Rust (but BCS serialization should be the same). +Cognito, etc). For type-safety, we explicitly use a struct FederatedJWKs { jwks: AllProviderJWKs } instead of +reusing PatchedJWKs { jwks: AllProviderJWKs }, which is a JWK-consensus-specific struct.
public fun patch_federated_jwks(jwk_owner: &signer, patches: vector<jwks::Patch>)
@@ -816,6 +823,100 @@ need to be careful how we read it in Rust (but BCS serialization should be the s
 
 
 
+
+ + + +## Function `update_federated_jwk_set` + +This can be called to install or update a set of JWKs for a federated OIDC provider. This function should +be invoked to intially install a set of JWKs or to update a set of JWKs when a keypair is rotated. + +The iss parameter is the value of the iss claim on the JWTs that are to be verified by the JWK set. +kid_vec, alg_vec, e_vec, n_vec are String vectors of the JWK attributes kid, alg, e and n respectively. +See https://datatracker.ietf.org/doc/html/rfc7517#section-4 for more details about the JWK attributes aforementioned. + +For the example JWK set snapshot below containing 2 keys for Google found at https://www.googleapis.com/oauth2/v3/certs - +```json +{ +"keys": [ +{ +"alg": "RS256", +"use": "sig", +"kty": "RSA", +"n": "wNHgGSG5B5xOEQNFPW2p_6ZxZbfPoAU5VceBUuNwQWLop0ohW0vpoZLU1tAsq_S9s5iwy27rJw4EZAOGBR9oTRq1Y6Li5pDVJfmzyRNtmWCWndR-bPqhs_dkJU7MbGwcvfLsN9FSHESFrS9sfGtUX-lZfLoGux23TKdYV9EE-H-NDASxrVFUk2GWc3rL6UEMWrMnOqV9-tghybDU3fcRdNTDuXUr9qDYmhmNegYjYu4REGjqeSyIG1tuQxYpOBH-tohtcfGY-oRTS09kgsSS9Q5BRM4qqCkGP28WhlSf4ui0-norS0gKMMI1P_ZAGEsLn9p2TlYMpewvIuhjJs1thw", +"kid": "d7b939771a7800c413f90051012d975981916d71", +"e": "AQAB" +}, +{ +"kty": "RSA", +"kid": "b2620d5e7f132b52afe8875cdf3776c064249d04", +"alg": "RS256", +"n": "pi22xDdK2fz5gclIbDIGghLDYiRO56eW2GUcboeVlhbAuhuT5mlEYIevkxdPOg5n6qICePZiQSxkwcYMIZyLkZhSJ2d2M6Szx2gDtnAmee6o_tWdroKu0DjqwG8pZU693oLaIjLku3IK20lTs6-2TeH-pUYMjEqiFMhn-hb7wnvH_FuPTjgz9i0rEdw_Hf3Wk6CMypaUHi31y6twrMWq1jEbdQNl50EwH-RQmQ9bs3Wm9V9t-2-_Jzg3AT0Ny4zEDU7WXgN2DevM8_FVje4IgztNy29XUkeUctHsr-431_Iu23JIy6U4Kxn36X3RlVUKEkOMpkDD3kd81JPW4Ger_w", +"e": "AQAB", +"use": "sig" +} +] +} +``` + +We can call update_federated_jwk_set for Google's iss - "https://accounts.google.com" and for each vector +argument kid_vec, alg_vec, e_vec, n_vec, we set in index 0 the corresponding attribute in the first JWK and we set in index 1 the +the corresponding attribute in the second JWK as shown below. + +```move +use std::string::utf8; +aptos_framework::jwks::update_federated_jwk_set( +jwk_owner, +b"https://accounts.google.com", +vector[utf8(b"d7b939771a7800c413f90051012d975981916d71"), utf8(b"b2620d5e7f132b52afe8875cdf3776c064249d04")], +vector[utf8(b"RS256"), utf8(b"RS256")], +vector[utf8(b"AQAB"), utf8(b"AQAB")], +vector[ +utf8(b"wNHgGSG5B5xOEQNFPW2p_6ZxZbfPoAU5VceBUuNwQWLop0ohW0vpoZLU1tAsq_S9s5iwy27rJw4EZAOGBR9oTRq1Y6Li5pDVJfmzyRNtmWCWndR-bPqhs_dkJU7MbGwcvfLsN9FSHESFrS9sfGtUX-lZfLoGux23TKdYV9EE-H-NDASxrVFUk2GWc3rL6UEMWrMnOqV9-tghybDU3fcRdNTDuXUr9qDYmhmNegYjYu4REGjqeSyIG1tuQxYpOBH-tohtcfGY-oRTS09kgsSS9Q5BRM4qqCkGP28WhlSf4ui0-norS0gKMMI1P_ZAGEsLn9p2TlYMpewvIuhjJs1thw"), +utf8(b"pi22xDdK2fz5gclIbDIGghLDYiRO56eW2GUcboeVlhbAuhuT5mlEYIevkxdPOg5n6qICePZiQSxkwcYMIZyLkZhSJ2d2M6Szx2gDtnAmee6o_tWdroKu0DjqwG8pZU693oLaIjLku3IK20lTs6-2TeH-pUYMjEqiFMhn-hb7wnvH_FuPTjgz9i0rEdw_Hf3Wk6CMypaUHi31y6twrMWq1jEbdQNl50EwH-RQmQ9bs3Wm9V9t-2-_Jzg3AT0Ny4zEDU7WXgN2DevM8_FVje4IgztNy29XUkeUctHsr-431_Iu23JIy6U4Kxn36X3RlVUKEkOMpkDD3kd81JPW4Ger_w") +] +) +``` + +See AIP-96 for more details about federated keyless - https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-96.md + +NOTE: Currently only RSA keys are supported. + + +
public entry fun update_federated_jwk_set(jwk_owner: &signer, iss: vector<u8>, kid_vec: vector<string::String>, alg_vec: vector<string::String>, e_vec: vector<string::String>, n_vec: vector<string::String>)
+
+ + + +
+Implementation + + +
public entry fun update_federated_jwk_set(jwk_owner: &signer, iss: vector<u8>, kid_vec: vector<String>, alg_vec: vector<String>, e_vec: vector<String>, n_vec: vector<String>) acquires FederatedJWKs {
+    assert!(!vector::is_empty(&kid_vec), error::invalid_argument(EINVALID_FEDERATED_JWK_SET));
+    let num_jwk = vector::length<String>(&kid_vec);
+    assert!(vector::length(&alg_vec) == num_jwk , error::invalid_argument(EINVALID_FEDERATED_JWK_SET));
+    assert!(vector::length(&e_vec) == num_jwk, error::invalid_argument(EINVALID_FEDERATED_JWK_SET));
+    assert!(vector::length(&n_vec) == num_jwk, error::invalid_argument(EINVALID_FEDERATED_JWK_SET));
+
+    let remove_all_patch = new_patch_remove_all();
+    let patches = vector[remove_all_patch];
+    while (!vector::is_empty(&kid_vec)) {
+        let kid = vector::pop_back(&mut kid_vec);
+        let alg = vector::pop_back(&mut alg_vec);
+        let e = vector::pop_back(&mut e_vec);
+        let n = vector::pop_back(&mut n_vec);
+        let jwk = new_rsa_jwk(kid, alg, e, n);
+        let patch = new_patch_upsert_jwk(iss, jwk);
+        vector::push_back(&mut patches, patch)
+    };
+    patch_federated_jwks(jwk_owner, patches);
+}
+
+ + +
@@ -937,7 +1038,7 @@ aptos_framework::aptos_governance::reconfigure(&framework_signer); let provider_set = if (config_buffer::does_exist<SupportedOIDCProviders>()) { config_buffer::extract<SupportedOIDCProviders>() } else { - *borrow_global_mut<SupportedOIDCProviders>(@aptos_framework) + *borrow_global<SupportedOIDCProviders>(@aptos_framework) }; let old_config_url = remove_oidc_provider_internal(&mut provider_set, name); @@ -1012,7 +1113,7 @@ aptos_framework::aptos_governance::reconfigure(&framework_signer); let provider_set = if (config_buffer::does_exist<SupportedOIDCProviders>()) { config_buffer::extract<SupportedOIDCProviders>() } else { - *borrow_global_mut<SupportedOIDCProviders>(@aptos_framework) + *borrow_global<SupportedOIDCProviders>(@aptos_framework) }; let ret = remove_oidc_provider_internal(&mut provider_set, name); config_buffer::upsert(provider_set); diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/managed_coin.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/managed_coin.md index b6d1c90017f0f..e7b2847e08fd0 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/managed_coin.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/managed_coin.md @@ -14,6 +14,8 @@ By utilizing this current module, a developer can create his own coin and care l - [Function `initialize`](#0x1_managed_coin_initialize) - [Function `mint`](#0x1_managed_coin_mint) - [Function `register`](#0x1_managed_coin_register) +- [Function `destroy_caps`](#0x1_managed_coin_destroy_caps) +- [Function `remove_caps`](#0x1_managed_coin_remove_caps) - [Specification](#@Specification_1) - [High-level Requirements](#high-level-req) - [Module-level Specification](#module-level-spec) @@ -21,6 +23,8 @@ By utilizing this current module, a developer can create his own coin and care l - [Function `initialize`](#@Specification_1_initialize) - [Function `mint`](#@Specification_1_mint) - [Function `register`](#@Specification_1_register) + - [Function `destroy_caps`](#@Specification_1_destroy_caps) + - [Function `remove_caps`](#@Specification_1_remove_caps)
use 0x1::coin;
@@ -231,6 +235,72 @@ Required if user wants to start accepting deposits of CoinType in h
 
 
 
+
+
+
+
+## Function `destroy_caps`
+
+Destroys capabilities from the account, so that the user no longer has access to mint or burn.
+
+
+
public entry fun destroy_caps<CoinType>(account: &signer)
+
+ + + +
+Implementation + + +
public entry fun destroy_caps<CoinType>(account: &signer) acquires Capabilities {
+    let (burn_cap, freeze_cap, mint_cap) = remove_caps<CoinType>(account);
+    destroy_burn_cap(burn_cap);
+    destroy_freeze_cap(freeze_cap);
+    destroy_mint_cap(mint_cap);
+}
+
+ + + +
+ + + +## Function `remove_caps` + +Removes capabilities from the account to be stored or destroyed elsewhere + + +
public fun remove_caps<CoinType>(account: &signer): (coin::BurnCapability<CoinType>, coin::FreezeCapability<CoinType>, coin::MintCapability<CoinType>)
+
+ + + +
+Implementation + + +
public fun remove_caps<CoinType>(
+    account: &signer
+): (BurnCapability<CoinType>, FreezeCapability<CoinType>, MintCapability<CoinType>) acquires Capabilities {
+    let account_addr = signer::address_of(account);
+    assert!(
+        exists<Capabilities<CoinType>>(account_addr),
+        error::not_found(ENO_CAPABILITIES),
+    );
+
+    let Capabilities<CoinType> {
+        burn_cap,
+        freeze_cap,
+        mint_cap,
+    } = move_from<Capabilities<CoinType>>(account_addr);
+    (burn_cap, freeze_cap, mint_cap)
+}
+
+ + +
@@ -423,4 +493,40 @@ Updating Account.guid_creation_num will not overflow.
+ + + +### Function `destroy_caps` + + +
public entry fun destroy_caps<CoinType>(account: &signer)
+
+ + + + +
let account_addr = signer::address_of(account);
+aborts_if !exists<Capabilities<CoinType>>(account_addr);
+ensures !exists<Capabilities<CoinType>>(account_addr);
+
+ + + + + +### Function `remove_caps` + + +
public fun remove_caps<CoinType>(account: &signer): (coin::BurnCapability<CoinType>, coin::FreezeCapability<CoinType>, coin::MintCapability<CoinType>)
+
+ + + + +
let account_addr = signer::address_of(account);
+aborts_if !exists<Capabilities<CoinType>>(account_addr);
+ensures !exists<Capabilities<CoinType>>(account_addr);
+
+ + [move-book]: https://aptos.dev/move/book/SUMMARY diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/multisig_account.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/multisig_account.md index 601d661ed1af5..6b815f328d660 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/multisig_account.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/multisig_account.md @@ -82,7 +82,9 @@ and implement the governance voting logic on top. - [Function `next_sequence_number`](#0x1_multisig_account_next_sequence_number) - [Function `vote`](#0x1_multisig_account_vote) - [Function `available_transaction_queue_capacity`](#0x1_multisig_account_available_transaction_queue_capacity) +- [Function `create_with_existing_account_call`](#0x1_multisig_account_create_with_existing_account_call) - [Function `create_with_existing_account`](#0x1_multisig_account_create_with_existing_account) +- [Function `create_with_existing_account_and_revoke_auth_key_call`](#0x1_multisig_account_create_with_existing_account_and_revoke_auth_key_call) - [Function `create_with_existing_account_and_revoke_auth_key`](#0x1_multisig_account_create_with_existing_account_and_revoke_auth_key) - [Function `create`](#0x1_multisig_account_create) - [Function `create_with_owners`](#0x1_multisig_account_create_with_owners) @@ -1831,7 +1833,7 @@ Return the id of the last transaction that was executed (successful or failed) o
public fun last_resolved_sequence_number(multisig_account: address): u64 acquires MultisigAccount {
-    let multisig_account_resource = borrow_global_mut<MultisigAccount>(multisig_account);
+    let multisig_account_resource = borrow_global<MultisigAccount>(multisig_account);
     multisig_account_resource.last_executed_sequence_number
 }
 
@@ -1858,7 +1860,7 @@ Return the id of the next transaction created.
public fun next_sequence_number(multisig_account: address): u64 acquires MultisigAccount {
-    let multisig_account_resource = borrow_global_mut<MultisigAccount>(multisig_account);
+    let multisig_account_resource = borrow_global<MultisigAccount>(multisig_account);
     multisig_account_resource.next_sequence_number
 }
 
@@ -1886,7 +1888,7 @@ Return a bool tuple indicating whether an owner has voted and if so, whether the
public fun vote(
     multisig_account: address, sequence_number: u64, owner: address): (bool, bool) acquires MultisigAccount {
-    let multisig_account_resource = borrow_global_mut<MultisigAccount>(multisig_account);
+    let multisig_account_resource = borrow_global<MultisigAccount>(multisig_account);
     assert!(
         sequence_number > 0 && sequence_number < multisig_account_resource.next_sequence_number,
         error::invalid_argument(EINVALID_SEQUENCE_NUMBER),
@@ -1920,7 +1922,7 @@ Return a bool tuple indicating whether an owner has voted and if so, whether the
 
 
 
public fun available_transaction_queue_capacity(multisig_account: address): u64 acquires MultisigAccount {
-    let multisig_account_resource = borrow_global_mut<MultisigAccount>(multisig_account);
+    let multisig_account_resource = borrow_global<MultisigAccount>(multisig_account);
     let num_pending_transactions = multisig_account_resource.next_sequence_number - multisig_account_resource.last_executed_sequence_number - 1;
     if (num_pending_transactions > MAX_PENDING_TRANSACTIONS) {
         0
@@ -1932,6 +1934,50 @@ Return a bool tuple indicating whether an owner has voted and if so, whether the
 
 
 
+
+
+
+
+## Function `create_with_existing_account_call`
+
+Private entry function that creates a new multisig account on top of an existing account.
+
+This offers a migration path for an existing account with any type of auth key.
+
+Note that this does not revoke auth key-based control over the account. Owners should separately rotate the auth
+key after they are fully migrated to the new multisig account. Alternatively, they can call
+create_with_existing_account_and_revoke_auth_key_call instead.
+
+
+
entry fun create_with_existing_account_call(multisig_account: &signer, owners: vector<address>, num_signatures_required: u64, metadata_keys: vector<string::String>, metadata_values: vector<vector<u8>>)
+
+ + + +
+Implementation + + +
entry fun create_with_existing_account_call(
+    multisig_account: &signer,
+    owners: vector<address>,
+    num_signatures_required: u64,
+    metadata_keys: vector<String>,
+    metadata_values: vector<vector<u8>>,
+) acquires MultisigAccount {
+    create_with_owners_internal(
+        multisig_account,
+        owners,
+        num_signatures_required,
+        option::none<SignerCapability>(),
+        metadata_keys,
+        metadata_values,
+    );
+}
+
+ + +
@@ -2002,6 +2048,61 @@ create_with_existing_account_and_revoke_auth_key instead. + + + + +## Function `create_with_existing_account_and_revoke_auth_key_call` + +Private entry function that creates a new multisig account on top of an existing account and immediately rotate +the origin auth key to 0x0. + +Note: If the original account is a resource account, this does not revoke all control over it as if any +SignerCapability of the resource account still exists, it can still be used to generate the signer for the +account. + + +
entry fun create_with_existing_account_and_revoke_auth_key_call(multisig_account: &signer, owners: vector<address>, num_signatures_required: u64, metadata_keys: vector<string::String>, metadata_values: vector<vector<u8>>)
+
+ + + +
+Implementation + + +
entry fun create_with_existing_account_and_revoke_auth_key_call(
+    multisig_account: &signer,
+    owners: vector<address>,
+    num_signatures_required: u64,
+    metadata_keys: vector<String>,
+    metadata_values:vector<vector<u8>>,
+) acquires MultisigAccount {
+    create_with_owners_internal(
+        multisig_account,
+        owners,
+        num_signatures_required,
+        option::none<SignerCapability>(),
+        metadata_keys,
+        metadata_values,
+    );
+
+    // Rotate the account's auth key to 0x0, which effectively revokes control via auth key.
+    let multisig_address = address_of(multisig_account);
+    account::rotate_authentication_key_internal(multisig_account, ZERO_AUTH_KEY);
+    // This also needs to revoke any signer capability or rotation capability that exists for the account to
+    // completely remove all access to the account.
+    if (account::is_signer_capability_offered(multisig_address)) {
+        account::revoke_any_signer_capability(multisig_account);
+    };
+    if (account::is_rotation_capability_offered(multisig_address)) {
+        account::revoke_any_rotation_capability(multisig_account);
+    };
+}
+
+ + +
@@ -2647,14 +2748,15 @@ maliciously alter the number of signatures required. new_metadata: multisig_account_resource.metadata, } ) + } else { + emit_event( + &mut multisig_account_resource.metadata_updated_events, + MetadataUpdatedEvent { + old_metadata, + new_metadata: multisig_account_resource.metadata, + } + ); }; - emit_event( - &mut multisig_account_resource.metadata_updated_events, - MetadataUpdatedEvent { - old_metadata, - new_metadata: multisig_account_resource.metadata, - } - ); }; }
@@ -2849,15 +2951,16 @@ will continue to be an accessible entry point. approved, } ); + } else { + emit_event( + &mut multisig_account_resource.vote_events, + VoteEvent { + owner: owner_addr, + sequence_number, + approved, + } + ); }; - emit_event( - &mut multisig_account_resource.vote_events, - VoteEvent { - owner: owner_addr, - sequence_number, - approved, - } - ); }
@@ -2971,15 +3074,16 @@ Remove the next transaction if it has sufficient owner rejections. executor: address_of(owner), } ); + } else { + emit_event( + &mut multisig_account_resource.execute_rejected_transaction_events, + ExecuteRejectedTransactionEvent { + sequence_number, + num_rejections, + executor: owner_addr, + } + ); }; - emit_event( - &mut multisig_account_resource.execute_rejected_transaction_events, - ExecuteRejectedTransactionEvent { - sequence_number, - num_rejections, - executor: owner_addr, - } - ); }
@@ -3125,16 +3229,17 @@ This function is private so no other code can call this beside the VM itself as executor, } ); + } else { + emit_event( + &mut multisig_account_resource.execute_transaction_events, + TransactionExecutionSucceededEvent { + sequence_number: multisig_account_resource.last_executed_sequence_number, + transaction_payload, + num_approvals, + executor, + } + ); }; - emit_event( - &mut multisig_account_resource.execute_transaction_events, - TransactionExecutionSucceededEvent { - sequence_number: multisig_account_resource.last_executed_sequence_number, - transaction_payload, - num_approvals, - executor, - } - ); }
@@ -3178,17 +3283,18 @@ This function is private so no other code can call this beside the VM itself as execution_error, } ); + } else { + emit_event( + &mut multisig_account_resource.transaction_execution_failed_events, + TransactionExecutionFailedEvent { + executor, + sequence_number: multisig_account_resource.last_executed_sequence_number, + transaction_payload, + num_approvals, + execution_error, + } + ); }; - emit_event( - &mut multisig_account_resource.transaction_execution_failed_events, - TransactionExecutionFailedEvent { - executor, - sequence_number: multisig_account_resource.last_executed_sequence_number, - transaction_payload, - num_approvals, - execution_error, - } - ); }
@@ -3228,16 +3334,17 @@ This function is private so no other code can call this beside the VM itself as approved: true, } ); + } else { + emit_event( + &mut multisig_account_resource.vote_events, + VoteEvent { + owner: executor, + sequence_number, + approved: true, + } + ); }; num_approvals = num_approvals + 1; - emit_event( - &mut multisig_account_resource.vote_events, - VoteEvent { - owner: executor, - sequence_number, - approved: true, - } - ); }; num_approvals @@ -3314,11 +3421,12 @@ This function is private so no other code can call this beside the VM itself as emit( CreateTransaction { multisig_account: multisig_account, creator, sequence_number, transaction } ); + } else { + emit_event( + &mut multisig_account_resource.create_transaction_events, + CreateTransactionEvent { creator, sequence_number, transaction }, + ); }; - emit_event( - &mut multisig_account_resource.create_transaction_events, - CreateTransactionEvent { creator, sequence_number, transaction }, - ); }
@@ -3706,11 +3814,12 @@ Add new owners, remove owners to remove, update signatures required. ); if (std::features::module_event_migration_enabled()) { emit(AddOwners { multisig_account: multisig_address, owners_added: new_owners }); + } else { + emit_event( + &mut multisig_account_ref_mut.add_owners_events, + AddOwnersEvent { owners_added: new_owners } + ); }; - emit_event( - &mut multisig_account_ref_mut.add_owners_events, - AddOwnersEvent { owners_added: new_owners } - ); }; // If owners to remove provided, try to remove them. if (vector::length(&owners_to_remove) > 0) { @@ -3732,11 +3841,12 @@ Add new owners, remove owners to remove, update signatures required. emit( RemoveOwners { multisig_account: multisig_address, owners_removed } ); + } else { + emit_event( + &mut multisig_account_ref_mut.remove_owners_events, + RemoveOwnersEvent { owners_removed } + ); }; - emit_event( - &mut multisig_account_ref_mut.remove_owners_events, - RemoveOwnersEvent { owners_removed } - ); } }; // If new signature count provided, try to update count. @@ -3761,14 +3871,15 @@ Add new owners, remove owners to remove, update signatures required. new_num_signatures_required, } ); - }; - emit_event( - &mut multisig_account_ref_mut.update_signature_required_events, - UpdateSignaturesRequiredEvent { - old_num_signatures_required, - new_num_signatures_required, - } - ); + } else { + emit_event( + &mut multisig_account_ref_mut.update_signature_required_events, + UpdateSignaturesRequiredEvent { + old_num_signatures_required, + new_num_signatures_required, + } + ); + } } }; // Verify number of owners. diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/object.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/object.md index 7a5f1c49ba86e..e131f6e4e1fb9 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/object.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/object.md @@ -604,6 +604,16 @@ generate_unique_address uses this for domain separation within its native implem + + +Objects cannot be burnt + + +
const EBURN_NOT_ALLOWED: u64 = 10;
+
+ + + The object does not allow for deletion @@ -1887,15 +1897,16 @@ Transfer to the destination address using a LinearTransferRef. to, }, ); + } else { + event::emit_event( + &mut object.transfer_events, + TransferEvent { + object: ref.self, + from: object.owner, + to, + }, + ); }; - event::emit_event( - &mut object.transfer_events, - TransferEvent { - object: ref.self, - from: object.owner, - to, - }, - ); object.owner = to; }
@@ -2023,15 +2034,16 @@ hierarchy. to, }, ); + } else { + event::emit_event( + &mut object_core.transfer_events, + TransferEvent { + object, + from: object_core.owner, + to, + }, + ); }; - event::emit_event( - &mut object_core.transfer_events, - TransferEvent { - object, - from: object_core.owner, - to, - }, - ); object_core.owner = to; }; } @@ -2130,12 +2142,13 @@ objects may have cyclic dependencies. ## Function `burn` -Forcefully transfer an unwanted object to BURN_ADDRESS, ignoring whether ungated_transfer is allowed. -This only works for objects directly owned and for simplicity does not apply to indirectly owned objects. -Original owners can reclaim burnt objects any time in the future by calling unburn. +Previously allowed to burn objects, has now been disabled. Objects can still be unburnt. + +Please use the test only [object::burn_object] for testing with previously burned objects. -
public entry fun burn<T: key>(owner: &signer, object: object::Object<T>)
+
#[deprecated]
+public entry fun burn<T: key>(_owner: &signer, _object: object::Object<T>)
 
@@ -2144,12 +2157,8 @@ Original owners can reclaim burnt objects any time in the future by calling unbu Implementation -
public entry fun burn<T: key>(owner: &signer, object: Object<T>) acquires ObjectCore {
-    let original_owner = signer::address_of(owner);
-    assert!(is_owner(object, original_owner), error::permission_denied(ENOT_OBJECT_OWNER));
-    let object_addr = object.inner;
-    move_to(&create_signer(object_addr), TombStone { original_owner });
-    transfer_raw_inner(object_addr, BURN_ADDRESS);
+
public entry fun burn<T: key>(_owner: &signer, _object: Object<T>) {
+    abort error::permission_denied(EBURN_NOT_ALLOWED)
 }
 
@@ -3245,17 +3254,14 @@ to determine the identity of the starting point of ownership. ### Function `burn` -
public entry fun burn<T: key>(owner: &signer, object: object::Object<T>)
+
#[deprecated]
+public entry fun burn<T: key>(_owner: &signer, _object: object::Object<T>)
 
-
pragma aborts_if_is_partial;
-let object_address = object.inner;
-aborts_if !exists<ObjectCore>(object_address);
-aborts_if owner(object) != signer::address_of(owner);
-aborts_if is_burnt(object);
+
aborts_if true;
 
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/optional_aggregator.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/optional_aggregator.md index cd2d4ad5bfb7a..e62db85da1add 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/optional_aggregator.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/optional_aggregator.md @@ -18,9 +18,6 @@ aggregator (parallelizable) or via normal integers. - [Function `destroy_integer`](#0x1_optional_aggregator_destroy_integer) - [Function `new`](#0x1_optional_aggregator_new) - [Function `switch`](#0x1_optional_aggregator_switch) -- [Function `switch_and_zero_out`](#0x1_optional_aggregator_switch_and_zero_out) -- [Function `switch_to_integer_and_zero_out`](#0x1_optional_aggregator_switch_to_integer_and_zero_out) -- [Function `switch_to_aggregator_and_zero_out`](#0x1_optional_aggregator_switch_to_aggregator_and_zero_out) - [Function `destroy`](#0x1_optional_aggregator_destroy) - [Function `destroy_optional_aggregator`](#0x1_optional_aggregator_destroy_optional_aggregator) - [Function `destroy_optional_integer`](#0x1_optional_aggregator_destroy_optional_integer) @@ -40,9 +37,6 @@ aggregator (parallelizable) or via normal integers. - [Function `destroy_integer`](#@Specification_1_destroy_integer) - [Function `new`](#@Specification_1_new) - [Function `switch`](#@Specification_1_switch) - - [Function `switch_and_zero_out`](#@Specification_1_switch_and_zero_out) - - [Function `switch_to_integer_and_zero_out`](#@Specification_1_switch_to_integer_and_zero_out) - - [Function `switch_to_aggregator_and_zero_out`](#@Specification_1_switch_to_aggregator_and_zero_out) - [Function `destroy`](#@Specification_1_destroy) - [Function `destroy_optional_aggregator`](#@Specification_1_destroy_optional_aggregator) - [Function `destroy_optional_integer`](#@Specification_1_destroy_optional_integer) @@ -132,6 +126,15 @@ Contains either an aggregator or a normal integer, both overflowing on limit. ## Constants + + + + +
const MAX_U128: u128 = 340282366920938463463374607431768211455;
+
+ + + The value of aggregator underflows (goes below zero). Raised by native code. @@ -152,6 +155,16 @@ Aggregator feature is not supported. Raised by native code. + + +OptionalAggregator (Agg V1) switch not supported any more. + + +
const ESWITCH_DEPRECATED: u64 = 3;
+
+ + + ## Function `new_integer` @@ -317,7 +330,7 @@ Destroys an integer. Creates a new optional aggregator. -
public(friend) fun new(limit: u128, parallelizable: bool): optional_aggregator::OptionalAggregator
+
public(friend) fun new(parallelizable: bool): optional_aggregator::OptionalAggregator
 
@@ -326,16 +339,16 @@ Creates a new optional aggregator. Implementation -
public(friend) fun new(limit: u128, parallelizable: bool): OptionalAggregator {
+
public(friend) fun new(parallelizable: bool): OptionalAggregator {
     if (parallelizable) {
         OptionalAggregator {
-            aggregator: option::some(aggregator_factory::create_aggregator_internal(limit)),
+            aggregator: option::some(aggregator_factory::create_aggregator_internal()),
             integer: option::none(),
         }
     } else {
         OptionalAggregator {
             aggregator: option::none(),
-            integer: option::some(new_integer(limit)),
+            integer: option::some(new_integer(MAX_U128)),
         }
     }
 }
@@ -352,7 +365,7 @@ Creates a new optional aggregator.
 Switches between parallelizable and non-parallelizable implementations.
 
 
-
public fun switch(optional_aggregator: &mut optional_aggregator::OptionalAggregator)
+
public fun switch(_optional_aggregator: &mut optional_aggregator::OptionalAggregator)
 
@@ -361,106 +374,8 @@ Switches between parallelizable and non-parallelizable implementations. Implementation -
public fun switch(optional_aggregator: &mut OptionalAggregator) {
-    let value = read(optional_aggregator);
-    switch_and_zero_out(optional_aggregator);
-    add(optional_aggregator, value);
-}
-
- - - - - - - -## Function `switch_and_zero_out` - -Switches between parallelizable and non-parallelizable implementations, setting -the value of the new optional aggregator to zero. - - -
fun switch_and_zero_out(optional_aggregator: &mut optional_aggregator::OptionalAggregator)
-
- - - -
-Implementation - - -
fun switch_and_zero_out(optional_aggregator: &mut OptionalAggregator) {
-    if (is_parallelizable(optional_aggregator)) {
-        switch_to_integer_and_zero_out(optional_aggregator);
-    } else {
-        switch_to_aggregator_and_zero_out(optional_aggregator);
-    }
-}
-
- - - -
- - - -## Function `switch_to_integer_and_zero_out` - -Switches from parallelizable to non-parallelizable implementation, zero-initializing -the value. - - -
fun switch_to_integer_and_zero_out(optional_aggregator: &mut optional_aggregator::OptionalAggregator): u128
-
- - - -
-Implementation - - -
fun switch_to_integer_and_zero_out(
-    optional_aggregator: &mut OptionalAggregator
-): u128 {
-    let aggregator = option::extract(&mut optional_aggregator.aggregator);
-    let limit = aggregator::limit(&aggregator);
-    aggregator::destroy(aggregator);
-    let integer = new_integer(limit);
-    option::fill(&mut optional_aggregator.integer, integer);
-    limit
-}
-
- - - -
- - - -## Function `switch_to_aggregator_and_zero_out` - -Switches from non-parallelizable to parallelizable implementation, zero-initializing -the value. - - -
fun switch_to_aggregator_and_zero_out(optional_aggregator: &mut optional_aggregator::OptionalAggregator): u128
-
- - - -
-Implementation - - -
fun switch_to_aggregator_and_zero_out(
-    optional_aggregator: &mut OptionalAggregator
-): u128 {
-    let integer = option::extract(&mut optional_aggregator.integer);
-    let limit = limit(&integer);
-    destroy_integer(integer);
-    let aggregator = aggregator_factory::create_aggregator_internal(limit);
-    option::fill(&mut optional_aggregator.aggregator, aggregator);
-    limit
+
public fun switch(_optional_aggregator: &mut OptionalAggregator) {
+    abort error::invalid_state(ESWITCH_DEPRECATED)
 }
 
@@ -796,7 +711,7 @@ Check for overflow.
aborts_if value > (integer.limit - integer.value);
-aborts_if integer.value + value > MAX_U128;
+aborts_if integer.value + value > MAX_U128;
 ensures integer.value <= integer.limit;
 ensures integer.value == old(integer.value) + value;
 
@@ -876,7 +791,7 @@ Check for overflow. ### Function `new` -
public(friend) fun new(limit: u128, parallelizable: bool): optional_aggregator::OptionalAggregator
+
public(friend) fun new(parallelizable: bool): optional_aggregator::OptionalAggregator
 
@@ -896,89 +811,13 @@ Check for overflow. ### Function `switch` -
public fun switch(optional_aggregator: &mut optional_aggregator::OptionalAggregator)
-
- - - - -
let vec_ref = optional_aggregator.integer.vec;
-aborts_if is_parallelizable(optional_aggregator) && len(vec_ref) != 0;
-aborts_if !is_parallelizable(optional_aggregator) && len(vec_ref) == 0;
-aborts_if !is_parallelizable(optional_aggregator) && !exists<aggregator_factory::AggregatorFactory>(@aptos_framework);
-ensures optional_aggregator_value(optional_aggregator) == optional_aggregator_value(old(optional_aggregator));
-
- - - - - -### Function `switch_and_zero_out` - - -
fun switch_and_zero_out(optional_aggregator: &mut optional_aggregator::OptionalAggregator)
-
- - -Option does not exist When Option exists. -Option exists when Option does not exist. -The AggregatorFactory is under the @aptos_framework when Option does not exist. - - -
let vec_ref = optional_aggregator.integer.vec;
-aborts_if is_parallelizable(optional_aggregator) && len(vec_ref) != 0;
-aborts_if !is_parallelizable(optional_aggregator) && len(vec_ref) == 0;
-aborts_if !is_parallelizable(optional_aggregator) && !exists<aggregator_factory::AggregatorFactory>(@aptos_framework);
-// This enforces high-level requirement 3:
-ensures is_parallelizable(old(optional_aggregator)) ==> !is_parallelizable(optional_aggregator);
-ensures !is_parallelizable(old(optional_aggregator)) ==> is_parallelizable(optional_aggregator);
-ensures optional_aggregator_value(optional_aggregator) == 0;
-
- - - - - -### Function `switch_to_integer_and_zero_out` - - -
fun switch_to_integer_and_zero_out(optional_aggregator: &mut optional_aggregator::OptionalAggregator): u128
+
public fun switch(_optional_aggregator: &mut optional_aggregator::OptionalAggregator)
 
-The aggregator exists and the integer dosex not exist when Switches from parallelizable to non-parallelizable implementation. -
let limit = aggregator::spec_get_limit(option::borrow(optional_aggregator.aggregator));
-aborts_if len(optional_aggregator.aggregator.vec) == 0;
-aborts_if len(optional_aggregator.integer.vec) != 0;
-ensures !is_parallelizable(optional_aggregator);
-ensures option::borrow(optional_aggregator.integer).limit == limit;
-ensures option::borrow(optional_aggregator.integer).value == 0;
-
- - - - - -### Function `switch_to_aggregator_and_zero_out` - - -
fun switch_to_aggregator_and_zero_out(optional_aggregator: &mut optional_aggregator::OptionalAggregator): u128
-
- - -The integer exists and the aggregator does not exist when Switches from non-parallelizable to parallelizable implementation. -The AggregatorFactory is under the @aptos_framework. - - -
let limit = option::borrow(optional_aggregator.integer).limit;
-aborts_if len(optional_aggregator.integer.vec) == 0;
-aborts_if !exists<aggregator_factory::AggregatorFactory>(@aptos_framework);
-aborts_if len(optional_aggregator.aggregator.vec) != 0;
-ensures is_parallelizable(optional_aggregator);
-ensures aggregator::spec_get_limit(option::borrow(optional_aggregator.aggregator)) == limit;
-ensures aggregator::spec_aggregator_get_val(option::borrow(optional_aggregator.aggregator)) == 0;
+
aborts_if true;
 
@@ -1095,9 +934,9 @@ The integer exists and the aggregator does not exist when destroy the integer. aborts_if is_parallelizable(optional_aggregator) && (aggregator::spec_aggregator_get_val(option::borrow(optional_aggregator.aggregator)) + value > aggregator::spec_get_limit(option::borrow(optional_aggregator.aggregator))); aborts_if is_parallelizable(optional_aggregator) && (aggregator::spec_aggregator_get_val(option::borrow(optional_aggregator.aggregator)) - + value > MAX_U128); + + value > MAX_U128); aborts_if !is_parallelizable(optional_aggregator) && - (option::borrow(optional_aggregator.integer).value + value > MAX_U128); + (option::borrow(optional_aggregator.integer).value + value > MAX_U128); aborts_if !is_parallelizable(optional_aggregator) && (value > (option::borrow(optional_aggregator.integer).limit - option::borrow(optional_aggregator.integer).value)); } diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/reconfiguration.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/reconfiguration.md index 545dfef452233..218561a8f0732 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/reconfiguration.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/reconfiguration.md @@ -44,7 +44,6 @@ to synchronize configuration changes for the validators. use 0x1::storage_gas; use 0x1::system_addresses; use 0x1::timestamp; -use 0x1::transaction_fee;
@@ -396,20 +395,6 @@ Signal validators to start using new configuration. Must be called from friend c reconfiguration_state::on_reconfig_start(); - // Reconfiguration "forces the block" to end, as mentioned above. Therefore, we must process the collected fees - // explicitly so that staking can distribute them. - // - // This also handles the case when a validator is removed due to the governance proposal. In particular, removing - // the validator causes a reconfiguration. We explicitly process fees, i.e. we drain aggregatable coin and populate - // the fees table, prior to calling `on_new_epoch()`. That call, in turn, distributes transaction fees for all active - // and pending_inactive validators, which include any validator that is to be removed. - if (features::collect_and_distribute_gas_fees()) { - // All transactions after reconfiguration are Retry. Therefore, when the next - // block starts and tries to assign/burn collected fees it will be just 0 and - // nothing will be assigned. - transaction_fee::process_collected_fees(); - }; - // Call stake to compute the new validator set and distribute rewards and transaction fees. stake::on_new_epoch(); storage_gas::on_reconfig(); @@ -726,12 +711,10 @@ Make sure the caller is admin and check the resource DisableReconfiguration.
pragma verify = true;
 pragma verify_duration_estimate = 600;
-requires exists<stake::ValidatorFees>(@aptos_framework);
 let success = !(chain_status::is_genesis() || timestamp::spec_now_microseconds() == 0 || !reconfiguration_enabled())
     && timestamp::spec_now_microseconds() != global<Configuration>(@aptos_framework).last_reconfiguration_time;
 include features::spec_periodical_reward_rate_decrease_enabled() ==> staking_config::StakingRewardsConfigEnabledRequirement;
 include success ==> aptos_coin::ExistsAptosCoin;
-include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
 aborts_if false;
 ensures success ==> global<Configuration>(@aptos_framework).epoch == old(global<Configuration>(@aptos_framework).epoch) + 1;
 ensures success ==> global<Configuration>(@aptos_framework).last_reconfiguration_time == timestamp::spec_now_microseconds();
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/reconfiguration_with_dkg.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/reconfiguration_with_dkg.md
index 85b4f1dbc74e2..e7dd6f9e6dd8a 100644
--- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/reconfiguration_with_dkg.md
+++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/reconfiguration_with_dkg.md
@@ -208,8 +208,6 @@ Abort if no DKG is in progress.
     requires chain_status::is_operating();
     requires exists<CoinInfo<AptosCoin>>(@aptos_framework);
     include staking_config::StakingRewardsConfigRequirement;
-    requires exists<stake::ValidatorFees>(@aptos_framework);
-    include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
     requires exists<features::Features>(@std);
     include config_buffer::OnNewEpochRequirement<version::Version>;
     include config_buffer::OnNewEpochRequirement<gas_schedule::GasScheduleV2>;
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/stake.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/stake.md
index 865c0df8233c7..6dbfe59be07b9 100644
--- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/stake.md
+++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/stake.md
@@ -63,8 +63,6 @@ or if their stake drops below the min required, they would get removed at the en
 -  [Resource `Ghost$ghost_active_num`](#0x1_stake_Ghost$ghost_active_num)
 -  [Resource `Ghost$ghost_pending_inactive_num`](#0x1_stake_Ghost$ghost_pending_inactive_num)
 -  [Constants](#@Constants_0)
--  [Function `initialize_validator_fees`](#0x1_stake_initialize_validator_fees)
--  [Function `add_transaction_fee`](#0x1_stake_add_transaction_fee)
 -  [Function `get_lockup_secs`](#0x1_stake_get_lockup_secs)
 -  [Function `get_remaining_lockup_secs`](#0x1_stake_get_remaining_lockup_secs)
 -  [Function `get_stake`](#0x1_stake_get_stake)
@@ -130,8 +128,6 @@ or if their stake drops below the min required, they would get removed at the en
     -  [High-level Requirements](#high-level-req)
     -  [Module-level Specification](#module-level-spec)
     -  [Resource `ValidatorSet`](#@Specification_1_ValidatorSet)
-    -  [Function `initialize_validator_fees`](#@Specification_1_initialize_validator_fees)
-    -  [Function `add_transaction_fee`](#@Specification_1_add_transaction_fee)
     -  [Function `get_validator_state`](#@Specification_1_get_validator_state)
     -  [Function `initialize`](#@Specification_1_initialize)
     -  [Function `remove_validators`](#@Specification_1_remove_validators)
@@ -1447,11 +1443,11 @@ This allows the Stake module to mint rewards to stakers.
 
 ## Resource `ValidatorFees`
 
-Stores transaction fees assigned to validators. All fees are distributed to validators
-at the end of the epoch.
+DEPRECATED
 
 
-
struct ValidatorFees has key
+
#[deprecated]
+struct ValidatorFees has key
 
@@ -1882,68 +1878,6 @@ Validator status enum. We can switch to proper enum later once Move supports it. - - -## Function `initialize_validator_fees` - -Initializes the resource storing information about collected transaction fees per validator. -Used by transaction_fee.move to initialize fee collection and distribution. - - -
public(friend) fun initialize_validator_fees(aptos_framework: &signer)
-
- - - -
-Implementation - - -
public(friend) fun initialize_validator_fees(aptos_framework: &signer) {
-    system_addresses::assert_aptos_framework(aptos_framework);
-    assert!(
-        !exists<ValidatorFees>(@aptos_framework),
-        error::already_exists(EFEES_TABLE_ALREADY_EXISTS)
-    );
-    move_to(aptos_framework, ValidatorFees { fees_table: table::new() });
-}
-
- - - -
- - - -## Function `add_transaction_fee` - -Stores the transaction fee collected to the specified validator address. - - -
public(friend) fun add_transaction_fee(validator_addr: address, fee: coin::Coin<aptos_coin::AptosCoin>)
-
- - - -
-Implementation - - -
public(friend) fun add_transaction_fee(validator_addr: address, fee: Coin<AptosCoin>) acquires ValidatorFees {
-    let fees_table = &mut borrow_global_mut<ValidatorFees>(@aptos_framework).fees_table;
-    if (table::contains(fees_table, validator_addr)) {
-        let collected_fee = table::borrow_mut(fees_table, validator_addr);
-        coin::merge(collected_fee, fee);
-    } else {
-        table::add(fees_table, validator_addr, fee);
-    }
-}
-
- - - -
- ## Function `get_lockup_secs` @@ -2501,7 +2435,7 @@ Initialize the validator account and give ownership to the signing account. fullnode_addresses: vector<u8>, ) acquires AllowedValidators { // Checks the public key has a valid proof-of-possession to prevent rogue-key attacks. - let pubkey_from_pop = &mut bls12381::public_key_from_bytes_with_pop( + let pubkey_from_pop = &bls12381::public_key_from_bytes_with_pop( consensus_pubkey, &proof_of_possession_from_bytes(proof_of_possession) ); @@ -2712,16 +2646,16 @@ Allows an account with ownership capability to change the operator of the stake new_operator, }, ); + } else { + event::emit_event( + &mut stake_pool.set_operator_events, + SetOperatorEvent { + pool_address, + old_operator, + new_operator, + }, + ); }; - - event::emit_event( - &mut stake_pool.set_operator_events, - SetOperatorEvent { - pool_address, - old_operator, - new_operator, - }, - ); }
@@ -2843,7 +2777,7 @@ Add coins into pool_address. this requires the corresp // Only track and validate voting power increase for active and pending_active validator. // Pending_inactive validator will be removed from the validator set in the next epoch. // Inactive validator's total stake will be tracked when they join the validator set. - let validator_set = borrow_global_mut<ValidatorSet>(@aptos_framework); + let validator_set = borrow_global<ValidatorSet>(@aptos_framework); // Search directly rather using get_validator_state to save on unnecessary loops. if (option::is_some(&find_validator(&validator_set.active_validators, pool_address)) || option::is_some(&find_validator(&validator_set.pending_active, pool_address))) { @@ -2870,14 +2804,15 @@ Add coins into pool_address. this requires the corresp amount_added: amount, }, ); + } else { + event::emit_event( + &mut stake_pool.add_stake_events, + AddStakeEvent { + pool_address, + amount_added: amount, + }, + ); }; - event::emit_event( - &mut stake_pool.add_stake_events, - AddStakeEvent { - pool_address, - amount_added: amount, - }, - ); }
@@ -2952,14 +2887,15 @@ Move amount of coins from pending_inactive to active. amount, }, ); + } else { + event::emit_event( + &mut stake_pool.reactivate_stake_events, + ReactivateStakeEvent { + pool_address, + amount, + }, + ); }; - event::emit_event( - &mut stake_pool.reactivate_stake_events, - ReactivateStakeEvent { - pool_address, - amount, - }, - ); }
@@ -2999,7 +2935,7 @@ Rotate the consensus key of the validator, it'll take effect in next epoch. let validator_info = borrow_global_mut<ValidatorConfig>(pool_address); let old_consensus_pubkey = validator_info.consensus_pubkey; // Checks the public key has a valid proof-of-possession to prevent rogue-key attacks. - let pubkey_from_pop = &mut bls12381::public_key_from_bytes_with_pop( + let pubkey_from_pop = &bls12381::public_key_from_bytes_with_pop( new_consensus_pubkey, &proof_of_possession_from_bytes(proof_of_possession) ); @@ -3014,15 +2950,16 @@ Rotate the consensus key of the validator, it'll take effect in next epoch. new_consensus_pubkey, }, ); + } else { + event::emit_event( + &mut stake_pool.rotate_consensus_key_events, + RotateConsensusKeyEvent { + pool_address, + old_consensus_pubkey, + new_consensus_pubkey, + }, + ); }; - event::emit_event( - &mut stake_pool.rotate_consensus_key_events, - RotateConsensusKeyEvent { - pool_address, - old_consensus_pubkey, - new_consensus_pubkey, - }, - ); }
@@ -3073,18 +3010,18 @@ Update the network and full node addresses of the validator. This only takes eff new_fullnode_addresses, }, ); + } else { + event::emit_event( + &mut stake_pool.update_network_and_fullnode_addresses_events, + UpdateNetworkAndFullnodeAddressesEvent { + pool_address, + old_network_addresses, + new_network_addresses, + old_fullnode_addresses, + new_fullnode_addresses, + }, + ); }; - event::emit_event( - &mut stake_pool.update_network_and_fullnode_addresses_events, - UpdateNetworkAndFullnodeAddressesEvent { - pool_address, - old_network_addresses, - new_network_addresses, - old_fullnode_addresses, - new_fullnode_addresses, - }, - ); - }
@@ -3156,15 +3093,16 @@ directly inactive if it's not from an active validator. new_locked_until_secs, }, ); - }; - event::emit_event( - &mut stake_pool.increase_lockup_events, - IncreaseLockupEvent { - pool_address, - old_locked_until_secs, - new_locked_until_secs, - }, - ); + } else { + event::emit_event( + &mut stake_pool.increase_lockup_events, + IncreaseLockupEvent { + pool_address, + old_locked_until_secs, + new_locked_until_secs, + }, + ); + } }
@@ -3249,7 +3187,7 @@ This internal version can only be called by the Genesis module during Genesis. update_voting_power_increase(voting_power); // Add validator to pending_active, to be activated in the next epoch. - let validator_config = borrow_global_mut<ValidatorConfig>(pool_address); + let validator_config = borrow_global<ValidatorConfig>(pool_address); assert!(!vector::is_empty(&validator_config.consensus_pubkey), error::invalid_argument(EINVALID_PUBLIC_KEY)); // Validate the current validator set size has not exceeded the limit. @@ -3265,11 +3203,12 @@ This internal version can only be called by the Genesis module during Genesis. if (std::features::module_event_migration_enabled()) { event::emit(JoinValidatorSet { pool_address }); - }; - event::emit_event( - &mut stake_pool.join_validator_set_events, - JoinValidatorSetEvent { pool_address }, - ); + } else { + event::emit_event( + &mut stake_pool.join_validator_set_events, + JoinValidatorSetEvent { pool_address }, + ); + } }
@@ -3346,14 +3285,15 @@ Unlock amount from the active stake. Only possible if the lockup ha amount_unlocked: amount, }, ); + } else { + event::emit_event( + &mut stake_pool.unlock_stake_events, + UnlockStakeEvent { + pool_address, + amount_unlocked: amount, + }, + ); }; - event::emit_event( - &mut stake_pool.unlock_stake_events, - UnlockStakeEvent { - pool_address, - amount_unlocked: amount, - }, - ); }
@@ -3437,14 +3377,15 @@ Withdraw from pool_address's inactive stake with the corresponding amount_withdrawn: withdraw_amount, }, ); + } else { + event::emit_event( + &mut stake_pool.withdraw_stake_events, + WithdrawStakeEvent { + pool_address, + amount_withdrawn: withdraw_amount, + }, + ); }; - event::emit_event( - &mut stake_pool.withdraw_stake_events, - WithdrawStakeEvent { - pool_address, - amount_withdrawn: withdraw_amount, - }, - ); coin::extract(&mut stake_pool.inactive, withdraw_amount) } @@ -3521,13 +3462,14 @@ Can only be called by the operator of the validator/staking pool. if (std::features::module_event_migration_enabled()) { event::emit(LeaveValidatorSet { pool_address }); + } else { + event::emit_event( + &mut stake_pool.leave_validator_set_events, + LeaveValidatorSetEvent { + pool_address, + }, + ); }; - event::emit_event( - &mut stake_pool.leave_validator_set_events, - LeaveValidatorSetEvent { - pool_address, - }, - ); }; }
@@ -3665,7 +3607,7 @@ power.
public(friend) fun on_new_epoch(
-) acquires StakePool, AptosCoinCapabilities, ValidatorConfig, ValidatorPerformance, ValidatorSet, ValidatorFees {
+) acquires StakePool, AptosCoinCapabilities, ValidatorConfig, ValidatorPerformance, ValidatorSet {
     let validator_set = borrow_global_mut<ValidatorSet>(@aptos_framework);
     let config = staking_config::get();
     let validator_perf = borrow_global_mut<ValidatorPerformance>(@aptos_framework);
@@ -3706,8 +3648,8 @@ power.
     }) {
         let old_validator_info = vector::borrow_mut(&mut validator_set.active_validators, i);
         let pool_address = old_validator_info.addr;
-        let validator_config = borrow_global_mut<ValidatorConfig>(pool_address);
-        let stake_pool = borrow_global_mut<StakePool>(pool_address);
+        let validator_config = borrow_global<ValidatorConfig>(pool_address);
+        let stake_pool = borrow_global<StakePool>(pool_address);
         let new_validator_info = generate_validator_info(pool_address, stake_pool, *validator_config);
 
         // A validator needs at least the min stake required to join the validator set.
@@ -3826,7 +3768,7 @@ Return the ValidatorConsensusInfo of each current validator, sorted
 Implementation
 
 
-
public fun next_validator_consensus_infos(): vector<ValidatorConsensusInfo> acquires ValidatorSet, ValidatorPerformance, StakePool, ValidatorFees, ValidatorConfig {
+
public fun next_validator_consensus_infos(): vector<ValidatorConsensusInfo> acquires ValidatorSet, ValidatorPerformance, StakePool, ValidatorConfig {
     // Init.
     let cur_validator_set = borrow_global<ValidatorSet>(@aptos_framework);
     let staking_config = staking_config::get();
@@ -3881,25 +3823,16 @@ Return the ValidatorConsensusInfo of each current validator, sorted
             0
         };
 
-        let cur_fee = 0;
-        if (features::collect_and_distribute_gas_fees()) {
-            let fees_table = &borrow_global<ValidatorFees>(@aptos_framework).fees_table;
-            if (table::contains(fees_table, candidate.addr)) {
-                let fee_coin = table::borrow(fees_table, candidate.addr);
-                cur_fee = coin::value(fee_coin);
-            }
-        };
-
         let lockup_expired = get_reconfig_start_time_secs() >= stake_pool.locked_until_secs;
         spec {
-            assume cur_active + cur_pending_active + cur_reward + cur_fee <= MAX_U64;
-            assume cur_active + cur_pending_inactive + cur_pending_active + cur_reward + cur_fee <= MAX_U64;
+            assume cur_active + cur_pending_active + cur_reward <= MAX_U64;
+            assume cur_active + cur_pending_inactive + cur_pending_active + cur_reward <= MAX_U64;
         };
         let new_voting_power =
             cur_active
             + if (lockup_expired) { 0 } else { cur_pending_inactive }
             + cur_pending_active
-            + cur_reward + cur_fee;
+            + cur_reward;
 
         if (new_voting_power >= minimum_stake) {
             let config = *borrow_global<ValidatorConfig>(candidate.addr);
@@ -4078,7 +4011,7 @@ This function shouldn't abort.
     validator_perf: &ValidatorPerformance,
     pool_address: address,
     staking_config: &StakingConfig,
-) acquires StakePool, AptosCoinCapabilities, ValidatorConfig, ValidatorFees {
+) acquires StakePool, AptosCoinCapabilities, ValidatorConfig {
     let stake_pool = borrow_global_mut<StakePool>(pool_address);
     let validator_config = borrow_global<ValidatorConfig>(pool_address);
     let cur_validator_perf = vector::borrow(&validator_perf.validators, validator_config.validator_index);
@@ -4111,15 +4044,6 @@ This function shouldn't abort.
     // Pending active stake can now be active.
     coin::merge(&mut stake_pool.active, coin::extract_all(&mut stake_pool.pending_active));
 
-    // Additionally, distribute transaction fees.
-    if (features::collect_and_distribute_gas_fees()) {
-        let fees_table = &mut borrow_global_mut<ValidatorFees>(@aptos_framework).fees_table;
-        if (table::contains(fees_table, pool_address)) {
-            let coin = table::remove(fees_table, pool_address);
-            coin::merge(&mut stake_pool.active, coin);
-        };
-    };
-
     // Pending inactive stake is only fully unlocked and moved into inactive if the current lockup cycle has expired
     let current_lockup_expiration = stake_pool.locked_until_secs;
     if (get_reconfig_start_time_secs() >= current_lockup_expiration) {
@@ -4131,14 +4055,15 @@ This function shouldn't abort.
 
     if (std::features::module_event_migration_enabled()) {
         event::emit(DistributeRewards { pool_address, rewards_amount });
+    } else {
+        event::emit_event(
+            &mut stake_pool.distribute_rewards_events,
+            DistributeRewardsEvent {
+                pool_address,
+                rewards_amount,
+            },
+        );
     };
-    event::emit_event(
-        &mut stake_pool.distribute_rewards_events,
-        DistributeRewardsEvent {
-            pool_address,
-            rewards_amount,
-        },
-    );
 }
 
@@ -4640,6 +4565,115 @@ Returns validator's next epoch voting power, including pending_active, active, a + + + + +
fun spec_rewards_amount(
+   stake_amount: u64,
+   num_successful_proposals: u64,
+   num_total_proposals: u64,
+   rewards_rate: u64,
+   rewards_rate_denominator: u64,
+): u64;
+
+ + + + + + + +
fun spec_contains(validators: vector<ValidatorInfo>, addr: address): bool {
+   exists i in 0..len(validators): validators[i].addr == addr
+}
+
+ + + + + + + +
fun spec_is_current_epoch_validator(pool_address: address): bool {
+   let validator_set = global<ValidatorSet>(@aptos_framework);
+   !spec_contains(validator_set.pending_active, pool_address)
+       && (spec_contains(validator_set.active_validators, pool_address)
+       || spec_contains(validator_set.pending_inactive, pool_address))
+}
+
+ + + + + + + +
schema ResourceRequirement {
+    requires exists<AptosCoinCapabilities>(@aptos_framework);
+    requires exists<ValidatorPerformance>(@aptos_framework);
+    requires exists<ValidatorSet>(@aptos_framework);
+    requires exists<StakingConfig>(@aptos_framework);
+    requires exists<StakingRewardsConfig>(@aptos_framework) || !features::spec_periodical_reward_rate_decrease_enabled();
+    requires exists<timestamp::CurrentTimeMicroseconds>(@aptos_framework);
+}
+
+ + + + + + + +
fun spec_get_reward_rate_1(config: StakingConfig): num {
+   if (features::spec_periodical_reward_rate_decrease_enabled()) {
+       let epoch_rewards_rate = global<staking_config::StakingRewardsConfig>(@aptos_framework).rewards_rate;
+       if (epoch_rewards_rate.value == 0) {
+           0
+       } else {
+           let denominator_0 = aptos_std::fixed_point64::spec_divide_u128(staking_config::MAX_REWARDS_RATE, epoch_rewards_rate);
+           let denominator = if (denominator_0 > MAX_U64) {
+               MAX_U64
+           } else {
+               denominator_0
+           };
+           let nominator = aptos_std::fixed_point64::spec_multiply_u128(denominator, epoch_rewards_rate);
+           nominator
+       }
+   } else {
+           config.rewards_rate
+   }
+}
+
+ + + + + + + +
fun spec_get_reward_rate_2(config: StakingConfig): num {
+   if (features::spec_periodical_reward_rate_decrease_enabled()) {
+       let epoch_rewards_rate = global<staking_config::StakingRewardsConfig>(@aptos_framework).rewards_rate;
+       if (epoch_rewards_rate.value == 0) {
+           1
+       } else {
+           let denominator_0 = aptos_std::fixed_point64::spec_divide_u128(staking_config::MAX_REWARDS_RATE, epoch_rewards_rate);
+           let denominator = if (denominator_0 > MAX_U64) {
+               MAX_U64
+           } else {
+               denominator_0
+           };
+           denominator
+       }
+   } else {
+           config.rewards_rate_denominator
+   }
+}
+
+ + + ### Resource `ValidatorSet` @@ -4781,51 +4815,6 @@ Returns validator's next epoch voting power, including pending_active, active, a - - -### Function `initialize_validator_fees` - - -
public(friend) fun initialize_validator_fees(aptos_framework: &signer)
-
- - - - -
let aptos_addr = signer::address_of(aptos_framework);
-aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
-aborts_if exists<ValidatorFees>(aptos_addr);
-ensures exists<ValidatorFees>(aptos_addr);
-
- - - - - -### Function `add_transaction_fee` - - -
public(friend) fun add_transaction_fee(validator_addr: address, fee: coin::Coin<aptos_coin::AptosCoin>)
-
- - - - -
aborts_if !exists<ValidatorFees>(@aptos_framework);
-let fees_table = global<ValidatorFees>(@aptos_framework).fees_table;
-let post post_fees_table = global<ValidatorFees>(@aptos_framework).fees_table;
-let collected_fee = table::spec_get(fees_table, validator_addr);
-let post post_collected_fee = table::spec_get(post_fees_table, validator_addr);
-ensures if (table::spec_contains(fees_table, validator_addr)) {
-    post_collected_fee.value == collected_fee.value + fee.value
-} else {
-    table::spec_contains(post_fees_table, validator_addr) &&
-    table::spec_get(post_fees_table, validator_addr) == fee
-};
-
- - - ### Function `get_validator_state` @@ -5209,7 +5198,8 @@ Returns validator's next epoch voting power, including pending_active, active, a -
pragma disable_invariants_in_body;
+
pragma verify_duration_estimate = 60;
+pragma disable_invariants_in_body;
 aborts_if !staking_config::get_allow_validator_set_change(staking_config::get());
 aborts_if !exists<StakePool>(pool_address);
 aborts_if !exists<ValidatorConfig>(pool_address);
@@ -5654,116 +5644,6 @@ Returns validator's next epoch voting power, including pending_active, active, a
 
 
 
-
-
-
-
-
fun spec_rewards_amount(
-   stake_amount: u64,
-   num_successful_proposals: u64,
-   num_total_proposals: u64,
-   rewards_rate: u64,
-   rewards_rate_denominator: u64,
-): u64;
-
- - - - - - - -
fun spec_contains(validators: vector<ValidatorInfo>, addr: address): bool {
-   exists i in 0..len(validators): validators[i].addr == addr
-}
-
- - - - - - - -
fun spec_is_current_epoch_validator(pool_address: address): bool {
-   let validator_set = global<ValidatorSet>(@aptos_framework);
-   !spec_contains(validator_set.pending_active, pool_address)
-       && (spec_contains(validator_set.active_validators, pool_address)
-       || spec_contains(validator_set.pending_inactive, pool_address))
-}
-
- - - - - - - -
schema ResourceRequirement {
-    requires exists<AptosCoinCapabilities>(@aptos_framework);
-    requires exists<ValidatorPerformance>(@aptos_framework);
-    requires exists<ValidatorSet>(@aptos_framework);
-    requires exists<StakingConfig>(@aptos_framework);
-    requires exists<StakingRewardsConfig>(@aptos_framework) || !features::spec_periodical_reward_rate_decrease_enabled();
-    requires exists<timestamp::CurrentTimeMicroseconds>(@aptos_framework);
-    requires exists<ValidatorFees>(@aptos_framework);
-}
-
- - - - - - - -
fun spec_get_reward_rate_1(config: StakingConfig): num {
-   if (features::spec_periodical_reward_rate_decrease_enabled()) {
-       let epoch_rewards_rate = global<staking_config::StakingRewardsConfig>(@aptos_framework).rewards_rate;
-       if (epoch_rewards_rate.value == 0) {
-           0
-       } else {
-           let denominator_0 = aptos_std::fixed_point64::spec_divide_u128(staking_config::MAX_REWARDS_RATE, epoch_rewards_rate);
-           let denominator = if (denominator_0 > MAX_U64) {
-               MAX_U64
-           } else {
-               denominator_0
-           };
-           let nominator = aptos_std::fixed_point64::spec_multiply_u128(denominator, epoch_rewards_rate);
-           nominator
-       }
-   } else {
-           config.rewards_rate
-   }
-}
-
- - - - - - - -
fun spec_get_reward_rate_2(config: StakingConfig): num {
-   if (features::spec_periodical_reward_rate_decrease_enabled()) {
-       let epoch_rewards_rate = global<staking_config::StakingRewardsConfig>(@aptos_framework).rewards_rate;
-       if (epoch_rewards_rate.value == 0) {
-           1
-       } else {
-           let denominator_0 = aptos_std::fixed_point64::spec_divide_u128(staking_config::MAX_REWARDS_RATE, epoch_rewards_rate);
-           let denominator = if (denominator_0 > MAX_U64) {
-               MAX_U64
-           } else {
-               denominator_0
-           };
-           denominator
-       }
-   } else {
-           config.rewards_rate_denominator
-   }
-}
-
- - - ### Function `update_stake_pool` @@ -5800,16 +5680,9 @@ Returns validator's next epoch voting power, including pending_active, active, a let post post_stake_pool = global<StakePool>(pool_address); let post post_active_value = post_stake_pool.active.value; let post post_pending_inactive_value = post_stake_pool.pending_inactive.value; -let fees_table = global<ValidatorFees>(@aptos_framework).fees_table; -let post post_fees_table = global<ValidatorFees>(@aptos_framework).fees_table; let post post_inactive_value = post_stake_pool.inactive.value; ensures post_stake_pool.pending_active.value == 0; -ensures if (features::spec_is_enabled(features::COLLECT_AND_DISTRIBUTE_GAS_FEES) && table::spec_contains(fees_table, pool_address)) { - !table::spec_contains(post_fees_table, pool_address) && - post_active_value == stake_pool.active.value + rewards_amount_1 + stake_pool.pending_active.value + table::spec_get(fees_table, pool_address).value -} else { - post_active_value == stake_pool.active.value + rewards_amount_1 + stake_pool.pending_active.value -}; +ensures post_active_value == stake_pool.active.value + rewards_amount_1 + stake_pool.pending_active.value; ensures if (spec_get_reconfig_start_time_secs() >= stake_pool.locked_until_secs) { post_pending_inactive_value == 0 && post_inactive_value == stake_pool.inactive.value + stake_pool.pending_inactive.value + rewards_amount_2 @@ -5831,7 +5704,6 @@ Returns validator's next epoch voting power, including pending_active, active, a aborts_if !exists<ValidatorConfig>(pool_address); aborts_if global<ValidatorConfig>(pool_address).validator_index >= len(validator_perf.validators); let aptos_addr = type_info::type_of<AptosCoin>().account_address; - aborts_if !exists<ValidatorFees>(aptos_addr); let stake_pool = global<StakePool>(pool_address); include DistributeRewardsAbortsIf {stake: stake_pool.active}; include DistributeRewardsAbortsIf {stake: stake_pool.pending_inactive}; diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/staking_contract.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/staking_contract.md index 015101fcddbc0..f622300baf876 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/staking_contract.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/staking_contract.md @@ -1734,11 +1734,12 @@ Staker can call this function to create a simple staking contract with a specifi if (std::features::module_event_migration_enabled()) { emit(CreateStakingContract { operator, voter, pool_address, principal, commission_percentage }); + } else { + emit_event( + &mut store.create_staking_contract_events, + CreateStakingContractEvent { operator, voter, pool_address, principal, commission_percentage }, + ); }; - emit_event( - &mut store.create_staking_contract_events, - CreateStakingContractEvent { operator, voter, pool_address, principal, commission_percentage }, - ); pool_address }
@@ -1778,11 +1779,12 @@ Add more stake to an existing staking contract. let pool_address = staking_contract.pool_address; if (std::features::module_event_migration_enabled()) { emit(AddStake { operator, pool_address, amount }); + } else { + emit_event( + &mut store.add_stake_events, + AddStakeEvent { operator, pool_address, amount }, + ); }; - emit_event( - &mut store.add_stake_events, - AddStakeEvent { operator, pool_address, amount }, - ); }
@@ -1818,12 +1820,12 @@ Convenient function to allow the staker to update the voter address in a staking if (std::features::module_event_migration_enabled()) { emit(UpdateVoter { operator, pool_address, old_voter, new_voter }); + } else { + emit_event( + &mut store.update_voter_events, + UpdateVoterEvent { operator, pool_address, old_voter, new_voter }, + ); }; - emit_event( - &mut store.update_voter_events, - UpdateVoterEvent { operator, pool_address, old_voter, new_voter }, - ); - }
@@ -1858,8 +1860,9 @@ Convenient function to allow the staker to reset their stake pool's lockup perio if (std::features::module_event_migration_enabled()) { emit(ResetLockup { operator, pool_address }); + } else { + emit_event(&mut store.reset_lockup_events, ResetLockupEvent { operator, pool_address }); }; - emit_event(&mut store.reset_lockup_events, ResetLockupEvent { operator, pool_address }); }
@@ -1922,11 +1925,12 @@ TODO: fix the typo in function name. commision -> commission emit( UpdateCommission { staker: staker_address, operator, old_commission_percentage, new_commission_percentage } ); + } else { + emit_event( + &mut borrow_global_mut<StakingGroupUpdateCommissionEvent>(staker_address).update_commission_events, + UpdateCommissionEvent { staker: staker_address, operator, old_commission_percentage, new_commission_percentage } + ); }; - emit_event( - &mut borrow_global_mut<StakingGroupUpdateCommissionEvent>(staker_address).update_commission_events, - UpdateCommissionEvent { staker: staker_address, operator, old_commission_percentage, new_commission_percentage } - ); }
@@ -2029,11 +2033,12 @@ Only staker, operator or beneficiary can call this. let pool_address = staking_contract.pool_address; if (std::features::module_event_migration_enabled()) { emit(RequestCommission { operator, pool_address, accumulated_rewards, commission_amount }); + } else { + emit_event( + request_commission_events, + RequestCommissionEvent { operator, pool_address, accumulated_rewards, commission_amount }, + ); }; - emit_event( - request_commission_events, - RequestCommissionEvent { operator, pool_address, accumulated_rewards, commission_amount }, - ); commission_amount } @@ -2104,11 +2109,12 @@ This also triggers paying commission to the operator for accounting simplicity. let pool_address = staking_contract.pool_address; if (std::features::module_event_migration_enabled()) { emit(UnlockStake { pool_address, operator, amount, commission_paid }); + } else { + emit_event( + &mut store.unlock_stake_events, + UnlockStakeEvent { pool_address, operator, amount, commission_paid }, + ); }; - emit_event( - &mut store.unlock_stake_events, - UnlockStakeEvent { pool_address, operator, amount, commission_paid }, - ); }
@@ -2234,11 +2240,12 @@ Allows staker to switch operator without going through the lenghthy process to u simple_map::add(staking_contracts, new_operator, staking_contract); if (std::features::module_event_migration_enabled()) { emit(SwitchOperator { pool_address, old_operator, new_operator }); + } else { + emit_event( + &mut store.switch_operator_events, + SwitchOperatorEvent { pool_address, old_operator, new_operator } + ); }; - emit_event( - &mut store.switch_operator_events, - SwitchOperatorEvent { pool_address, old_operator, new_operator } - ); }
@@ -2361,7 +2368,7 @@ Distribute all unlocked (inactive) funds according to distribution shares. // Buy all recipients out of the distribution pool. while (pool_u64::shareholders_count(distribution_pool) > 0) { let recipients = pool_u64::shareholders(distribution_pool); - let recipient = *vector::borrow(&mut recipients, 0); + let recipient = *vector::borrow(&recipients, 0); let current_shares = pool_u64::shares(distribution_pool, recipient); let amount_to_distribute = pool_u64::redeem_shares(distribution_pool, recipient, current_shares); // If the recipient is the operator, send the commission to the beneficiary instead. @@ -2372,11 +2379,12 @@ Distribute all unlocked (inactive) funds according to distribution shares. if (std::features::module_event_migration_enabled()) { emit(Distribute { operator, pool_address, recipient, amount: amount_to_distribute }); + } else { + emit_event( + distribute_events, + DistributeEvent { operator, pool_address, recipient, amount: amount_to_distribute } + ); }; - emit_event( - distribute_events, - DistributeEvent { operator, pool_address, recipient, amount: amount_to_distribute } - ); }; // In case there's any dust left, send them all to the staker. @@ -2411,7 +2419,7 @@ Assert that a staking_contract exists for the staker/operator pair.
fun assert_staking_contract_exists(staker: address, operator: address) acquires Store {
     assert!(exists<Store>(staker), error::not_found(ENO_STAKING_CONTRACT_FOUND_FOR_STAKER));
-    let staking_contracts = &mut borrow_global_mut<Store>(staker).staking_contracts;
+    let staking_contracts = &borrow_global<Store>(staker).staking_contracts;
     assert!(
         simple_map::contains_key(staking_contracts, &operator),
         error::not_found(ENO_STAKING_CONTRACT_FOUND_FOR_OPERATOR),
@@ -2455,11 +2463,12 @@ Add a new distribution for recipient and amount to the
     let pool_address = staking_contract.pool_address;
     if (std::features::module_event_migration_enabled()) {
         emit(AddDistribution { operator, pool_address, amount: coins_amount });
+    } else {
+        emit_event(
+            add_distribution_events,
+            AddDistributionEvent { operator, pool_address, amount: coins_amount }
+        );
     };
-    emit_event(
-        add_distribution_events,
-        AddDistributionEvent { operator, pool_address, amount: coins_amount }
-    );
 }
 
@@ -3597,7 +3606,6 @@ a staking_contract exists for the staker/operator pair. requires exists<staking_config::StakingRewardsConfig>( @aptos_framework ) || !std::features::spec_periodical_reward_rate_decrease_enabled(); - requires exists<stake::ValidatorFees>(@aptos_framework); requires exists<aptos_framework::timestamp::CurrentTimeMicroseconds>(@aptos_framework); requires exists<stake::AptosCoinCapabilities>(@aptos_framework); } diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/transaction_fee.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/transaction_fee.md index 8051db864cac9..b4269080ce837 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/transaction_fee.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/transaction_fee.md @@ -9,39 +9,29 @@ This module provides an interface to burn or collect and redistribute transactio - [Resource `AptosCoinCapabilities`](#0x1_transaction_fee_AptosCoinCapabilities) - [Resource `AptosFABurnCapabilities`](#0x1_transaction_fee_AptosFABurnCapabilities) - [Resource `AptosCoinMintCapability`](#0x1_transaction_fee_AptosCoinMintCapability) -- [Resource `CollectedFeesPerBlock`](#0x1_transaction_fee_CollectedFeesPerBlock) - [Struct `FeeStatement`](#0x1_transaction_fee_FeeStatement) +- [Resource `CollectedFeesPerBlock`](#0x1_transaction_fee_CollectedFeesPerBlock) - [Constants](#@Constants_0) -- [Function `initialize_fee_collection_and_distribution`](#0x1_transaction_fee_initialize_fee_collection_and_distribution) -- [Function `is_fees_collection_enabled`](#0x1_transaction_fee_is_fees_collection_enabled) -- [Function `upgrade_burn_percentage`](#0x1_transaction_fee_upgrade_burn_percentage) -- [Function `register_proposer_for_fee_collection`](#0x1_transaction_fee_register_proposer_for_fee_collection) -- [Function `burn_coin_fraction`](#0x1_transaction_fee_burn_coin_fraction) -- [Function `process_collected_fees`](#0x1_transaction_fee_process_collected_fees) - [Function `burn_fee`](#0x1_transaction_fee_burn_fee) - [Function `mint_and_refund`](#0x1_transaction_fee_mint_and_refund) -- [Function `collect_fee`](#0x1_transaction_fee_collect_fee) - [Function `store_aptos_coin_burn_cap`](#0x1_transaction_fee_store_aptos_coin_burn_cap) - [Function `convert_to_aptos_fa_burn_ref`](#0x1_transaction_fee_convert_to_aptos_fa_burn_ref) - [Function `store_aptos_coin_mint_cap`](#0x1_transaction_fee_store_aptos_coin_mint_cap) -- [Function `initialize_storage_refund`](#0x1_transaction_fee_initialize_storage_refund) - [Function `emit_fee_statement`](#0x1_transaction_fee_emit_fee_statement) +- [Function `initialize_fee_collection_and_distribution`](#0x1_transaction_fee_initialize_fee_collection_and_distribution) +- [Function `upgrade_burn_percentage`](#0x1_transaction_fee_upgrade_burn_percentage) +- [Function `initialize_storage_refund`](#0x1_transaction_fee_initialize_storage_refund) - [Specification](#@Specification_1) - [High-level Requirements](#high-level-req) - [Module-level Specification](#module-level-spec) - [Resource `CollectedFeesPerBlock`](#@Specification_1_CollectedFeesPerBlock) - - [Function `initialize_fee_collection_and_distribution`](#@Specification_1_initialize_fee_collection_and_distribution) - - [Function `upgrade_burn_percentage`](#@Specification_1_upgrade_burn_percentage) - - [Function `register_proposer_for_fee_collection`](#@Specification_1_register_proposer_for_fee_collection) - - [Function `burn_coin_fraction`](#@Specification_1_burn_coin_fraction) - - [Function `process_collected_fees`](#@Specification_1_process_collected_fees) - [Function `burn_fee`](#@Specification_1_burn_fee) - [Function `mint_and_refund`](#@Specification_1_mint_and_refund) - - [Function `collect_fee`](#@Specification_1_collect_fee) - [Function `store_aptos_coin_burn_cap`](#@Specification_1_store_aptos_coin_burn_cap) - [Function `store_aptos_coin_mint_cap`](#@Specification_1_store_aptos_coin_mint_cap) - - [Function `initialize_storage_refund`](#@Specification_1_initialize_storage_refund) - [Function `emit_fee_statement`](#@Specification_1_emit_fee_statement) + - [Function `initialize_fee_collection_and_distribution`](#@Specification_1_initialize_fee_collection_and_distribution) + - [Function `initialize_storage_refund`](#@Specification_1_initialize_storage_refund)
use 0x1::aptos_account;
@@ -53,7 +43,6 @@ This module provides an interface to burn or collect and redistribute transactio
 use 0x1::fungible_asset;
 use 0x1::option;
 use 0x1::signer;
-use 0x1::stake;
 use 0x1::system_addresses;
 
@@ -141,47 +130,6 @@ Stores mint capability to mint the refunds. - - - - -## Resource `CollectedFeesPerBlock` - -Stores information about the block proposer and the amount of fees -collected when executing the block. - - -
struct CollectedFeesPerBlock has key
-
- - - -
-Fields - - -
-
-amount: coin::AggregatableCoin<aptos_coin::AptosCoin> -
-
- -
-
-proposer: option::Option<address> -
-
- -
-
-burn_percentage: u8 -
-
- -
-
- -
@@ -255,293 +203,93 @@ This is meant to emitted as a module event. - - -## Constants - - - - -Gas fees are already being collected and the struct holding -information about collected amounts is already published. - - -
const EALREADY_COLLECTING_FEES: u64 = 1;
-
- - - - - - - -
const EFA_GAS_CHARGING_NOT_ENABLED: u64 = 5;
-
- - - - - -The burn percentage is out of range [0, 100]. - - -
const EINVALID_BURN_PERCENTAGE: u64 = 3;
-
- - - - - -No longer supported. - - -
const ENO_LONGER_SUPPORTED: u64 = 4;
-
- - - - - -## Function `initialize_fee_collection_and_distribution` - -Initializes the resource storing information about gas fees collection and -distribution. Should be called by on-chain governance. - - -
public fun initialize_fee_collection_and_distribution(aptos_framework: &signer, burn_percentage: u8)
-
- - - -
-Implementation - - -
public fun initialize_fee_collection_and_distribution(aptos_framework: &signer, burn_percentage: u8) {
-    system_addresses::assert_aptos_framework(aptos_framework);
-    assert!(
-        !exists<CollectedFeesPerBlock>(@aptos_framework),
-        error::already_exists(EALREADY_COLLECTING_FEES)
-    );
-    assert!(burn_percentage <= 100, error::out_of_range(EINVALID_BURN_PERCENTAGE));
-
-    // Make sure stakng module is aware of transaction fees collection.
-    stake::initialize_validator_fees(aptos_framework);
-
-    // Initially, no fees are collected and the block proposer is not set.
-    let collected_fees = CollectedFeesPerBlock {
-        amount: coin::initialize_aggregatable_coin(aptos_framework),
-        proposer: option::none(),
-        burn_percentage,
-    };
-    move_to(aptos_framework, collected_fees);
-}
-
- - - -
- - - -## Function `is_fees_collection_enabled` - - - -
fun is_fees_collection_enabled(): bool
-
- - - -
-Implementation - - -
fun is_fees_collection_enabled(): bool {
-    exists<CollectedFeesPerBlock>(@aptos_framework)
-}
-
- - - -
- - + -## Function `upgrade_burn_percentage` +## Resource `CollectedFeesPerBlock` -Sets the burn percentage for collected fees to a new value. Should be called by on-chain governance. +DEPRECATED: Stores information about the block proposer and the amount of fees +collected when executing the block. -
public fun upgrade_burn_percentage(aptos_framework: &signer, new_burn_percentage: u8)
+
#[deprecated]
+struct CollectedFeesPerBlock has key
 
-Implementation +Fields -
public fun upgrade_burn_percentage(
-    aptos_framework: &signer,
-    new_burn_percentage: u8
-) acquires AptosCoinCapabilities, CollectedFeesPerBlock {
-    system_addresses::assert_aptos_framework(aptos_framework);
-    assert!(new_burn_percentage <= 100, error::out_of_range(EINVALID_BURN_PERCENTAGE));
+
+
+amount: coin::AggregatableCoin<aptos_coin::AptosCoin> +
+
- // Prior to upgrading the burn percentage, make sure to process collected - // fees. Otherwise we would use the new (incorrect) burn_percentage when - // processing fees later! - process_collected_fees(); +
+
+proposer: option::Option<address> +
+
- if (is_fees_collection_enabled()) { - // Upgrade has no effect unless fees are being collected. - let burn_percentage = &mut borrow_global_mut<CollectedFeesPerBlock>(@aptos_framework).burn_percentage; - *burn_percentage = new_burn_percentage - } -} -
+ +
+burn_percentage: u8 +
+
+
+
- - -## Function `register_proposer_for_fee_collection` - -Registers the proposer of the block for gas fees collection. This function -can only be called at the beginning of the block. - - -
public(friend) fun register_proposer_for_fee_collection(proposer_addr: address)
-
- - - -
-Implementation - - -
public(friend) fun register_proposer_for_fee_collection(proposer_addr: address) acquires CollectedFeesPerBlock {
-    if (is_fees_collection_enabled()) {
-        let collected_fees = borrow_global_mut<CollectedFeesPerBlock>(@aptos_framework);
-        let _ = option::swap_or_fill(&mut collected_fees.proposer, proposer_addr);
-    }
-}
-
- - + -
+## Constants - -## Function `burn_coin_fraction` + -Burns a specified fraction of the coin. +Gas fees are already being collected and the struct holding +information about collected amounts is already published. -
fun burn_coin_fraction(coin: &mut coin::Coin<aptos_coin::AptosCoin>, burn_percentage: u8)
+
const EALREADY_COLLECTING_FEES: u64 = 1;
 
-
-Implementation + -
fun burn_coin_fraction(coin: &mut Coin<AptosCoin>, burn_percentage: u8) acquires AptosCoinCapabilities {
-    assert!(burn_percentage <= 100, error::out_of_range(EINVALID_BURN_PERCENTAGE));
 
-    let collected_amount = coin::value(coin);
-    spec {
-        // We assume that `burn_percentage * collected_amount` does not overflow.
-        assume burn_percentage * collected_amount <= MAX_U64;
-    };
-    let amount_to_burn = (burn_percentage as u64) * collected_amount / 100;
-    if (amount_to_burn > 0) {
-        let coin_to_burn = coin::extract(coin, amount_to_burn);
-        coin::burn(
-            coin_to_burn,
-            &borrow_global<AptosCoinCapabilities>(@aptos_framework).burn_cap,
-        );
-    }
-}
+
const EFA_GAS_CHARGING_NOT_ENABLED: u64 = 5;
 
-
- - - -## Function `process_collected_fees` + -Calculates the fee which should be distributed to the block proposer at the -end of an epoch, and records it in the system. This function can only be called -at the beginning of the block or during reconfiguration. +The burn percentage is out of range [0, 100]. -
public(friend) fun process_collected_fees()
+
const EINVALID_BURN_PERCENTAGE: u64 = 3;
 
-
-Implementation - - -
public(friend) fun process_collected_fees() acquires AptosCoinCapabilities, CollectedFeesPerBlock {
-    if (!is_fees_collection_enabled()) {
-        return
-    };
-    let collected_fees = borrow_global_mut<CollectedFeesPerBlock>(@aptos_framework);
-
-    // If there are no collected fees, only unset the proposer. See the rationale for
-    // setting proposer to option::none() below.
-    if (coin::is_aggregatable_coin_zero(&collected_fees.amount)) {
-        if (option::is_some(&collected_fees.proposer)) {
-            let _ = option::extract(&mut collected_fees.proposer);
-        };
-        return
-    };
+
 
-    // Otherwise get the collected fee, and check if it can distributed later.
-    let coin = coin::drain_aggregatable_coin(&mut collected_fees.amount);
-    if (option::is_some(&collected_fees.proposer)) {
-        // Extract the address of proposer here and reset it to option::none(). This
-        // is particularly useful to avoid any undesired side-effects where coins are
-        // collected but never distributed or distributed to the wrong account.
-        // With this design, processing collected fees enforces that all fees will be burnt
-        // unless the proposer is specified in the block prologue. When we have a governance
-        // proposal that triggers reconfiguration, we distribute pending fees and burn the
-        // fee for the proposal. Otherwise, that fee would be leaked to the next block.
-        let proposer = option::extract(&mut collected_fees.proposer);
-
-        // Since the block can be produced by the VM itself, we have to make sure we catch
-        // this case.
-        if (proposer == @vm_reserved) {
-            burn_coin_fraction(&mut coin, 100);
-            coin::destroy_zero(coin);
-            return
-        };
+No longer supported.
 
-        burn_coin_fraction(&mut coin, collected_fees.burn_percentage);
-        stake::add_transaction_fee(proposer, coin);
-        return
-    };
 
-    // If checks did not pass, simply burn all collected coins and return none.
-    burn_coin_fraction(&mut coin, 100);
-    coin::destroy_zero(coin)
-}
+
const ENO_LONGER_SUPPORTED: u64 = 4;
 
-
- ## Function `burn_fee` @@ -608,37 +356,6 @@ Mint refund in epilogue. - - - - -## Function `collect_fee` - -Collect transaction fees in epilogue. - - -
public(friend) fun collect_fee(account: address, fee: u64)
-
- - - -
-Implementation - - -
public(friend) fun collect_fee(account: address, fee: u64) acquires CollectedFeesPerBlock {
-    let collected_fees = borrow_global_mut<CollectedFeesPerBlock>(@aptos_framework);
-
-    // Here, we are always optimistic and always collect fees. If the proposer is not set,
-    // or we cannot redistribute fees later for some reason (e.g. account cannot receive AptoCoin)
-    // we burn them all at once. This way we avoid having a check for every transaction epilogue.
-    let collected_amount = &mut collected_fees.amount;
-    coin::collect_into_aggregatable_coin<AptosCoin>(account, fee, collected_amount);
-}
-
- - -
@@ -729,14 +446,39 @@ Only called during genesis. - + -## Function `initialize_storage_refund` +## Function `emit_fee_statement` +
fun emit_fee_statement(fee_statement: transaction_fee::FeeStatement)
+
+ + + +
+Implementation + + +
fun emit_fee_statement(fee_statement: FeeStatement) {
+    event::emit(fee_statement)
+}
+
+ + + +
+ + + +## Function `initialize_fee_collection_and_distribution` + +DEPRECATED + +
#[deprecated]
-public fun initialize_storage_refund(_: &signer)
+public fun initialize_fee_collection_and_distribution(_aptos_framework: &signer, _burn_percentage: u8)
 
@@ -745,7 +487,7 @@ Only called during genesis. Implementation -
public fun initialize_storage_refund(_: &signer) {
+
public fun initialize_fee_collection_and_distribution(_aptos_framework: &signer, _burn_percentage: u8) {
     abort error::not_implemented(ENO_LONGER_SUPPORTED)
 }
 
@@ -754,13 +496,15 @@ Only called during genesis. - + -## Function `emit_fee_statement` +## Function `upgrade_burn_percentage` +DEPRECATED -
fun emit_fee_statement(fee_statement: transaction_fee::FeeStatement)
+
#[deprecated]
+public fun upgrade_burn_percentage(_aptos_framework: &signer, _new_burn_percentage: u8)
 
@@ -769,8 +513,36 @@ Only called during genesis. Implementation -
fun emit_fee_statement(fee_statement: FeeStatement) {
-    event::emit(fee_statement)
+
public fun upgrade_burn_percentage(
+    _aptos_framework: &signer,
+    _new_burn_percentage: u8
+) {
+    abort error::not_implemented(ENO_LONGER_SUPPORTED)
+}
+
+ + + + + + + +## Function `initialize_storage_refund` + + + +
#[deprecated]
+public fun initialize_storage_refund(_: &signer)
+
+ + + +
+Implementation + + +
public fun initialize_storage_refund(_: &signer) {
+    abort error::not_implemented(ENO_LONGER_SUPPORTED)
 }
 
@@ -865,7 +637,8 @@ Only called during genesis. ### Resource `CollectedFeesPerBlock` -
struct CollectedFeesPerBlock has key
+
#[deprecated]
+struct CollectedFeesPerBlock has key
 
@@ -899,178 +672,6 @@ Only called during genesis. - - -### Function `initialize_fee_collection_and_distribution` - - -
public fun initialize_fee_collection_and_distribution(aptos_framework: &signer, burn_percentage: u8)
-
- - - - -
// This enforces high-level requirement 2:
-aborts_if exists<CollectedFeesPerBlock>(@aptos_framework);
-aborts_if burn_percentage > 100;
-let aptos_addr = signer::address_of(aptos_framework);
-// This enforces high-level requirement 3:
-aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
-aborts_if exists<ValidatorFees>(aptos_addr);
-include system_addresses::AbortsIfNotAptosFramework { account: aptos_framework };
-include aggregator_factory::CreateAggregatorInternalAbortsIf;
-aborts_if exists<CollectedFeesPerBlock>(aptos_addr);
-ensures exists<ValidatorFees>(aptos_addr);
-ensures exists<CollectedFeesPerBlock>(aptos_addr);
-
- - - - - -### Function `upgrade_burn_percentage` - - -
public fun upgrade_burn_percentage(aptos_framework: &signer, new_burn_percentage: u8)
-
- - - - -
aborts_if new_burn_percentage > 100;
-let aptos_addr = signer::address_of(aptos_framework);
-aborts_if !system_addresses::is_aptos_framework_address(aptos_addr);
-// This enforces high-level requirement 5 and high-level requirement 6:
-include ProcessCollectedFeesRequiresAndEnsures;
-ensures exists<CollectedFeesPerBlock>(@aptos_framework) ==>
-    global<CollectedFeesPerBlock>(@aptos_framework).burn_percentage == new_burn_percentage;
-
- - - - - -### Function `register_proposer_for_fee_collection` - - -
public(friend) fun register_proposer_for_fee_collection(proposer_addr: address)
-
- - - - -
aborts_if false;
-// This enforces high-level requirement 6:
-ensures is_fees_collection_enabled() ==>
-    option::spec_borrow(global<CollectedFeesPerBlock>(@aptos_framework).proposer) == proposer_addr;
-
- - - - - -### Function `burn_coin_fraction` - - -
fun burn_coin_fraction(coin: &mut coin::Coin<aptos_coin::AptosCoin>, burn_percentage: u8)
-
- - - - -
requires burn_percentage <= 100;
-requires exists<AptosCoinCapabilities>(@aptos_framework);
-requires exists<CoinInfo<AptosCoin>>(@aptos_framework);
-let amount_to_burn = (burn_percentage * coin::value(coin)) / 100;
-include amount_to_burn > 0 ==> coin::CoinSubAbortsIf<AptosCoin> { amount: amount_to_burn };
-ensures coin.value == old(coin).value - amount_to_burn;
-
- - - - - - - -
fun collectedFeesAggregator(): AggregatableCoin<AptosCoin> {
-   global<CollectedFeesPerBlock>(@aptos_framework).amount
-}
-
- - - - - - - -
schema RequiresCollectedFeesPerValueLeqBlockAptosSupply {
-    let maybe_supply = coin::get_coin_supply_opt<AptosCoin>();
-    requires
-        (is_fees_collection_enabled() && option::is_some(maybe_supply)) ==>
-            (aggregator::spec_aggregator_get_val(global<CollectedFeesPerBlock>(@aptos_framework).amount.value) <=
-                optional_aggregator::optional_aggregator_value(
-                    option::spec_borrow(coin::get_coin_supply_opt<AptosCoin>())
-                ));
-}
-
- - - - - - - -
schema ProcessCollectedFeesRequiresAndEnsures {
-    requires exists<AptosCoinCapabilities>(@aptos_framework);
-    requires exists<stake::ValidatorFees>(@aptos_framework);
-    requires exists<CoinInfo<AptosCoin>>(@aptos_framework);
-    include RequiresCollectedFeesPerValueLeqBlockAptosSupply;
-    aborts_if false;
-    let collected_fees = global<CollectedFeesPerBlock>(@aptos_framework);
-    let post post_collected_fees = global<CollectedFeesPerBlock>(@aptos_framework);
-    let pre_amount = aggregator::spec_aggregator_get_val(collected_fees.amount.value);
-    let post post_amount = aggregator::spec_aggregator_get_val(post_collected_fees.amount.value);
-    let fees_table = global<stake::ValidatorFees>(@aptos_framework).fees_table;
-    let post post_fees_table = global<stake::ValidatorFees>(@aptos_framework).fees_table;
-    let proposer = option::spec_borrow(collected_fees.proposer);
-    let fee_to_add = pre_amount - pre_amount * collected_fees.burn_percentage / 100;
-    ensures is_fees_collection_enabled() ==> option::spec_is_none(post_collected_fees.proposer) && post_amount == 0;
-    ensures is_fees_collection_enabled() && aggregator::spec_read(collected_fees.amount.value) > 0 &&
-        option::spec_is_some(collected_fees.proposer) ==>
-        if (proposer != @vm_reserved) {
-            if (table::spec_contains(fees_table, proposer)) {
-                table::spec_get(post_fees_table, proposer).value == table::spec_get(
-                    fees_table,
-                    proposer
-                ).value + fee_to_add
-            } else {
-                table::spec_get(post_fees_table, proposer).value == fee_to_add
-            }
-        } else {
-            option::spec_is_none(post_collected_fees.proposer) && post_amount == 0
-        };
-}
-
- - - - - -### Function `process_collected_fees` - - -
public(friend) fun process_collected_fees()
-
- - - - -
// This enforces high-level requirement 6:
-include ProcessCollectedFeesRequiresAndEnsures;
-
- - - ### Function `burn_fee` @@ -1136,38 +737,6 @@ Only called during genesis. - - -### Function `collect_fee` - - -
public(friend) fun collect_fee(account: address, fee: u64)
-
- - - - -
pragma verify = false;
-let collected_fees = global<CollectedFeesPerBlock>(@aptos_framework).amount;
-let aggr = collected_fees.value;
-let coin_store = global<coin::CoinStore<AptosCoin>>(account);
-aborts_if !exists<CollectedFeesPerBlock>(@aptos_framework);
-aborts_if fee > 0 && !exists<coin::CoinStore<AptosCoin>>(account);
-aborts_if fee > 0 && coin_store.coin.value < fee;
-aborts_if fee > 0 && aggregator::spec_aggregator_get_val(aggr)
-    + fee > aggregator::spec_get_limit(aggr);
-aborts_if fee > 0 && aggregator::spec_aggregator_get_val(aggr)
-    + fee > MAX_U128;
-let post post_coin_store = global<coin::CoinStore<AptosCoin>>(account);
-let post post_collected_fees = global<CollectedFeesPerBlock>(@aptos_framework).amount;
-ensures post_coin_store.coin.value == coin_store.coin.value - fee;
-ensures aggregator::spec_aggregator_get_val(post_collected_fees.value) == aggregator::spec_aggregator_get_val(
-    aggr
-) + fee;
-
- - - ### Function `store_aptos_coin_burn_cap` @@ -1212,34 +781,45 @@ Aborts if + -### Function `initialize_storage_refund` +### Function `emit_fee_statement` -
#[deprecated]
-public fun initialize_storage_refund(_: &signer)
+
fun emit_fee_statement(fee_statement: transaction_fee::FeeStatement)
 
-Historical. Aborts. +Aborts if module event feature is not enabled. -
aborts_if true;
+
+
+### Function `initialize_fee_collection_and_distribution`
+
+
+
#[deprecated]
+public fun initialize_fee_collection_and_distribution(_aptos_framework: &signer, _burn_percentage: u8)
 
- -### Function `emit_fee_statement` + +### Function `initialize_storage_refund` -
fun emit_fee_statement(fee_statement: transaction_fee::FeeStatement)
+
+
#[deprecated]
+public fun initialize_storage_refund(_: &signer)
 
-Aborts if module event feature is not enabled. +Historical. Aborts. + + +
aborts_if true;
+
[move-book]: https://aptos.dev/move/book/SUMMARY diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/transaction_validation.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/transaction_validation.md index db66b1d46926d..e26bbacedd677 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/transaction_validation.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/transaction_validation.md @@ -888,26 +888,11 @@ Called by the Adapter ); }; - let amount_to_burn = if (features::collect_and_distribute_gas_fees()) { - // TODO(gas): We might want to distinguish the refundable part of the charge and burn it or track - // it separately, so that we don't increase the total supply by refunding. - - // If transaction fees are redistributed to validators, collect them here for - // later redistribution. - transaction_fee::collect_fee(gas_payer, transaction_fee_amount); - 0 - } else { - // Otherwise, just burn the fee. - // TODO: this branch should be removed completely when transaction fee collection - // is tested and is fully proven to work well. - transaction_fee_amount - }; - - if (amount_to_burn > storage_fee_refunded) { - let burn_amount = amount_to_burn - storage_fee_refunded; + if (transaction_fee_amount > storage_fee_refunded) { + let burn_amount = transaction_fee_amount - storage_fee_refunded; transaction_fee::burn_fee(gas_payer, burn_amount); - } else if (amount_to_burn < storage_fee_refunded) { - let mint_amount = storage_fee_refunded - amount_to_burn; + } else if (transaction_fee_amount < storage_fee_refunded) { + let mint_amount = storage_fee_refunded - transaction_fee_amount; transaction_fee::mint_and_refund(gas_payer, mint_amount) }; }; @@ -1372,19 +1357,7 @@ Skip transaction_fee::burn_fee verification. aborts_if !exists<Account>(addr); aborts_if !(global<Account>(addr).sequence_number < MAX_U64); ensures account.sequence_number == pre_account.sequence_number + 1; - let collect_fee_enabled = features::spec_is_enabled(features::COLLECT_AND_DISTRIBUTE_GAS_FEES); - let collected_fees = global<CollectedFeesPerBlock>(@aptos_framework).amount; - let aggr = collected_fees.value; - let aggr_val = aggregator::spec_aggregator_get_val(aggr); - let aggr_lim = aggregator::spec_get_limit(aggr); - // This enforces high-level requirement 3: - aborts_if collect_fee_enabled && !exists<CollectedFeesPerBlock>(@aptos_framework); - aborts_if collect_fee_enabled && transaction_fee_amount > 0 && aggr_val + transaction_fee_amount > aggr_lim; - let amount_to_burn = if (collect_fee_enabled) { - 0 - } else { - transaction_fee_amount - storage_fee_refunded - }; + let amount_to_burn = transaction_fee_amount - storage_fee_refunded; let apt_addr = type_info::type_of<AptosCoin>().account_address; let maybe_apt_supply = global<CoinInfo<AptosCoin>>(apt_addr).supply; let total_supply_enabled = option::spec_is_some(maybe_apt_supply); @@ -1397,11 +1370,7 @@ Skip transaction_fee::burn_fee verification. aborts_if amount_to_burn > 0 && !exists<CoinInfo<AptosCoin>>(apt_addr); aborts_if amount_to_burn > 0 && total_supply_enabled && apt_supply_value < amount_to_burn; ensures total_supply_enabled ==> apt_supply_value - amount_to_burn == post_apt_supply_value; - let amount_to_mint = if (collect_fee_enabled) { - storage_fee_refunded - } else { - storage_fee_refunded - transaction_fee_amount - }; + let amount_to_mint = storage_fee_refunded - transaction_fee_amount; let total_supply = coin::supply<AptosCoin>; let post post_total_supply = coin::supply<AptosCoin>; aborts_if amount_to_mint > 0 && !exists<CoinStore<AptosCoin>>(addr); diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/version.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/version.md index 28e34690a97de..d8b643cbded53 100644 --- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/version.md +++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/version.md @@ -358,11 +358,9 @@ Abort if resource already exists in @aptos_framwork when initializi
pragma verify_duration_estimate = 120;
-include transaction_fee::RequiresCollectedFeesPerValueLeqBlockAptosSupply;
 include staking_config::StakingRewardsConfigRequirement;
 requires chain_status::is_genesis();
 requires timestamp::spec_now_microseconds() >= reconfiguration::last_reconfiguration_time();
-requires exists<stake::ValidatorFees>(@aptos_framework);
 requires exists<CoinInfo<AptosCoin>>(@aptos_framework);
 aborts_if !exists<SetVersionCapability>(signer::address_of(account));
 aborts_if !exists<Version>(@aptos_framework);
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/vesting.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/vesting.md
index 49260e36409c8..13f4e401039ba 100644
--- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/vesting.md
+++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/vesting.md
@@ -2223,19 +2223,20 @@ Create a vesting contract with a given configurations.
                 commission_percentage,
             },
         );
+    } else {
+        emit_event(
+            &mut admin_store.create_events,
+            CreateVestingContractEvent {
+                operator,
+                voter,
+                withdrawal_address,
+                grant_amount,
+                vesting_contract_address: contract_address,
+                staking_pool_address: pool_address,
+                commission_percentage,
+            },
+        );
     };
-    emit_event(
-        &mut admin_store.create_events,
-        CreateVestingContractEvent {
-            operator,
-            voter,
-            withdrawal_address,
-            grant_amount,
-            vesting_contract_address: contract_address,
-            staking_pool_address: pool_address,
-            commission_percentage,
-        },
-    );
 
     move_to(&contract_signer, VestingContract {
         state: VESTING_POOL_ACTIVE,
@@ -2392,17 +2393,18 @@ Unlock any vested portion of the grant.
                 amount: vested_amount,
             },
         );
+    } else {
+        emit_event(
+            &mut vesting_contract.vest_events,
+            VestEvent {
+                admin: vesting_contract.admin,
+                vesting_contract_address: contract_address,
+                staking_pool_address: vesting_contract.staking.pool_address,
+                period_vested: next_period_to_vest,
+                amount: vested_amount,
+            },
+        );
     };
-    emit_event(
-        &mut vesting_contract.vest_events,
-        VestEvent {
-            admin: vesting_contract.admin,
-            vesting_contract_address: contract_address,
-            staking_pool_address: vesting_contract.staking.pool_address,
-            period_vested: next_period_to_vest,
-            amount: vested_amount,
-        },
-    );
 }
 
@@ -2496,15 +2498,16 @@ Distribute any withdrawable stake from the stake pool. amount: total_distribution_amount, }, ); + } else { + emit_event( + &mut vesting_contract.distribute_events, + DistributeEvent { + admin: vesting_contract.admin, + vesting_contract_address: contract_address, + amount: total_distribution_amount, + }, + ); }; - emit_event( - &mut vesting_contract.distribute_events, - DistributeEvent { - admin: vesting_contract.admin, - vesting_contract_address: contract_address, - amount: total_distribution_amount, - }, - ); }
@@ -2583,14 +2586,15 @@ Terminate the vesting contract and send all funds back to the withdrawal address vesting_contract_address: contract_address, }, ); + } else { + emit_event( + &mut vesting_contract.terminate_events, + TerminateEvent { + admin: vesting_contract.admin, + vesting_contract_address: contract_address, + }, + ); }; - emit_event( - &mut vesting_contract.terminate_events, - TerminateEvent { - admin: vesting_contract.admin, - vesting_contract_address: contract_address, - }, - ); }
@@ -2640,15 +2644,16 @@ has already been terminated. amount, }, ); + } else { + emit_event( + &mut vesting_contract.admin_withdraw_events, + AdminWithdrawEvent { + admin: vesting_contract.admin, + vesting_contract_address: contract_address, + amount, + }, + ); }; - emit_event( - &mut vesting_contract.admin_withdraw_events, - AdminWithdrawEvent { - admin: vesting_contract.admin, - vesting_contract_address: contract_address, - amount, - }, - ); }
@@ -2696,18 +2701,19 @@ has already been terminated. commission_percentage, }, ); + } else { + emit_event( + &mut vesting_contract.update_operator_events, + UpdateOperatorEvent { + admin: vesting_contract.admin, + vesting_contract_address: contract_address, + staking_pool_address: vesting_contract.staking.pool_address, + old_operator, + new_operator, + commission_percentage, + }, + ); }; - emit_event( - &mut vesting_contract.update_operator_events, - UpdateOperatorEvent { - admin: vesting_contract.admin, - vesting_contract_address: contract_address, - staking_pool_address: vesting_contract.staking.pool_address, - old_operator, - new_operator, - commission_percentage, - }, - ); }
@@ -2816,17 +2822,18 @@ has already been terminated. new_voter, }, ); - }; - emit_event( - &mut vesting_contract.update_voter_events, - UpdateVoterEvent { - admin: vesting_contract.admin, - vesting_contract_address: contract_address, - staking_pool_address: vesting_contract.staking.pool_address, - old_voter, - new_voter, - }, - ); + } else { + emit_event( + &mut vesting_contract.update_voter_events, + UpdateVoterEvent { + admin: vesting_contract.admin, + vesting_contract_address: contract_address, + staking_pool_address: vesting_contract.staking.pool_address, + old_voter, + new_voter, + }, + ); + } }
@@ -2867,16 +2874,17 @@ has already been terminated. new_lockup_expiration_secs: stake::get_lockup_secs(vesting_contract.staking.pool_address), }, ); + } else { + emit_event( + &mut vesting_contract.reset_lockup_events, + ResetLockupEvent { + admin: vesting_contract.admin, + vesting_contract_address: contract_address, + staking_pool_address: vesting_contract.staking.pool_address, + new_lockup_expiration_secs: stake::get_lockup_secs(vesting_contract.staking.pool_address), + }, + ); }; - emit_event( - &mut vesting_contract.reset_lockup_events, - ResetLockupEvent { - admin: vesting_contract.admin, - vesting_contract_address: contract_address, - staking_pool_address: vesting_contract.staking.pool_address, - new_lockup_expiration_secs: stake::get_lockup_secs(vesting_contract.staking.pool_address), - }, - ); }
@@ -2931,17 +2939,18 @@ has already been terminated. new_beneficiary, }, ); + } else { + emit_event( + &mut vesting_contract.set_beneficiary_events, + SetBeneficiaryEvent { + admin: vesting_contract.admin, + vesting_contract_address: contract_address, + shareholder, + old_beneficiary, + new_beneficiary, + }, + ); }; - emit_event( - &mut vesting_contract.set_beneficiary_events, - SetBeneficiaryEvent { - admin: vesting_contract.admin, - vesting_contract_address: contract_address, - shareholder, - old_beneficiary, - new_beneficiary, - }, - ); }
@@ -3011,7 +3020,7 @@ account. role: String, role_holder: address, ) acquires VestingAccountManagement, VestingContract { - let vesting_contract = borrow_global_mut<VestingContract>(contract_address); + let vesting_contract = borrow_global<VestingContract>(contract_address); verify_admin(admin, vesting_contract); if (!exists<VestingAccountManagement>(contract_address)) { @@ -3135,7 +3144,7 @@ staking_contract and stake modules.
public fun get_vesting_account_signer(admin: &signer, contract_address: address): signer acquires VestingContract {
-    let vesting_contract = borrow_global_mut<VestingContract>(contract_address);
+    let vesting_contract = borrow_global<VestingContract>(contract_address);
     verify_admin(admin, vesting_contract);
     get_vesting_account_signer_internal(vesting_contract)
 }
diff --git a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/voting.md b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/voting.md
index 431eb53db9cb5..dbbe6277120af 100644
--- a/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/voting.md
+++ b/aptos-move/framework/aptos-framework/tests/compiler-v2-doc/voting.md
@@ -817,14 +817,15 @@ Key used to track the resolvable time in the proposal's metadata.
                 proposal_type_info: type_info::type_of<ProposalType>(),
             },
         );
+    } else {
+        event::emit_event<RegisterForumEvent>(
+            &mut voting_forum.events.register_forum_events,
+            RegisterForumEvent {
+                hosting_account: addr,
+                proposal_type_info: type_info::type_of<ProposalType>(),
+            },
+        );
     };
-    event::emit_event<RegisterForumEvent>(
-        &mut voting_forum.events.register_forum_events,
-        RegisterForumEvent {
-            hosting_account: addr,
-            proposal_type_info: type_info::type_of<ProposalType>(),
-        },
-    );
 
     move_to(account, voting_forum);
 }
@@ -952,7 +953,7 @@ resolve this proposal.
         simple_map::add(&mut metadata, is_multi_step_in_execution_key, to_bytes(&false));
         // If the proposal is a single-step proposal, we check if the metadata passed by the client has the IS_MULTI_STEP_PROPOSAL_IN_EXECUTION_KEY key.
         // If they have the key, we will remove it, because a single-step proposal that doesn't need this key.
-    } else if (simple_map::contains_key(&mut metadata, &is_multi_step_in_execution_key)) {
+    } else if (simple_map::contains_key(&metadata, &is_multi_step_in_execution_key)) {
         simple_map::remove(&mut metadata, &is_multi_step_in_execution_key);
     };
 
@@ -982,19 +983,19 @@ resolve this proposal.
                 min_vote_threshold,
             },
         );
+    } else {
+        event::emit_event<CreateProposalEvent>(
+            &mut voting_forum.events.create_proposal_events,
+            CreateProposalEvent {
+                proposal_id,
+                early_resolution_vote_threshold,
+                execution_hash,
+                expiration_secs,
+                metadata,
+                min_vote_threshold,
+            },
+        );
     };
-    event::emit_event<CreateProposalEvent>(
-        &mut voting_forum.events.create_proposal_events,
-        CreateProposalEvent {
-            proposal_id,
-            early_resolution_vote_threshold,
-            execution_hash,
-            expiration_secs,
-            metadata,
-            min_vote_threshold,
-        },
-    );
-
     proposal_id
 }
 
@@ -1066,11 +1067,12 @@ This guarantees that voting eligibility and voting power are controlled by the r if (std::features::module_event_migration_enabled()) { event::emit(Vote { proposal_id, num_votes }); + } else { + event::emit_event<VoteEvent>( + &mut voting_forum.events.vote_events, + VoteEvent { proposal_id, num_votes }, + ); }; - event::emit_event<VoteEvent>( - &mut voting_forum.events.vote_events, - VoteEvent { proposal_id, num_votes }, - ); }
@@ -1174,16 +1176,17 @@ there are more yes votes than no. If either of these conditions is not met, this resolved_early, }, ); + } else { + event::emit_event<ResolveProposal>( + &mut voting_forum.events.resolve_proposal_events, + ResolveProposal { + proposal_id, + yes_votes: proposal.yes_votes, + no_votes: proposal.no_votes, + resolved_early, + }, + ); }; - event::emit_event<ResolveProposal>( - &mut voting_forum.events.resolve_proposal_events, - ResolveProposal { - proposal_id, - yes_votes: proposal.yes_votes, - no_votes: proposal.no_votes, - resolved_early, - }, - ); option::extract(&mut proposal.execution_content) } @@ -1283,17 +1286,17 @@ there are more yes votes than no. If either of these conditions is not met, this resolved_early, }, ); + } else { + event::emit_event( + &mut voting_forum.events.resolve_proposal_events, + ResolveProposal { + proposal_id, + yes_votes: proposal.yes_votes, + no_votes: proposal.no_votes, + resolved_early, + }, + ); }; - event::emit_event( - &mut voting_forum.events.resolve_proposal_events, - ResolveProposal { - proposal_id, - yes_votes: proposal.yes_votes, - no_votes: proposal.no_votes, - resolved_early, - }, - ); - }
diff --git a/aptos-move/framework/aptos-token-objects/tests/compiler-v2-doc/collection.md b/aptos-move/framework/aptos-token-objects/tests/compiler-v2-doc/collection.md index 5139b860a3f50..185c3beca8d08 100644 --- a/aptos-move/framework/aptos-token-objects/tests/compiler-v2-doc/collection.md +++ b/aptos-move/framework/aptos-token-objects/tests/compiler-v2-doc/collection.md @@ -63,6 +63,8 @@ require adding the field original_name. - [Function `set_description`](#0x4_collection_set_description) - [Function `set_uri`](#0x4_collection_set_uri) - [Function `set_max_supply`](#0x4_collection_set_max_supply) +- [Specification](#@Specification_1) + - [Function `increment_supply`](#@Specification_1_increment_supply)
use 0x1::aggregator_v2;
@@ -1220,13 +1222,14 @@ Called by token on mint to increment supply if there's an appropriate Supply str
                     token,
                 },
             );
+        } else {
+            event::emit_event(&mut supply.mint_events,
+                MintEvent {
+                    index: supply.total_minted,
+                    token,
+                },
+            );
         };
-        event::emit_event(&mut supply.mint_events,
-            MintEvent {
-                index: supply.total_minted,
-                token,
-            },
-        );
         option::some(aggregator_v2::create_snapshot<u64>(supply.total_minted))
     } else if (exists<UnlimitedSupply>(collection_addr)) {
         let supply = borrow_global_mut<UnlimitedSupply>(collection_addr);
@@ -1240,14 +1243,15 @@ Called by token on mint to increment supply if there's an appropriate Supply str
                     token,
                 },
             );
+        } else {
+            event::emit_event(
+                &mut supply.mint_events,
+                MintEvent {
+                    index: supply.total_minted,
+                    token,
+                },
+            );
         };
-        event::emit_event(
-            &mut supply.mint_events,
-            MintEvent {
-                index: supply.total_minted,
-                token,
-            },
-        );
         option::some(aggregator_v2::create_snapshot<u64>(supply.total_minted))
     } else {
         option::none()
@@ -1306,14 +1310,15 @@ Called by token on burn to decrement supply if there's an appropriate Supply str
                     previous_owner,
                 },
             );
+        } else {
+            event::emit_event(
+                &mut supply.burn_events,
+                BurnEvent {
+                    index: *option::borrow(&index),
+                    token,
+                },
+            );
         };
-        event::emit_event(
-            &mut supply.burn_events,
-            BurnEvent {
-                index: *option::borrow(&index),
-                token,
-            },
-        );
     } else if (exists<UnlimitedSupply>(collection_addr)) {
         let supply = borrow_global_mut<UnlimitedSupply>(collection_addr);
         supply.current_supply = supply.current_supply - 1;
@@ -1326,14 +1331,15 @@ Called by token on burn to decrement supply if there's an appropriate Supply str
                     previous_owner,
                 },
             );
+        } else {
+            event::emit_event(
+                &mut supply.burn_events,
+                BurnEvent {
+                    index: *option::borrow(&index),
+                    token,
+                },
+            );
         };
-        event::emit_event(
-            &mut supply.burn_events,
-            BurnEvent {
-                index: *option::borrow(&index),
-                token,
-            },
-        );
     }
 }
 
@@ -1716,6 +1722,7 @@ After changing the collection's name, to create tokens - only call functions tha
public fun set_description(mutator_ref: &MutatorRef, description: String) acquires Collection {
     assert!(string::length(&description) <= MAX_DESCRIPTION_LENGTH, error::out_of_range(EDESCRIPTION_TOO_LONG));
     let collection = borrow_mut(mutator_ref);
+    collection.description = description;
     if (std::features::module_event_migration_enabled()) {
         event::emit(Mutation {
             mutated_field_name: string::utf8(b"description"),
@@ -1723,12 +1730,12 @@ After changing the collection's name, to create tokens - only call functions tha
             old_value: collection.description,
             new_value: description,
         });
+    } else {
+        event::emit_event(
+            &mut collection.mutation_events,
+            MutationEvent { mutated_field_name: string::utf8(b"description") },
+        );
     };
-    collection.description = description;
-    event::emit_event(
-        &mut collection.mutation_events,
-        MutationEvent { mutated_field_name: string::utf8(b"description") },
-    );
 }
 
@@ -1754,6 +1761,7 @@ After changing the collection's name, to create tokens - only call functions tha
public fun set_uri(mutator_ref: &MutatorRef, uri: String) acquires Collection {
     assert!(string::length(&uri) <= MAX_URI_LENGTH, error::out_of_range(EURI_TOO_LONG));
     let collection = borrow_mut(mutator_ref);
+    collection.uri = uri;
     if (std::features::module_event_migration_enabled()) {
         event::emit(Mutation {
             mutated_field_name: string::utf8(b"uri"),
@@ -1761,12 +1769,12 @@ After changing the collection's name, to create tokens - only call functions tha
             old_value: collection.uri,
             new_value: uri,
         });
+    } else {
+        event::emit_event(
+            &mut collection.mutation_events,
+            MutationEvent { mutated_field_name: string::utf8(b"uri") },
+        );
     };
-    collection.uri = uri;
-    event::emit_event(
-        &mut collection.mutation_events,
-        MutationEvent { mutated_field_name: string::utf8(b"uri") },
-    );
 }
 
@@ -1824,5 +1832,41 @@ After changing the collection's name, to create tokens - only call functions tha + + +## Specification + + + + +### Function `increment_supply` + + +
public(friend) fun increment_supply(collection: &object::Object<collection::Collection>, token: address): option::Option<aggregator_v2::AggregatorSnapshot<u64>>
+
+ + + + +
pragma aborts_if_is_partial;
+let collection_addr = object::object_address(collection);
+let supply = global<ConcurrentSupply>(collection_addr);
+let post supply_post = global<ConcurrentSupply>(collection_addr);
+aborts_if exists<ConcurrentSupply>(collection_addr) &&
+    aggregator_v2::spec_get_value(supply.current_supply) + 1
+        > aggregator_v2::spec_get_max_value(supply.current_supply);
+aborts_if exists<ConcurrentSupply>(collection_addr) &&
+    aggregator_v2::spec_get_value(supply.total_minted) + 1
+        > aggregator_v2::spec_get_max_value(supply.total_minted);
+ensures
+    aggregator_v2::spec_get_max_value(supply.current_supply)
+        == aggregator_v2::spec_get_max_value(supply_post.current_supply);
+ensures exists<ConcurrentSupply>(collection_addr) &&
+    aggregator_v2::spec_get_value(supply.current_supply) + 1
+        <= aggregator_v2::spec_get_max_value(supply.current_supply) ==>
+    aggregator_v2::spec_get_value(supply.current_supply) + 1
+        == aggregator_v2::spec_get_value(supply_post.current_supply);
+
+ [move-book]: https://aptos.dev/move/book/SUMMARY diff --git a/aptos-move/framework/aptos-token-objects/tests/compiler-v2-doc/token.md b/aptos-move/framework/aptos-token-objects/tests/compiler-v2-doc/token.md index 637afe80f44ba..314f9e5e1339c 100644 --- a/aptos-move/framework/aptos-token-objects/tests/compiler-v2-doc/token.md +++ b/aptos-move/framework/aptos-token-objects/tests/compiler-v2-doc/token.md @@ -1824,15 +1824,16 @@ as that would prohibit transactions to be executed in parallel. old_value: token.description, new_value: description }) + } else { + event::emit_event( + &mut token.mutation_events, + MutationEvent { + mutated_field_name: string::utf8(b"description"), + old_value: token.description, + new_value: description + }, + ); }; - event::emit_event( - &mut token.mutation_events, - MutationEvent { - mutated_field_name: string::utf8(b"description"), - old_value: token.description, - new_value: description - }, - ); token.description = description; }
@@ -1879,15 +1880,16 @@ as that would prohibit transactions to be executed in parallel. old_value: old_name, new_value: name }) + } else { + event::emit_event( + &mut token.mutation_events, + MutationEvent { + mutated_field_name: string::utf8(b"name"), + old_value: old_name, + new_value: name + }, + ); }; - event::emit_event( - &mut token.mutation_events, - MutationEvent { - mutated_field_name: string::utf8(b"name"), - old_value: old_name, - new_value: name - }, - ); }
@@ -1920,15 +1922,16 @@ as that would prohibit transactions to be executed in parallel. old_value: token.uri, new_value: uri, }) + } else { + event::emit_event( + &mut token.mutation_events, + MutationEvent { + mutated_field_name: string::utf8(b"uri"), + old_value: token.uri, + new_value: uri, + }, + ); }; - event::emit_event( - &mut token.mutation_events, - MutationEvent { - mutated_field_name: string::utf8(b"uri"), - old_value: token.uri, - new_value: uri, - }, - ); token.uri = uri; }
diff --git a/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token.md b/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token.md index 818be7527c2f8..9f38810d30f2b 100644 --- a/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token.md +++ b/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token.md @@ -19,17 +19,23 @@ Checkout our developer doc on our token standard https://aptos.dev/standards - [Struct `CollectionData`](#0x3_token_CollectionData) - [Struct `WithdrawCapability`](#0x3_token_WithdrawCapability) - [Struct `DepositEvent`](#0x3_token_DepositEvent) +- [Struct `TokenDeposit`](#0x3_token_TokenDeposit) - [Struct `Deposit`](#0x3_token_Deposit) - [Struct `WithdrawEvent`](#0x3_token_WithdrawEvent) - [Struct `Withdraw`](#0x3_token_Withdraw) +- [Struct `TokenWithdraw`](#0x3_token_TokenWithdraw) - [Struct `CreateTokenDataEvent`](#0x3_token_CreateTokenDataEvent) - [Struct `CreateTokenData`](#0x3_token_CreateTokenData) +- [Struct `TokenDataCreation`](#0x3_token_TokenDataCreation) - [Struct `MintTokenEvent`](#0x3_token_MintTokenEvent) - [Struct `MintToken`](#0x3_token_MintToken) +- [Struct `Mint`](#0x3_token_Mint) - [Struct `BurnTokenEvent`](#0x3_token_BurnTokenEvent) - [Struct `BurnToken`](#0x3_token_BurnToken) +- [Struct `Burn`](#0x3_token_Burn) - [Struct `MutateTokenPropertyMapEvent`](#0x3_token_MutateTokenPropertyMapEvent) - [Struct `MutateTokenPropertyMap`](#0x3_token_MutateTokenPropertyMap) +- [Struct `MutatePropertyMap`](#0x3_token_MutatePropertyMap) - [Struct `CreateCollectionEvent`](#0x3_token_CreateCollectionEvent) - [Struct `CreateCollection`](#0x3_token_CreateCollection) - [Constants](#@Constants_0) @@ -768,6 +774,47 @@ Set of data sent to the event stream during a receive + + + + +## Struct `TokenDeposit` + +Set of data sent to the event stream during a receive + + +
#[event]
+struct TokenDeposit has drop, store
+
+ + + +
+Fields + + +
+
+account: address +
+
+ +
+
+id: token::TokenId +
+
+ +
+
+amount: u64 +
+
+ +
+
+ +
@@ -778,6 +825,7 @@ Set of data sent to the event stream during a receive
#[event]
+#[deprecated]
 struct Deposit has drop, store
 
@@ -847,6 +895,7 @@ Set of data sent to the event stream during a withdrawal
#[event]
+#[deprecated]
 struct Withdraw has drop, store
 
@@ -872,6 +921,47 @@ Set of data sent to the event stream during a withdrawal + + + + +## Struct `TokenWithdraw` + +Set of data sent to the event stream during a withdrawal + + +
#[event]
+struct TokenWithdraw has drop, store
+
+ + + +
+Fields + + +
+
+account: address +
+
+ +
+
+id: token::TokenId +
+
+ +
+
+amount: u64 +
+
+ +
+
+ +
@@ -975,6 +1065,7 @@ token creation event id of token created
#[event]
+#[deprecated]
 struct CreateTokenData has drop, store
 
@@ -1060,6 +1151,106 @@ token creation event id of token created + + + + +## Struct `TokenDataCreation` + + + +
#[event]
+struct TokenDataCreation has drop, store
+
+ + + +
+Fields + + +
+
+creator: address +
+
+ +
+
+id: token::TokenDataId +
+
+ +
+
+description: string::String +
+
+ +
+
+maximum: u64 +
+
+ +
+
+uri: string::String +
+
+ +
+
+royalty_payee_address: address +
+
+ +
+
+royalty_points_denominator: u64 +
+
+ +
+
+royalty_points_numerator: u64 +
+
+ +
+
+name: string::String +
+
+ +
+
+mutability_config: token::TokenMutabilityConfig +
+
+ +
+
+property_keys: vector<string::String> +
+
+ +
+
+property_values: vector<vector<u8>> +
+
+ +
+
+property_types: vector<string::String> +
+
+ +
+
+ +
@@ -1103,6 +1294,7 @@ mint token event. This event triggered when creator adds more supply to existing
#[event]
+#[deprecated]
 struct MintToken has drop, store
 
@@ -1128,6 +1320,46 @@ mint token event. This event triggered when creator adds more supply to existing + + + + +## Struct `Mint` + + + +
#[event]
+struct Mint has drop, store
+
+ + + +
+Fields + + +
+
+creator: address +
+
+ +
+
+id: token::TokenDataId +
+
+ +
+
+amount: u64 +
+
+ +
+
+ +
@@ -1170,6 +1402,7 @@ mint token event. This event triggered when creator adds more supply to existing
#[event]
+#[deprecated]
 struct BurnToken has drop, store
 
@@ -1195,6 +1428,46 @@ mint token event. This event triggered when creator adds more supply to existing + + + + +## Struct `Burn` + + + +
#[event]
+struct Burn has drop, store
+
+ + + +
+Fields + + +
+
+account: address +
+
+ +
+
+id: token::TokenId +
+
+ +
+
+amount: u64 +
+
+ +
+
+ +
@@ -1255,6 +1528,7 @@ mint token event. This event triggered when creator adds more supply to existing
#[event]
+#[deprecated]
 struct MutateTokenPropertyMap has drop, store
 
@@ -1298,6 +1572,64 @@ mint token event. This event triggered when creator adds more supply to existing + + + + +## Struct `MutatePropertyMap` + + + +
#[event]
+struct MutatePropertyMap has drop, store
+
+ + + +
+Fields + + +
+
+account: address +
+
+ +
+
+old_id: token::TokenId +
+
+ +
+
+new_id: token::TokenId +
+
+ +
+
+keys: vector<string::String> +
+
+ +
+
+values: vector<vector<u8>> +
+
+ +
+
+types: vector<string::String> +
+
+ +
+
+ +
@@ -2247,16 +2579,17 @@ The token is owned at address owner let burn_by_creator_flag = property_map::read_bool(&token_data.default_properties, &string::utf8(BURNABLE_BY_CREATOR)); assert!(burn_by_creator_flag, error::permission_denied(ECREATOR_CANNOT_BURN_TOKEN)); - // Burn the tokens. + // Burn the tokens. let Token { id: _, amount: burned_amount, token_properties: _ } = withdraw_with_event_internal(owner, token_id, amount); let token_store = borrow_global_mut<TokenStore>(owner); if (std::features::module_event_migration_enabled()) { - event::emit(BurnToken { id: token_id, amount: burned_amount }); + event::emit(Burn { account: owner, id: token_id, amount: burned_amount }); + } else { + event::emit_event<BurnTokenEvent>( + &mut token_store.burn_events, + BurnTokenEvent { id: token_id, amount: burned_amount } + ); }; - event::emit_event<BurnTokenEvent>( - &mut token_store.burn_events, - BurnTokenEvent { id: token_id, amount: burned_amount } - ); if (token_data.maximum > 0) { token_data.supply = token_data.supply - burned_amount; @@ -2336,16 +2669,17 @@ Burn a token by the token owner let burn_by_owner_flag = property_map::read_bool(&token_data.default_properties, &string::utf8(BURNABLE_BY_OWNER)); assert!(burn_by_owner_flag, error::permission_denied(EOWNER_CANNOT_BURN_TOKEN)); - // Burn the tokens. + // Burn the tokens. let Token { id: _, amount: burned_amount, token_properties: _ } = withdraw_token(owner, token_id, amount); let token_store = borrow_global_mut<TokenStore>(signer::address_of(owner)); if (std::features::module_event_migration_enabled()) { - event::emit(BurnToken { id: token_id, amount: burned_amount }); + event::emit(Burn { account: signer::address_of(owner), id: token_id, amount: burned_amount }); + } else { + event::emit_event<BurnTokenEvent>( + &mut token_store.burn_events, + BurnTokenEvent { id: token_id, amount: burned_amount } + ); }; - event::emit_event<BurnTokenEvent>( - &mut token_store.burn_events, - BurnTokenEvent { id: token_id, amount: burned_amount } - ); // Decrease the supply correspondingly by the amount of tokens burned. let token_data = table::borrow_mut( @@ -2737,24 +3071,26 @@ Mutate the token_properties of one token. direct_deposit(token_owner, new_token); update_token_property_internal(token_owner, new_token_id, keys, values, types); if (std::features::module_event_migration_enabled()) { - event::emit(MutateTokenPropertyMap { + event::emit(MutatePropertyMap { + account: token_owner, old_id: token_id, new_id: new_token_id, keys, values, types }); + } else { + event::emit_event<MutateTokenPropertyMapEvent>( + &mut borrow_global_mut<TokenStore>(token_owner).mutate_token_property_events, + MutateTokenPropertyMapEvent { + old_id: token_id, + new_id: new_token_id, + keys, + values, + types + }, + ); }; - event::emit_event<MutateTokenPropertyMapEvent>( - &mut borrow_global_mut<TokenStore>(token_owner).mutate_token_property_events, - MutateTokenPropertyMapEvent { - old_id: token_id, - new_id: new_token_id, - keys, - values, - types - }, - ); token_data.largest_property_version = cur_property_version; // burn the orignial property_version 0 token after mutation @@ -2764,24 +3100,26 @@ Mutate the token_properties of one token. // only 1 copy for the token with property verion bigger than 0 update_token_property_internal(token_owner, token_id, keys, values, types); if (std::features::module_event_migration_enabled()) { - event::emit(MutateTokenPropertyMap { + event::emit(MutatePropertyMap { + account: token_owner, old_id: token_id, new_id: token_id, keys, values, types }); + } else { + event::emit_event<MutateTokenPropertyMapEvent>( + &mut borrow_global_mut<TokenStore>(token_owner).mutate_token_property_events, + MutateTokenPropertyMapEvent { + old_id: token_id, + new_id: token_id, + keys, + values, + types + }, + ); }; - event::emit_event<MutateTokenPropertyMapEvent>( - &mut borrow_global_mut<TokenStore>(token_owner).mutate_token_property_events, - MutateTokenPropertyMapEvent { - old_id: token_id, - new_id: token_id, - keys, - values, - types - }, - ); token_id } } @@ -3277,17 +3615,18 @@ Create a new collection to hold tokens maximum, } ); + } else { + event::emit_event<CreateCollectionEvent>( + &mut collection_handle.create_collection_events, + CreateCollectionEvent { + creator: account_addr, + collection_name: name, + uri, + description, + maximum, + } + ); }; - event::emit_event<CreateCollectionEvent>( - &mut collection_handle.create_collection_events, - CreateCollectionEvent { - creator: account_addr, - collection_name: name, - uri, - description, - maximum, - } - ); }
@@ -3436,7 +3775,8 @@ Create a new collection to hold tokens table::add(&mut collections.token_data, token_data_id, token_data); if (std::features::module_event_migration_enabled()) { event::emit( - CreateTokenData { + TokenDataCreation { + creator: account_addr, id: token_data_id, description, maximum, @@ -3451,25 +3791,26 @@ Create a new collection to hold tokens property_types, } ); + } else { + event::emit_event<CreateTokenDataEvent>( + &mut collections.create_token_data_events, + CreateTokenDataEvent { + id: token_data_id, + description, + maximum, + uri, + royalty_payee_address, + royalty_points_denominator, + royalty_points_numerator, + name, + mutability_config: token_mutate_config, + property_keys, + property_values, + property_types, + }, + ); }; - event::emit_event<CreateTokenDataEvent>( - &mut collections.create_token_data_events, - CreateTokenDataEvent { - id: token_data_id, - description, - maximum, - uri, - royalty_payee_address, - royalty_points_denominator, - royalty_points_numerator, - name, - mutability_config: token_mutate_config, - property_keys, - property_values, - property_types, - }, - ); token_data_id }
@@ -3795,15 +4136,16 @@ return the TokenId for a given Token // we add more tokens with property_version 0 let token_id = create_token_id(token_data_id, 0); if (std::features::module_event_migration_enabled()) { - event::emit(MintToken { id: token_data_id, amount }) + event::emit(Mint { creator: creator_addr, id: token_data_id, amount }) + } else { + event::emit_event<MintTokenEvent>( + &mut borrow_global_mut<Collections>(creator_addr).mint_token_events, + MintTokenEvent { + id: token_data_id, + amount, + } + ); }; - event::emit_event<MintTokenEvent>( - &mut borrow_global_mut<Collections>(creator_addr).mint_token_events, - MintTokenEvent { - id: token_data_id, - amount, - } - ); deposit_token(account, Token { @@ -3862,15 +4204,16 @@ create tokens and directly deposite to receiver's address. The receiver should o let token_id = create_token_id(token_data_id, 0); if (std::features::module_event_migration_enabled()) { - event::emit(MintToken { id: token_data_id, amount }) + event::emit(Mint { creator: creator_addr, id: token_data_id, amount }) + } else { + event::emit_event<MintTokenEvent>( + &mut borrow_global_mut<Collections>(creator_addr).mint_token_events, + MintTokenEvent { + id: token_data_id, + amount, + } + ); }; - event::emit_event<MintTokenEvent>( - &mut borrow_global_mut<Collections>(creator_addr).mint_token_events, - MintTokenEvent { - id: token_data_id, - amount, - } - ); direct_deposit(receiver, Token { @@ -4750,12 +5093,14 @@ return if the collection maximum is mutable with collection mutability config let token_store = borrow_global_mut<TokenStore>(account_addr); if (std::features::module_event_migration_enabled()) { - event::emit(Withdraw { id, amount }) + event::emit(TokenWithdraw { account: account_addr, id, amount }) + } else { + event::emit_event<WithdrawEvent>( + &mut token_store.withdraw_events, + WithdrawEvent { id, amount } + ); }; - event::emit_event<WithdrawEvent>( - &mut token_store.withdraw_events, - WithdrawEvent { id, amount } - ); + let tokens = &mut borrow_global_mut<TokenStore>(account_addr).tokens; assert!( table::contains(tokens, id), @@ -4832,12 +5177,13 @@ Deposit the token balance into the recipients account and emit an event. let token_store = borrow_global_mut<TokenStore>(account_addr); if (std::features::module_event_migration_enabled()) { - event::emit(Deposit { id: token.id, amount: token.amount }); + event::emit(TokenDeposit { account: account_addr, id: token.id, amount: token.amount }); + } else { + event::emit_event<DepositEvent>( + &mut token_store.deposit_events, + DepositEvent { id: token.id, amount: token.amount }, + ); }; - event::emit_event<DepositEvent>( - &mut token_store.deposit_events, - DepositEvent { id: token.id, amount: token.amount }, - ); assert!( exists<TokenStore>(account_addr), diff --git a/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_event_store.md b/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_event_store.md index 031fefa26208c..807296df0f173 100644 --- a/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_event_store.md +++ b/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_event_store.md @@ -1139,11 +1139,12 @@ Emit the collection uri mutation event new_uri, } ); + } else { + event::emit_event<CollectionUriMutateEvent>( + &mut token_event_store.collection_uri_mutate_events, + event, + ); }; - event::emit_event<CollectionUriMutateEvent>( - &mut token_event_store.collection_uri_mutate_events, - event, - ); }
@@ -1185,11 +1186,12 @@ Emit the collection description mutation event new_description, } ); - }; - event::emit_event<CollectionDescriptionMutateEvent>( - &mut token_event_store.collection_description_mutate_events, - event, - ); + } else { + event::emit_event<CollectionDescriptionMutateEvent>( + &mut token_event_store.collection_description_mutate_events, + event, + ); + } }
@@ -1231,11 +1233,12 @@ Emit the collection maximum mutation event new_maximum, } ); + } else { + event::emit_event<CollectionMaxiumMutateEvent>( + &mut token_event_store.collection_maximum_mutate_events, + event, + ); }; - event::emit_event<CollectionMaxiumMutateEvent>( - &mut token_event_store.collection_maximum_mutate_events, - event, - ); }
@@ -1271,11 +1274,12 @@ Emit the direct opt-in event account_address: signer::address_of(account), opt_in, }); - }; - event::emit_event<OptInTransferEvent>( - &mut token_event_store.opt_in_events, - opt_in_event, - ); + } else { + event::emit_event<OptInTransferEvent>( + &mut token_event_store.opt_in_events, + opt_in_event, + ); + } }
@@ -1327,11 +1331,12 @@ Emit URI mutation event old_uri, new_uri, }); + } else { + event::emit_event<UriMutationEvent>( + &mut token_event_store.uri_mutate_events, + event, + ); }; - event::emit_event<UriMutationEvent>( - &mut token_event_store.uri_mutate_events, - event, - ); }
@@ -1386,11 +1391,12 @@ Emit tokendata property map mutation event old_values, new_values, }); + } else { + event::emit_event<DefaultPropertyMutateEvent>( + &mut token_event_store.default_property_mutate_events, + event, + ); }; - event::emit_event<DefaultPropertyMutateEvent>( - &mut token_event_store.default_property_mutate_events, - event, - ); }
@@ -1442,11 +1448,12 @@ Emit description mutation event old_description, new_description, }); + } else { + event::emit_event<DescriptionMutateEvent>( + &mut token_event_store.description_mutate_events, + event, + ); }; - event::emit_event<DescriptionMutateEvent>( - &mut token_event_store.description_mutate_events, - event, - ); }
@@ -1509,11 +1516,12 @@ Emit royalty mutation event new_royalty_denominator, new_royalty_payee_addr, }); + } else { + event::emit_event<RoyaltyMutateEvent>( + &mut token_event_store.royalty_mutate_events, + event, + ); }; - event::emit_event<RoyaltyMutateEvent>( - &mut token_event_store.royalty_mutate_events, - event, - ); } @@ -1565,11 +1573,12 @@ Emit maximum mutation event old_maximum, new_maximum, }); + } else { + event::emit_event<MaxiumMutateEvent>( + &mut token_event_store.maximum_mutate_events, + event, + ); }; - event::emit_event<MaxiumMutateEvent>( - &mut token_event_store.maximum_mutate_events, - event, - ); } diff --git a/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_transfers.md b/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_transfers.md index db16be95cd33f..8339a3fc40744 100644 --- a/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_transfers.md +++ b/aptos-move/framework/aptos-token/tests/compiler-v2-doc/token_transfers.md @@ -9,10 +9,13 @@ This module provides the foundation for transferring of Tokens - [Resource `PendingClaims`](#0x3_token_transfers_PendingClaims) - [Struct `TokenOfferId`](#0x3_token_transfers_TokenOfferId) - [Struct `TokenOffer`](#0x3_token_transfers_TokenOffer) -- [Struct `TokenOfferEvent`](#0x3_token_transfers_TokenOfferEvent) +- [Struct `Offer`](#0x3_token_transfers_Offer) - [Struct `TokenCancelOfferEvent`](#0x3_token_transfers_TokenCancelOfferEvent) -- [Struct `TokenCancelOffer`](#0x3_token_transfers_TokenCancelOffer) +- [Struct `CancelOffer`](#0x3_token_transfers_CancelOffer) - [Struct `TokenClaimEvent`](#0x3_token_transfers_TokenClaimEvent) +- [Struct `Claim`](#0x3_token_transfers_Claim) +- [Struct `TokenOfferEvent`](#0x3_token_transfers_TokenOfferEvent) +- [Struct `TokenCancelOffer`](#0x3_token_transfers_TokenCancelOffer) - [Struct `TokenClaim`](#0x3_token_transfers_TokenClaim) - [Constants](#@Constants_0) - [Function `initialize_token_transfers`](#0x3_token_transfers_initialize_token_transfers) @@ -165,14 +168,14 @@ This module provides the foundation for transferring of Tokens - + -## Struct `TokenOfferEvent` +## Struct `Offer`
#[event]
-struct TokenOfferEvent has drop, store
+struct Offer has drop, store
 
@@ -183,6 +186,12 @@ This module provides the foundation for transferring of Tokens
+account: address +
+
+ +
+
to_address: address
@@ -245,14 +254,14 @@ This module provides the foundation for transferring of Tokens - + -## Struct `TokenCancelOffer` +## Struct `CancelOffer`
#[event]
-struct TokenCancelOffer has drop, store
+struct CancelOffer has drop, store
 
@@ -263,6 +272,12 @@ This module provides the foundation for transferring of Tokens
+account: address +
+
+ +
+
to_address: address
@@ -297,6 +312,134 @@ This module provides the foundation for transferring of Tokens +
+Fields + + +
+
+to_address: address +
+
+ +
+
+token_id: token::TokenId +
+
+ +
+
+amount: u64 +
+
+ +
+
+ + +
+ + + +## Struct `Claim` + + + +
#[event]
+struct Claim has drop, store
+
+ + + +
+Fields + + +
+
+account: address +
+
+ +
+
+to_address: address +
+
+ +
+
+token_id: token::TokenId +
+
+ +
+
+amount: u64 +
+
+ +
+
+ + +
+ + + +## Struct `TokenOfferEvent` + + + +
#[event]
+#[deprecated]
+struct TokenOfferEvent has drop, store
+
+ + + +
+Fields + + +
+
+to_address: address +
+
+ +
+
+token_id: token::TokenId +
+
+ +
+
+amount: u64 +
+
+ +
+
+ + +
+ + + +## Struct `TokenCancelOffer` + + + +
#[event]
+#[deprecated]
+struct TokenCancelOffer has drop, store
+
+ + +
Fields @@ -332,6 +475,7 @@ This module provides the foundation for transferring of Tokens
#[event]
+#[deprecated]
 struct TokenClaim has drop, store
 
@@ -511,21 +655,23 @@ Token offer doesn't exist if (std::features::module_event_migration_enabled()) { event::emit( - TokenOffer { + Offer { + account: sender_addr, to_address: receiver, token_id, amount, } ) - }; - event::emit_event<TokenOfferEvent>( - &mut borrow_global_mut<PendingClaims>(sender_addr).offer_events, - TokenOfferEvent { - to_address: receiver, - token_id, - amount, - }, - ); + } else { + event::emit_event<TokenOfferEvent>( + &mut borrow_global_mut<PendingClaims>(sender_addr).offer_events, + TokenOfferEvent { + to_address: receiver, + token_id, + amount, + }, + ); + } } @@ -596,21 +742,23 @@ Token offer doesn't exist if (std::features::module_event_migration_enabled()) { event::emit( - TokenClaim { + Claim { + account: sender, to_address: signer::address_of(receiver), token_id, amount, } ) + } else { + event::emit_event<TokenClaimEvent>( + &mut borrow_global_mut<PendingClaims>(sender).claim_events, + TokenClaimEvent { + to_address: signer::address_of(receiver), + token_id, + amount, + }, + ); }; - event::emit_event<TokenClaimEvent>( - &mut borrow_global_mut<PendingClaims>(sender).claim_events, - TokenClaimEvent { - to_address: signer::address_of(receiver), - token_id, - amount, - }, - ); } @@ -681,21 +829,23 @@ Token offer doesn't exist if (std::features::module_event_migration_enabled()) { event::emit( - TokenCancelOffer { + CancelOffer { + account: sender_addr, to_address: receiver, token_id, amount, }, ) - }; - event::emit_event<TokenCancelOfferEvent>( - &mut borrow_global_mut<PendingClaims>(sender_addr).cancel_offer_events, - TokenCancelOfferEvent { - to_address: receiver, - token_id, - amount, - }, - ); + } else { + event::emit_event<TokenCancelOfferEvent>( + &mut borrow_global_mut<PendingClaims>(sender_addr).cancel_offer_events, + TokenCancelOfferEvent { + to_address: receiver, + token_id, + amount, + }, + ); + } } @@ -714,6 +864,30 @@ Token offer doesn't exist +Get the amount from sender token + + + + + +
fun spce_get(
+   account_addr: address,
+   id: TokenId,
+   amount: u64
+): u64 {
+   use aptos_token::token::{TokenStore};
+   use aptos_std::table::{Self};
+   let tokens = global<TokenStore>(account_addr).tokens;
+   let balance = table::spec_get(tokens, id).amount;
+   if (balance > amount) {
+       amount
+   } else {
+       table::spec_get(tokens, id).amount
+   }
+}
+
+ + @@ -810,30 +984,6 @@ Abort according to the code -Get the amount from sender token - - - - - -
fun spce_get(
-   account_addr: address,
-   id: TokenId,
-   amount: u64
-): u64 {
-   use aptos_token::token::{TokenStore};
-   use aptos_std::table::{Self};
-   let tokens = global<TokenStore>(account_addr).tokens;
-   let balance = table::spec_get(tokens, id).amount;
-   if (balance > amount) {
-       amount
-   } else {
-       table::spec_get(tokens, id).amount
-   }
-}
-
- - diff --git a/aptos-move/framework/move-stdlib/tests/compiler-v2-doc/features.md b/aptos-move/framework/move-stdlib/tests/compiler-v2-doc/features.md index ea0b4f9f17740..6bfd2a4d4554a 100644 --- a/aptos-move/framework/move-stdlib/tests/compiler-v2-doc/features.md +++ b/aptos-move/framework/move-stdlib/tests/compiler-v2-doc/features.md @@ -366,7 +366,7 @@ Lifetime: transient -Whether gas fees are collected and distributed to the block proposers. +Deprecated feature Lifetime: transient @@ -1115,9 +1115,11 @@ Lifetime: transient ## Function `get_collect_and_distribute_gas_fees_feature` +Deprecated feature -
public fun get_collect_and_distribute_gas_fees_feature(): u64
+
#[deprecated]
+public fun get_collect_and_distribute_gas_fees_feature(): u64
 
@@ -1139,7 +1141,8 @@ Lifetime: transient -
public fun collect_and_distribute_gas_fees(): bool
+
#[deprecated]
+public fun collect_and_distribute_gas_fees(): bool
 
@@ -1148,8 +1151,8 @@ Lifetime: transient Implementation -
public fun collect_and_distribute_gas_fees(): bool acquires Features {
-    is_enabled(COLLECT_AND_DISTRIBUTE_GAS_FEES)
+
public fun collect_and_distribute_gas_fees(): bool {
+    false
 }
 
@@ -3853,17 +3856,6 @@ Helper to check whether a feature flag is enabled. - - - -
fun spec_collect_and_distribute_gas_fees_enabled(): bool {
-   spec_is_enabled(COLLECT_AND_DISTRIBUTE_GAS_FEES)
-}
-
- - - - diff --git a/third_party/move/evm/move-to-yul/tests/ConstructorTest.v2_exp b/third_party/move/evm/move-to-yul/tests/ConstructorTest.v2_exp index b51e33ba8fde2..4666b284b3fcd 100644 --- a/third_party/move/evm/move-to-yul/tests/ConstructorTest.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/ConstructorTest.v2_exp @@ -23,14 +23,14 @@ object "A2_ConstructorTest" { mstore($locals, A2_Evm_sign($t3)) // $t4 := borrow_local($t2) $t4 := $MakePtr(false, $locals) - // $t5 := pack ConstructorTest::Balance($t0, $t1) + // $t5 := pack 0x2::ConstructorTest::Balance($t0, $t1) { let $mem := $Malloc(16) $MemoryStoreU64(add($mem, 0), value) $MemoryStoreU64(add($mem, 8), value2) $t5 := $mem } - // move_to($t5, $t4) + // move_to<0x2::ConstructorTest::Balance>($t5, $t4) { let $base_offset := $MakeTypeStorageBase(0, 0x91d9463a, $LoadU256($t4)) if $AlignedStorageLoad($base_offset) { @@ -212,7 +212,7 @@ object "A2_ConstructorTest" { let $t0, $t1, $t2, $t3 // $t0 := 0x42 $t0 := 0x42 - // $t1 := borrow_global($t0) + // $t1 := borrow_global<0x2::ConstructorTest::Balance>($t0) { let $base_offset := $MakeTypeStorageBase(0, 0x91d9463a, $t0) if iszero($AlignedStorageLoad($base_offset)) { @@ -220,7 +220,7 @@ object "A2_ConstructorTest" { } $t1 := $MakePtr(true, add($base_offset, 32)) } - // $t2 := borrow_field.value($t1) + // $t2 := borrow_field<0x2::ConstructorTest::Balance>.value($t1) $t2 := $t1 // $t3 := read_ref($t2) $t3 := $LoadU64($t2) diff --git a/third_party/move/evm/move-to-yul/tests/GlobalVectors.v2_exp b/third_party/move/evm/move-to-yul/tests/GlobalVectors.v2_exp index fcee1e13c2424..12db22c42d0a0 100644 --- a/third_party/move/evm/move-to-yul/tests/GlobalVectors.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/GlobalVectors.v2_exp @@ -93,13 +93,13 @@ object "test_A2_GlobalVectors_test_borrow_mut_global" { $t10 := $MakePtr(false, add($locals, 32)) // $t11 := move($t2) $t11 := mload($locals) - // $t12 := pack GlobalVectors::T($t11) + // $t12 := pack 0x2::GlobalVectors::T($t11) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t11) $t12 := $mem } - // move_to>($t12, $t10) + // move_to<0x2::GlobalVectors::T>($t12, $t10) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $LoadU256($t10)) if $AlignedStorageLoad($base_offset) { @@ -128,7 +128,7 @@ object "test_A2_GlobalVectors_test_borrow_mut_global" { } // $t13 := 0x42 $t13 := 0x42 - // $t14 := borrow_global>($t13) + // $t14 := borrow_global<0x2::GlobalVectors::T>($t13) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t13) if iszero($AlignedStorageLoad($base_offset)) { @@ -136,7 +136,7 @@ object "test_A2_GlobalVectors_test_borrow_mut_global" { } $t14 := $MakePtr(true, add($base_offset, 32)) } - // $t15 := borrow_field>.v($t14) + // $t15 := borrow_field<0x2::GlobalVectors::T>.v($t14) $t15 := $t14 // $t16 := 0 $t16 := 0 @@ -148,7 +148,7 @@ object "test_A2_GlobalVectors_test_borrow_mut_global" { $StoreU64($t17, $t18) // $t19 := 0x42 $t19 := 0x42 - // $t20 := borrow_global>($t19) + // $t20 := borrow_global<0x2::GlobalVectors::T>($t19) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t19) if iszero($AlignedStorageLoad($base_offset)) { @@ -156,7 +156,7 @@ object "test_A2_GlobalVectors_test_borrow_mut_global" { } $t20 := $MakePtr(true, add($base_offset, 32)) } - // $t21 := borrow_field>.v($t20) + // $t21 := borrow_field<0x2::GlobalVectors::T>.v($t20) $t21 := $t20 // $t22 := 0 $t22 := 0 @@ -502,13 +502,13 @@ object "test_A2_GlobalVectors_test_move_from" { $t10 := $MakePtr(false, add($locals, 32)) // $t11 := move($t1) $t11 := mload($locals) - // $t12 := pack GlobalVectors::T($t11) + // $t12 := pack 0x2::GlobalVectors::T($t11) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t11) $t12 := $mem } - // move_to>($t12, $t10) + // move_to<0x2::GlobalVectors::T>($t12, $t10) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $LoadU256($t10)) if $AlignedStorageLoad($base_offset) { @@ -537,7 +537,7 @@ object "test_A2_GlobalVectors_test_move_from" { } // $t13 := 0x42 $t13 := 0x42 - // $t14 := move_from>($t13) + // $t14 := move_from<0x2::GlobalVectors::T>($t13) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t13) if iszero($AlignedStorageLoad($base_offset)) { @@ -569,7 +569,7 @@ object "test_A2_GlobalVectors_test_move_from" { $t14 := $dst } } - // $t2 := unpack GlobalVectors::T($t14) + // $t2 := unpack 0x2::GlobalVectors::T($t14) mstore(add($locals, 64), $MemoryLoadU256(add($t14, 0))) $Free($t14, 32) // $t15 := borrow_local($t2) @@ -1060,7 +1060,7 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { $Abort($t25) } case 4 { - // $t2 := vector::empty() + // $t2 := vector::empty<0x2::GlobalVectors::S>() mstore($locals, A1_vector_empty$A2_GlobalVectors_S$()) // $t3 := borrow_local($t2) $t3 := $MakePtr(false, $locals) @@ -1068,14 +1068,14 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { $t4 := 10 // $t5 := 40 $t5 := 40 - // $t6 := pack GlobalVectors::S($t4, $t5) + // $t6 := pack 0x2::GlobalVectors::S($t4, $t5) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t4) $MemoryStoreU64(add($mem, 16), $t5) $t6 := $mem } - // vector::push_back($t3, $t6) + // vector::push_back<0x2::GlobalVectors::S>($t3, $t6) A1_vector_push_back$A2_GlobalVectors_S$($t3, $t6) // $t7 := borrow_local($t2) $t7 := $MakePtr(false, $locals) @@ -1083,14 +1083,14 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { $t8 := 11 // $t9 := 41 $t9 := 41 - // $t10 := pack GlobalVectors::S($t8, $t9) + // $t10 := pack 0x2::GlobalVectors::S($t8, $t9) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t8) $MemoryStoreU64(add($mem, 16), $t9) $t10 := $mem } - // vector::push_back($t7, $t10) + // vector::push_back<0x2::GlobalVectors::S>($t7, $t10) A1_vector_push_back$A2_GlobalVectors_S$($t7, $t10) // $t11 := borrow_local($t2) $t11 := $MakePtr(false, $locals) @@ -1098,14 +1098,14 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { $t12 := 12 // $t13 := 42 $t13 := 42 - // $t14 := pack GlobalVectors::S($t12, $t13) + // $t14 := pack 0x2::GlobalVectors::S($t12, $t13) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t12) $MemoryStoreU64(add($mem, 16), $t13) $t14 := $mem } - // vector::push_back($t11, $t14) + // vector::push_back<0x2::GlobalVectors::S>($t11, $t14) A1_vector_push_back$A2_GlobalVectors_S$($t11, $t14) // $t15 := 0x42 $t15 := 0x42 @@ -1115,13 +1115,13 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { $t16 := $MakePtr(false, add($locals, 32)) // $t17 := move($t2) $t17 := mload($locals) - // $t18 := pack GlobalVectors::T($t17) + // $t18 := pack 0x2::GlobalVectors::T<0x2::GlobalVectors::S>($t17) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t17) $t18 := $mem } - // move_to>($t18, $t16) + // move_to<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t18, $t16) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $LoadU256($t16)) if $AlignedStorageLoad($base_offset) { @@ -1156,7 +1156,7 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { } // $t19 := 0x42 $t19 := 0x42 - // $t1 := move_from>($t19) + // $t1 := move_from<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t19) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t19) if iszero($AlignedStorageLoad($base_offset)) { @@ -1197,9 +1197,9 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { } // $t20 := borrow_local($t1) $t20 := $MakePtr(false, local_t) - // $t21 := borrow_field>.v($t20) + // $t21 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t20) $t21 := $t20 - // $t22 := vector::length($t21) + // $t22 := vector::length<0x2::GlobalVectors::S>($t21) $t22 := A1_vector_length$A2_GlobalVectors_S$($t21) // $t23 := 3 $t23 := 3 @@ -1214,13 +1214,13 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { // label L2 // $t26 := borrow_local($t1) $t26 := $MakePtr(false, local_t) - // $t27 := borrow_field>.v($t26) + // $t27 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t26) $t27 := $t26 // $t28 := 0 $t28 := 0 - // $t29 := vector::borrow($t27, $t28) + // $t29 := vector::borrow<0x2::GlobalVectors::S>($t27, $t28) $t29 := A1_vector_borrow$A2_GlobalVectors_S$($t27, $t28) - // $t30 := borrow_field.x($t29) + // $t30 := borrow_field<0x2::GlobalVectors::S>.x($t29) $t30 := $t29 // $t31 := read_ref($t30) $t31 := $LoadU128($t30) @@ -1249,13 +1249,13 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { // label L5 // $t35 := borrow_local($t1) $t35 := $MakePtr(false, local_t) - // $t36 := borrow_field>.v($t35) + // $t36 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t35) $t36 := $t35 // $t37 := 1 $t37 := 1 - // $t38 := vector::borrow($t36, $t37) + // $t38 := vector::borrow<0x2::GlobalVectors::S>($t36, $t37) $t38 := A1_vector_borrow$A2_GlobalVectors_S$($t36, $t37) - // $t39 := borrow_field.x($t38) + // $t39 := borrow_field<0x2::GlobalVectors::S>.x($t38) $t39 := $t38 // $t40 := read_ref($t39) $t40 := $LoadU128($t39) @@ -1284,13 +1284,13 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_struct" { // label L8 // $t44 := borrow_local($t1) $t44 := $MakePtr(false, local_t) - // $t45 := borrow_field>.v($t44) + // $t45 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t44) $t45 := $t44 // $t46 := 2 $t46 := 2 - // $t47 := vector::borrow($t45, $t46) + // $t47 := vector::borrow<0x2::GlobalVectors::S>($t45, $t46) $t47 := A1_vector_borrow$A2_GlobalVectors_S$($t45, $t46) - // $t48 := borrow_field.x($t47) + // $t48 := borrow_field<0x2::GlobalVectors::S>.x($t47) $t48 := $t47 // $t49 := read_ref($t48) $t49 := $LoadU128($t48) @@ -1685,13 +1685,13 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_vector" { $t13 := $MakePtr(false, add($locals, 32)) // $t14 := move($t2) $t14 := mload($locals) - // $t15 := pack GlobalVectors::T>($t14) + // $t15 := pack 0x2::GlobalVectors::T>($t14) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t14) $t15 := $mem } - // move_to>>($t15, $t13) + // move_to<0x2::GlobalVectors::T>>($t15, $t13) { let $base_offset := $MakeTypeStorageBase(0, 0x9947b477, $LoadU256($t13)) if $AlignedStorageLoad($base_offset) { @@ -1733,7 +1733,7 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_vector" { } // $t16 := 0x42 $t16 := 0x42 - // $t1 := move_from>>($t16) + // $t1 := move_from<0x2::GlobalVectors::T>>($t16) { let $base_offset := $MakeTypeStorageBase(0, 0x9947b477, $t16) if iszero($AlignedStorageLoad($base_offset)) { @@ -1783,7 +1783,7 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_vector" { } // $t17 := borrow_local($t1) $t17 := $MakePtr(false, local_t) - // $t18 := borrow_field>>.v($t17) + // $t18 := borrow_field<0x2::GlobalVectors::T>>.v($t17) $t18 := $t17 // $t19 := vector::length>($t18) $t19 := A1_vector_length$vec$u64$$($t18) @@ -1800,7 +1800,7 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_vector" { // label L2 // $t23 := borrow_local($t1) $t23 := $MakePtr(false, local_t) - // $t24 := borrow_field>>.v($t23) + // $t24 := borrow_field<0x2::GlobalVectors::T>>.v($t23) $t24 := $t23 // $t25 := 0 $t25 := 0 @@ -1837,7 +1837,7 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_vector" { // label L5 // $t33 := borrow_local($t1) $t33 := $MakePtr(false, local_t) - // $t34 := borrow_field>>.v($t33) + // $t34 := borrow_field<0x2::GlobalVectors::T>>.v($t33) $t34 := $t33 // $t35 := 1 $t35 := 1 @@ -1874,7 +1874,7 @@ object "test_A2_GlobalVectors_test_move_from_vector_of_vector" { // label L8 // $t43 := borrow_local($t1) $t43 := $MakePtr(false, local_t) - // $t44 := borrow_field>>.v($t43) + // $t44 := borrow_field<0x2::GlobalVectors::T>>.v($t43) $t44 := $t43 // $t45 := 2 $t45 := 2 @@ -2298,13 +2298,13 @@ object "test_A2_GlobalVectors_test_move_to" { $t9 := $MakePtr(false, add($locals, 32)) // $t10 := move($t1) $t10 := mload($locals) - // $t11 := pack GlobalVectors::T($t10) + // $t11 := pack 0x2::GlobalVectors::T($t10) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t10) $t11 := $mem } - // move_to>($t11, $t9) + // move_to<0x2::GlobalVectors::T>($t11, $t9) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $LoadU256($t9)) if $AlignedStorageLoad($base_offset) { @@ -2333,7 +2333,7 @@ object "test_A2_GlobalVectors_test_move_to" { } // $t12 := 0x42 $t12 := 0x42 - // $t13 := borrow_global>($t12) + // $t13 := borrow_global<0x2::GlobalVectors::T>($t12) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t12) if iszero($AlignedStorageLoad($base_offset)) { @@ -2341,7 +2341,7 @@ object "test_A2_GlobalVectors_test_move_to" { } $t13 := $MakePtr(true, add($base_offset, 32)) } - // $t14 := borrow_field>.v($t13) + // $t14 := borrow_field<0x2::GlobalVectors::T>.v($t13) $t14 := $t13 // $t15 := vector::length($t14) $t15 := A1_vector_length$u64$($t14) @@ -2358,7 +2358,7 @@ object "test_A2_GlobalVectors_test_move_to" { // label L2 // $t19 := 0x42 $t19 := 0x42 - // $t20 := borrow_global>($t19) + // $t20 := borrow_global<0x2::GlobalVectors::T>($t19) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t19) if iszero($AlignedStorageLoad($base_offset)) { @@ -2366,7 +2366,7 @@ object "test_A2_GlobalVectors_test_move_to" { } $t20 := $MakePtr(true, add($base_offset, 32)) } - // $t21 := borrow_field>.v($t20) + // $t21 := borrow_field<0x2::GlobalVectors::T>.v($t20) $t21 := $t20 // $t22 := 0 $t22 := 0 @@ -2399,7 +2399,7 @@ object "test_A2_GlobalVectors_test_move_to" { // label L5 // $t28 := 0x42 $t28 := 0x42 - // $t29 := borrow_global>($t28) + // $t29 := borrow_global<0x2::GlobalVectors::T>($t28) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t28) if iszero($AlignedStorageLoad($base_offset)) { @@ -2407,7 +2407,7 @@ object "test_A2_GlobalVectors_test_move_to" { } $t29 := $MakePtr(true, add($base_offset, 32)) } - // $t30 := borrow_field>.v($t29) + // $t30 := borrow_field<0x2::GlobalVectors::T>.v($t29) $t30 := $t29 // $t31 := 1 $t31 := 1 @@ -2440,7 +2440,7 @@ object "test_A2_GlobalVectors_test_move_to" { // label L8 // $t37 := 0x42 $t37 := 0x42 - // $t38 := borrow_global>($t37) + // $t38 := borrow_global<0x2::GlobalVectors::T>($t37) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t37) if iszero($AlignedStorageLoad($base_offset)) { @@ -2448,7 +2448,7 @@ object "test_A2_GlobalVectors_test_move_to" { } $t38 := $MakePtr(true, add($base_offset, 32)) } - // $t39 := borrow_field>.v($t38) + // $t39 := borrow_field<0x2::GlobalVectors::T>.v($t38) $t39 := $t38 // $t40 := 2 $t40 := 2 @@ -2776,7 +2776,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { $Abort($t24) } case 4 { - // $t1 := vector::empty() + // $t1 := vector::empty<0x2::GlobalVectors::S>() mstore($locals, A1_vector_empty$A2_GlobalVectors_S$()) // $t2 := borrow_local($t1) $t2 := $MakePtr(false, $locals) @@ -2784,14 +2784,14 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { $t3 := 10 // $t4 := 40 $t4 := 40 - // $t5 := pack GlobalVectors::S($t3, $t4) + // $t5 := pack 0x2::GlobalVectors::S($t3, $t4) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t3) $MemoryStoreU64(add($mem, 16), $t4) $t5 := $mem } - // vector::push_back($t2, $t5) + // vector::push_back<0x2::GlobalVectors::S>($t2, $t5) A1_vector_push_back$A2_GlobalVectors_S$($t2, $t5) // $t6 := borrow_local($t1) $t6 := $MakePtr(false, $locals) @@ -2799,14 +2799,14 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { $t7 := 11 // $t8 := 41 $t8 := 41 - // $t9 := pack GlobalVectors::S($t7, $t8) + // $t9 := pack 0x2::GlobalVectors::S($t7, $t8) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t7) $MemoryStoreU64(add($mem, 16), $t8) $t9 := $mem } - // vector::push_back($t6, $t9) + // vector::push_back<0x2::GlobalVectors::S>($t6, $t9) A1_vector_push_back$A2_GlobalVectors_S$($t6, $t9) // $t10 := borrow_local($t1) $t10 := $MakePtr(false, $locals) @@ -2814,14 +2814,14 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { $t11 := 12 // $t12 := 42 $t12 := 42 - // $t13 := pack GlobalVectors::S($t11, $t12) + // $t13 := pack 0x2::GlobalVectors::S($t11, $t12) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t11) $MemoryStoreU64(add($mem, 16), $t12) $t13 := $mem } - // vector::push_back($t10, $t13) + // vector::push_back<0x2::GlobalVectors::S>($t10, $t13) A1_vector_push_back$A2_GlobalVectors_S$($t10, $t13) // $t14 := 0x42 $t14 := 0x42 @@ -2831,13 +2831,13 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { $t15 := $MakePtr(false, add($locals, 32)) // $t16 := move($t1) $t16 := mload($locals) - // $t17 := pack GlobalVectors::T($t16) + // $t17 := pack 0x2::GlobalVectors::T<0x2::GlobalVectors::S>($t16) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t16) $t17 := $mem } - // move_to>($t17, $t15) + // move_to<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t17, $t15) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $LoadU256($t15)) if $AlignedStorageLoad($base_offset) { @@ -2872,7 +2872,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { } // $t18 := 0x42 $t18 := 0x42 - // $t19 := borrow_global>($t18) + // $t19 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t18) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t18) if iszero($AlignedStorageLoad($base_offset)) { @@ -2880,9 +2880,9 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { } $t19 := $MakePtr(true, add($base_offset, 32)) } - // $t20 := borrow_field>.v($t19) + // $t20 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t19) $t20 := $t19 - // $t21 := vector::length($t20) + // $t21 := vector::length<0x2::GlobalVectors::S>($t20) $t21 := A1_vector_length$A2_GlobalVectors_S$($t20) // $t22 := 3 $t22 := 3 @@ -2897,7 +2897,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { // label L2 // $t25 := 0x42 $t25 := 0x42 - // $t26 := borrow_global>($t25) + // $t26 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t25) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t25) if iszero($AlignedStorageLoad($base_offset)) { @@ -2905,13 +2905,13 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { } $t26 := $MakePtr(true, add($base_offset, 32)) } - // $t27 := borrow_field>.v($t26) + // $t27 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t26) $t27 := $t26 // $t28 := 0 $t28 := 0 - // $t29 := vector::borrow($t27, $t28) + // $t29 := vector::borrow<0x2::GlobalVectors::S>($t27, $t28) $t29 := A1_vector_borrow$A2_GlobalVectors_S$($t27, $t28) - // $t30 := borrow_field.x($t29) + // $t30 := borrow_field<0x2::GlobalVectors::S>.x($t29) $t30 := $t29 // $t31 := read_ref($t30) $t31 := $LoadU128($t30) @@ -2940,7 +2940,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { // label L5 // $t35 := 0x42 $t35 := 0x42 - // $t36 := borrow_global>($t35) + // $t36 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t35) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t35) if iszero($AlignedStorageLoad($base_offset)) { @@ -2948,13 +2948,13 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { } $t36 := $MakePtr(true, add($base_offset, 32)) } - // $t37 := borrow_field>.v($t36) + // $t37 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t36) $t37 := $t36 // $t38 := 1 $t38 := 1 - // $t39 := vector::borrow($t37, $t38) + // $t39 := vector::borrow<0x2::GlobalVectors::S>($t37, $t38) $t39 := A1_vector_borrow$A2_GlobalVectors_S$($t37, $t38) - // $t40 := borrow_field.x($t39) + // $t40 := borrow_field<0x2::GlobalVectors::S>.x($t39) $t40 := $t39 // $t41 := read_ref($t40) $t41 := $LoadU128($t40) @@ -2983,7 +2983,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { // label L8 // $t45 := 0x42 $t45 := 0x42 - // $t46 := borrow_global>($t45) + // $t46 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t45) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t45) if iszero($AlignedStorageLoad($base_offset)) { @@ -2991,13 +2991,13 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_struct" { } $t46 := $MakePtr(true, add($base_offset, 32)) } - // $t47 := borrow_field>.v($t46) + // $t47 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t46) $t47 := $t46 // $t48 := 2 $t48 := 2 - // $t49 := vector::borrow($t47, $t48) + // $t49 := vector::borrow<0x2::GlobalVectors::S>($t47, $t48) $t49 := A1_vector_borrow$A2_GlobalVectors_S$($t47, $t48) - // $t50 := borrow_field.x($t49) + // $t50 := borrow_field<0x2::GlobalVectors::S>.x($t49) $t50 := $t49 // $t51 := read_ref($t50) $t51 := $LoadU128($t50) @@ -3383,13 +3383,13 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { $t12 := $MakePtr(false, add($locals, 32)) // $t13 := move($t1) $t13 := mload($locals) - // $t14 := pack GlobalVectors::T>($t13) + // $t14 := pack 0x2::GlobalVectors::T>($t13) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t13) $t14 := $mem } - // move_to>>($t14, $t12) + // move_to<0x2::GlobalVectors::T>>($t14, $t12) { let $base_offset := $MakeTypeStorageBase(0, 0x9947b477, $LoadU256($t12)) if $AlignedStorageLoad($base_offset) { @@ -3431,7 +3431,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { } // $t15 := 0x42 $t15 := 0x42 - // $t16 := borrow_global>>($t15) + // $t16 := borrow_global<0x2::GlobalVectors::T>>($t15) { let $base_offset := $MakeTypeStorageBase(0, 0x9947b477, $t15) if iszero($AlignedStorageLoad($base_offset)) { @@ -3439,7 +3439,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { } $t16 := $MakePtr(true, add($base_offset, 32)) } - // $t17 := borrow_field>>.v($t16) + // $t17 := borrow_field<0x2::GlobalVectors::T>>.v($t16) $t17 := $t16 // $t18 := vector::length>($t17) $t18 := A1_vector_length$vec$u64$$($t17) @@ -3456,7 +3456,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { // label L2 // $t22 := 0x42 $t22 := 0x42 - // $t23 := borrow_global>>($t22) + // $t23 := borrow_global<0x2::GlobalVectors::T>>($t22) { let $base_offset := $MakeTypeStorageBase(0, 0x9947b477, $t22) if iszero($AlignedStorageLoad($base_offset)) { @@ -3464,7 +3464,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { } $t23 := $MakePtr(true, add($base_offset, 32)) } - // $t24 := borrow_field>>.v($t23) + // $t24 := borrow_field<0x2::GlobalVectors::T>>.v($t23) $t24 := $t23 // $t25 := 0 $t25 := 0 @@ -3501,7 +3501,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { // label L5 // $t33 := 0x42 $t33 := 0x42 - // $t34 := borrow_global>>($t33) + // $t34 := borrow_global<0x2::GlobalVectors::T>>($t33) { let $base_offset := $MakeTypeStorageBase(0, 0x9947b477, $t33) if iszero($AlignedStorageLoad($base_offset)) { @@ -3509,7 +3509,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { } $t34 := $MakePtr(true, add($base_offset, 32)) } - // $t35 := borrow_field>>.v($t34) + // $t35 := borrow_field<0x2::GlobalVectors::T>>.v($t34) $t35 := $t34 // $t36 := 1 $t36 := 1 @@ -3546,7 +3546,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { // label L8 // $t44 := 0x42 $t44 := 0x42 - // $t45 := borrow_global>>($t44) + // $t45 := borrow_global<0x2::GlobalVectors::T>>($t44) { let $base_offset := $MakeTypeStorageBase(0, 0x9947b477, $t44) if iszero($AlignedStorageLoad($base_offset)) { @@ -3554,7 +3554,7 @@ object "test_A2_GlobalVectors_test_move_to_vector_of_vector" { } $t45 := $MakePtr(true, add($base_offset, 32)) } - // $t46 := borrow_field>>.v($t45) + // $t46 := borrow_field<0x2::GlobalVectors::T>>.v($t45) $t46 := $t45 // $t47 := 2 $t47 := 2 @@ -3969,13 +3969,13 @@ object "test_A2_GlobalVectors_test_pop_back_global" { $t9 := $MakePtr(false, add($locals, 32)) // $t10 := move($t1) $t10 := mload($locals) - // $t11 := pack GlobalVectors::T($t10) + // $t11 := pack 0x2::GlobalVectors::T($t10) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t10) $t11 := $mem } - // move_to>($t11, $t9) + // move_to<0x2::GlobalVectors::T>($t11, $t9) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $LoadU256($t9)) if $AlignedStorageLoad($base_offset) { @@ -4004,7 +4004,7 @@ object "test_A2_GlobalVectors_test_pop_back_global" { } // $t12 := 0x42 $t12 := 0x42 - // $t13 := borrow_global>($t12) + // $t13 := borrow_global<0x2::GlobalVectors::T>($t12) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t12) if iszero($AlignedStorageLoad($base_offset)) { @@ -4012,7 +4012,7 @@ object "test_A2_GlobalVectors_test_pop_back_global" { } $t13 := $MakePtr(true, add($base_offset, 32)) } - // $t14 := borrow_field>.v($t13) + // $t14 := borrow_field<0x2::GlobalVectors::T>.v($t13) $t14 := $t13 // $t15 := vector::pop_back($t14) $t15 := A1_vector_pop_back$u64$($t14) @@ -4029,7 +4029,7 @@ object "test_A2_GlobalVectors_test_pop_back_global" { // label L2 // $t19 := 0x42 $t19 := 0x42 - // $t20 := borrow_global>($t19) + // $t20 := borrow_global<0x2::GlobalVectors::T>($t19) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t19) if iszero($AlignedStorageLoad($base_offset)) { @@ -4037,7 +4037,7 @@ object "test_A2_GlobalVectors_test_pop_back_global" { } $t20 := $MakePtr(true, add($base_offset, 32)) } - // $t21 := borrow_field>.v($t20) + // $t21 := borrow_field<0x2::GlobalVectors::T>.v($t20) $t21 := $t20 // $t22 := vector::length($t21) $t22 := A1_vector_length$u64$($t21) @@ -4066,7 +4066,7 @@ object "test_A2_GlobalVectors_test_pop_back_global" { // label L5 // $t26 := 0x42 $t26 := 0x42 - // $t27 := borrow_global>($t26) + // $t27 := borrow_global<0x2::GlobalVectors::T>($t26) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t26) if iszero($AlignedStorageLoad($base_offset)) { @@ -4074,7 +4074,7 @@ object "test_A2_GlobalVectors_test_pop_back_global" { } $t27 := $MakePtr(true, add($base_offset, 32)) } - // $t28 := borrow_field>.v($t27) + // $t28 := borrow_field<0x2::GlobalVectors::T>.v($t27) $t28 := $t27 // $t29 := vector::pop_back($t28) $t29 := A1_vector_pop_back$u64$($t28) @@ -4103,7 +4103,7 @@ object "test_A2_GlobalVectors_test_pop_back_global" { // label L8 // $t33 := 0x42 $t33 := 0x42 - // $t34 := borrow_global>($t33) + // $t34 := borrow_global<0x2::GlobalVectors::T>($t33) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t33) if iszero($AlignedStorageLoad($base_offset)) { @@ -4111,7 +4111,7 @@ object "test_A2_GlobalVectors_test_pop_back_global" { } $t34 := $MakePtr(true, add($base_offset, 32)) } - // $t35 := borrow_field>.v($t34) + // $t35 := borrow_field<0x2::GlobalVectors::T>.v($t34) $t35 := $t34 // $t36 := vector::length($t35) $t36 := A1_vector_length$u64$($t35) @@ -4425,7 +4425,7 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { // label L1 // $t29 := borrow_local($t3) $t29 := $MakePtr(false, e) - // $t30 := borrow_field.y($t29) + // $t30 := borrow_field<0x2::GlobalVectors::S>.y($t29) $t30 := $IndexPtr($t29, 16) // $t31 := read_ref($t30) $t31 := $LoadU64($t30) @@ -4446,7 +4446,7 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { $block := 5 } case 4 { - // $t4 := vector::empty() + // $t4 := vector::empty<0x2::GlobalVectors::S>() mstore($locals, A1_vector_empty$A2_GlobalVectors_S$()) // $t5 := borrow_local($t4) $t5 := $MakePtr(false, $locals) @@ -4454,14 +4454,14 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { $t6 := 10 // $t7 := 40 $t7 := 40 - // $t8 := pack GlobalVectors::S($t6, $t7) + // $t8 := pack 0x2::GlobalVectors::S($t6, $t7) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t6) $MemoryStoreU64(add($mem, 16), $t7) $t8 := $mem } - // vector::push_back($t5, $t8) + // vector::push_back<0x2::GlobalVectors::S>($t5, $t8) A1_vector_push_back$A2_GlobalVectors_S$($t5, $t8) // $t9 := borrow_local($t4) $t9 := $MakePtr(false, $locals) @@ -4469,14 +4469,14 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { $t10 := 11 // $t11 := 41 $t11 := 41 - // $t12 := pack GlobalVectors::S($t10, $t11) + // $t12 := pack 0x2::GlobalVectors::S($t10, $t11) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t10) $MemoryStoreU64(add($mem, 16), $t11) $t12 := $mem } - // vector::push_back($t9, $t12) + // vector::push_back<0x2::GlobalVectors::S>($t9, $t12) A1_vector_push_back$A2_GlobalVectors_S$($t9, $t12) // $t13 := borrow_local($t4) $t13 := $MakePtr(false, $locals) @@ -4484,14 +4484,14 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { $t14 := 12 // $t15 := 42 $t15 := 42 - // $t16 := pack GlobalVectors::S($t14, $t15) + // $t16 := pack 0x2::GlobalVectors::S($t14, $t15) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t14) $MemoryStoreU64(add($mem, 16), $t15) $t16 := $mem } - // vector::push_back($t13, $t16) + // vector::push_back<0x2::GlobalVectors::S>($t13, $t16) A1_vector_push_back$A2_GlobalVectors_S$($t13, $t16) // $t17 := 0x42 $t17 := 0x42 @@ -4501,13 +4501,13 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { $t18 := $MakePtr(false, add($locals, 32)) // $t19 := move($t4) $t19 := mload($locals) - // $t20 := pack GlobalVectors::T($t19) + // $t20 := pack 0x2::GlobalVectors::T<0x2::GlobalVectors::S>($t19) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t19) $t20 := $mem } - // move_to>($t20, $t18) + // move_to<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t20, $t18) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $LoadU256($t18)) if $AlignedStorageLoad($base_offset) { @@ -4542,7 +4542,7 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { } // $t21 := 0x42 $t21 := 0x42 - // $t22 := borrow_global>($t21) + // $t22 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t21) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t21) if iszero($AlignedStorageLoad($base_offset)) { @@ -4550,13 +4550,13 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { } $t22 := $MakePtr(true, add($base_offset, 32)) } - // $t23 := borrow_field>.v($t22) + // $t23 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t22) $t23 := $t22 - // $t3 := vector::pop_back($t23) + // $t3 := vector::pop_back<0x2::GlobalVectors::S>($t23) e := A1_vector_pop_back$A2_GlobalVectors_S$($t23) // $t24 := borrow_local($t3) $t24 := $MakePtr(false, e) - // $t25 := borrow_field.x($t24) + // $t25 := borrow_field<0x2::GlobalVectors::S>.x($t24) $t25 := $t24 // $t26 := read_ref($t25) $t26 := $LoadU128($t25) @@ -4592,7 +4592,7 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { // label L5 // $t35 := 0x42 $t35 := 0x42 - // $t36 := borrow_global>($t35) + // $t36 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t35) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t35) if iszero($AlignedStorageLoad($base_offset)) { @@ -4600,9 +4600,9 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { } $t36 := $MakePtr(true, add($base_offset, 32)) } - // $t37 := borrow_field>.v($t36) + // $t37 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t36) $t37 := $t36 - // $t38 := vector::length($t37) + // $t38 := vector::length<0x2::GlobalVectors::S>($t37) $t38 := A1_vector_length$A2_GlobalVectors_S$($t37) // $t39 := 2 $t39 := 2 @@ -4629,7 +4629,7 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { // label L8 // $t42 := 0x42 $t42 := 0x42 - // $t43 := borrow_global>($t42) + // $t43 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t42) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t42) if iszero($AlignedStorageLoad($base_offset)) { @@ -4637,13 +4637,13 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { } $t43 := $MakePtr(true, add($base_offset, 32)) } - // $t44 := borrow_field>.v($t43) + // $t44 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t43) $t44 := $t43 - // $t3 := vector::pop_back($t44) + // $t3 := vector::pop_back<0x2::GlobalVectors::S>($t44) e := A1_vector_pop_back$A2_GlobalVectors_S$($t44) // $t45 := borrow_local($t3) $t45 := $MakePtr(false, e) - // $t46 := borrow_field.x($t45) + // $t46 := borrow_field<0x2::GlobalVectors::S>.x($t45) $t46 := $t45 // $t47 := read_ref($t46) $t47 := $LoadU128($t46) @@ -4660,7 +4660,7 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { // label L10 // $t50 := borrow_local($t3) $t50 := $MakePtr(false, e) - // $t51 := borrow_field.y($t50) + // $t51 := borrow_field<0x2::GlobalVectors::S>.y($t50) $t51 := $IndexPtr($t50, 16) // $t52 := read_ref($t51) $t52 := $LoadU64($t51) @@ -4703,7 +4703,7 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { // label L14 // $t56 := 0x42 $t56 := 0x42 - // $t57 := borrow_global>($t56) + // $t57 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t56) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t56) if iszero($AlignedStorageLoad($base_offset)) { @@ -4711,9 +4711,9 @@ object "test_A2_GlobalVectors_test_pop_back_struct_global" { } $t57 := $MakePtr(true, add($base_offset, 32)) } - // $t58 := borrow_field>.v($t57) + // $t58 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t57) $t58 := $t57 - // $t59 := vector::length($t58) + // $t59 := vector::length<0x2::GlobalVectors::S>($t58) $t59 := A1_vector_length$A2_GlobalVectors_S$($t58) // $t60 := 1 $t60 := 1 @@ -5096,13 +5096,13 @@ object "test_A2_GlobalVectors_test_push_back_global" { $t9 := $MakePtr(false, add($locals, 32)) // $t10 := copy($t1) $t10 := mload($locals) - // $t11 := pack GlobalVectors::T($t10) + // $t11 := pack 0x2::GlobalVectors::T($t10) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t10) $t11 := $mem } - // move_to>($t11, $t9) + // move_to<0x2::GlobalVectors::T>($t11, $t9) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $LoadU256($t9)) if $AlignedStorageLoad($base_offset) { @@ -5131,7 +5131,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } // $t12 := 0x42 $t12 := 0x42 - // $t13 := borrow_global>($t12) + // $t13 := borrow_global<0x2::GlobalVectors::T>($t12) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t12) if iszero($AlignedStorageLoad($base_offset)) { @@ -5139,7 +5139,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } $t13 := $MakePtr(true, add($base_offset, 32)) } - // $t14 := borrow_field>.v($t13) + // $t14 := borrow_field<0x2::GlobalVectors::T>.v($t13) $t14 := $t13 // $t15 := 13 $t15 := 13 @@ -5147,7 +5147,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { A1_vector_push_back$u64$($t14, $t15) // $t16 := 0x42 $t16 := 0x42 - // $t17 := borrow_global>($t16) + // $t17 := borrow_global<0x2::GlobalVectors::T>($t16) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t16) if iszero($AlignedStorageLoad($base_offset)) { @@ -5155,7 +5155,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } $t17 := $MakePtr(true, add($base_offset, 32)) } - // $t18 := borrow_field>.v($t17) + // $t18 := borrow_field<0x2::GlobalVectors::T>.v($t17) $t18 := $t17 // $t19 := 14 $t19 := 14 @@ -5163,7 +5163,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { A1_vector_push_back$u64$($t18, $t19) // $t20 := 0x42 $t20 := 0x42 - // $t21 := borrow_global>($t20) + // $t21 := borrow_global<0x2::GlobalVectors::T>($t20) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t20) if iszero($AlignedStorageLoad($base_offset)) { @@ -5171,7 +5171,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } $t21 := $MakePtr(true, add($base_offset, 32)) } - // $t22 := borrow_field>.v($t21) + // $t22 := borrow_field<0x2::GlobalVectors::T>.v($t21) $t22 := $t21 // $t23 := vector::length($t22) $t23 := A1_vector_length$u64$($t22) @@ -5188,7 +5188,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { // label L2 // $t27 := 0x42 $t27 := 0x42 - // $t28 := borrow_global>($t27) + // $t28 := borrow_global<0x2::GlobalVectors::T>($t27) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t27) if iszero($AlignedStorageLoad($base_offset)) { @@ -5196,7 +5196,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } $t28 := $MakePtr(true, add($base_offset, 32)) } - // $t29 := borrow_field>.v($t28) + // $t29 := borrow_field<0x2::GlobalVectors::T>.v($t28) $t29 := $t28 // $t30 := 0 $t30 := 0 @@ -5229,7 +5229,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { // label L5 // $t36 := 0x42 $t36 := 0x42 - // $t37 := borrow_global>($t36) + // $t37 := borrow_global<0x2::GlobalVectors::T>($t36) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t36) if iszero($AlignedStorageLoad($base_offset)) { @@ -5237,7 +5237,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } $t37 := $MakePtr(true, add($base_offset, 32)) } - // $t38 := borrow_field>.v($t37) + // $t38 := borrow_field<0x2::GlobalVectors::T>.v($t37) $t38 := $t37 // $t39 := 1 $t39 := 1 @@ -5270,7 +5270,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { // label L8 // $t45 := 0x42 $t45 := 0x42 - // $t46 := borrow_global>($t45) + // $t46 := borrow_global<0x2::GlobalVectors::T>($t45) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t45) if iszero($AlignedStorageLoad($base_offset)) { @@ -5278,7 +5278,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } $t46 := $MakePtr(true, add($base_offset, 32)) } - // $t47 := borrow_field>.v($t46) + // $t47 := borrow_field<0x2::GlobalVectors::T>.v($t46) $t47 := $t46 // $t48 := 2 $t48 := 2 @@ -5311,7 +5311,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { // label L11 // $t54 := 0x42 $t54 := 0x42 - // $t55 := borrow_global>($t54) + // $t55 := borrow_global<0x2::GlobalVectors::T>($t54) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t54) if iszero($AlignedStorageLoad($base_offset)) { @@ -5319,7 +5319,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } $t55 := $MakePtr(true, add($base_offset, 32)) } - // $t56 := borrow_field>.v($t55) + // $t56 := borrow_field<0x2::GlobalVectors::T>.v($t55) $t56 := $t55 // $t57 := 3 $t57 := 3 @@ -5352,7 +5352,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { // label L14 // $t63 := 0x42 $t63 := 0x42 - // $t64 := borrow_global>($t63) + // $t64 := borrow_global<0x2::GlobalVectors::T>($t63) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t63) if iszero($AlignedStorageLoad($base_offset)) { @@ -5360,7 +5360,7 @@ object "test_A2_GlobalVectors_test_push_back_global" { } $t64 := $MakePtr(true, add($base_offset, 32)) } - // $t65 := borrow_field>.v($t64) + // $t65 := borrow_field<0x2::GlobalVectors::T>.v($t64) $t65 := $t64 // $t66 := 4 $t66 := 4 @@ -5688,7 +5688,7 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { $Abort($t36) } case 4 { - // $t1 := vector::empty() + // $t1 := vector::empty<0x2::GlobalVectors::S>() mstore($locals, A1_vector_empty$A2_GlobalVectors_S$()) // $t2 := borrow_local($t1) $t2 := $MakePtr(false, $locals) @@ -5696,14 +5696,14 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { $t3 := 10 // $t4 := 40 $t4 := 40 - // $t5 := pack GlobalVectors::S($t3, $t4) + // $t5 := pack 0x2::GlobalVectors::S($t3, $t4) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t3) $MemoryStoreU64(add($mem, 16), $t4) $t5 := $mem } - // vector::push_back($t2, $t5) + // vector::push_back<0x2::GlobalVectors::S>($t2, $t5) A1_vector_push_back$A2_GlobalVectors_S$($t2, $t5) // $t6 := borrow_local($t1) $t6 := $MakePtr(false, $locals) @@ -5711,14 +5711,14 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { $t7 := 11 // $t8 := 41 $t8 := 41 - // $t9 := pack GlobalVectors::S($t7, $t8) + // $t9 := pack 0x2::GlobalVectors::S($t7, $t8) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t7) $MemoryStoreU64(add($mem, 16), $t8) $t9 := $mem } - // vector::push_back($t6, $t9) + // vector::push_back<0x2::GlobalVectors::S>($t6, $t9) A1_vector_push_back$A2_GlobalVectors_S$($t6, $t9) // $t10 := borrow_local($t1) $t10 := $MakePtr(false, $locals) @@ -5726,14 +5726,14 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { $t11 := 12 // $t12 := 42 $t12 := 42 - // $t13 := pack GlobalVectors::S($t11, $t12) + // $t13 := pack 0x2::GlobalVectors::S($t11, $t12) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t11) $MemoryStoreU64(add($mem, 16), $t12) $t13 := $mem } - // vector::push_back($t10, $t13) + // vector::push_back<0x2::GlobalVectors::S>($t10, $t13) A1_vector_push_back$A2_GlobalVectors_S$($t10, $t13) // $t14 := 0x42 $t14 := 0x42 @@ -5743,13 +5743,13 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { $t15 := $MakePtr(false, add($locals, 32)) // $t16 := move($t1) $t16 := mload($locals) - // $t17 := pack GlobalVectors::T($t16) + // $t17 := pack 0x2::GlobalVectors::T<0x2::GlobalVectors::S>($t16) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t16) $t17 := $mem } - // move_to>($t17, $t15) + // move_to<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t17, $t15) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $LoadU256($t15)) if $AlignedStorageLoad($base_offset) { @@ -5784,7 +5784,7 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { } // $t18 := 0x42 $t18 := 0x42 - // $t19 := borrow_global>($t18) + // $t19 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t18) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t18) if iszero($AlignedStorageLoad($base_offset)) { @@ -5792,24 +5792,24 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { } $t19 := $MakePtr(true, add($base_offset, 32)) } - // $t20 := borrow_field>.v($t19) + // $t20 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t19) $t20 := $t19 // $t21 := 13 $t21 := 13 // $t22 := 43 $t22 := 43 - // $t23 := pack GlobalVectors::S($t21, $t22) + // $t23 := pack 0x2::GlobalVectors::S($t21, $t22) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t21) $MemoryStoreU64(add($mem, 16), $t22) $t23 := $mem } - // vector::push_back($t20, $t23) + // vector::push_back<0x2::GlobalVectors::S>($t20, $t23) A1_vector_push_back$A2_GlobalVectors_S$($t20, $t23) // $t24 := 0x42 $t24 := 0x42 - // $t25 := borrow_global>($t24) + // $t25 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t24) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t24) if iszero($AlignedStorageLoad($base_offset)) { @@ -5817,24 +5817,24 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { } $t25 := $MakePtr(true, add($base_offset, 32)) } - // $t26 := borrow_field>.v($t25) + // $t26 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t25) $t26 := $t25 // $t27 := 14 $t27 := 14 // $t28 := 44 $t28 := 44 - // $t29 := pack GlobalVectors::S($t27, $t28) + // $t29 := pack 0x2::GlobalVectors::S($t27, $t28) { let $mem := $Malloc(24) $MemoryStoreU128(add($mem, 0), $t27) $MemoryStoreU64(add($mem, 16), $t28) $t29 := $mem } - // vector::push_back($t26, $t29) + // vector::push_back<0x2::GlobalVectors::S>($t26, $t29) A1_vector_push_back$A2_GlobalVectors_S$($t26, $t29) // $t30 := 0x42 $t30 := 0x42 - // $t31 := borrow_global>($t30) + // $t31 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t30) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t30) if iszero($AlignedStorageLoad($base_offset)) { @@ -5842,9 +5842,9 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { } $t31 := $MakePtr(true, add($base_offset, 32)) } - // $t32 := borrow_field>.v($t31) + // $t32 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t31) $t32 := $t31 - // $t33 := vector::length($t32) + // $t33 := vector::length<0x2::GlobalVectors::S>($t32) $t33 := A1_vector_length$A2_GlobalVectors_S$($t32) // $t34 := 5 $t34 := 5 @@ -5859,7 +5859,7 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { // label L2 // $t37 := 0x42 $t37 := 0x42 - // $t38 := borrow_global>($t37) + // $t38 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t37) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t37) if iszero($AlignedStorageLoad($base_offset)) { @@ -5867,13 +5867,13 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { } $t38 := $MakePtr(true, add($base_offset, 32)) } - // $t39 := borrow_field>.v($t38) + // $t39 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t38) $t39 := $t38 // $t40 := 0 $t40 := 0 - // $t41 := vector::borrow($t39, $t40) + // $t41 := vector::borrow<0x2::GlobalVectors::S>($t39, $t40) $t41 := A1_vector_borrow$A2_GlobalVectors_S$($t39, $t40) - // $t42 := borrow_field.x($t41) + // $t42 := borrow_field<0x2::GlobalVectors::S>.x($t41) $t42 := $t41 // $t43 := read_ref($t42) $t43 := $LoadU128($t42) @@ -5902,7 +5902,7 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { // label L5 // $t47 := 0x42 $t47 := 0x42 - // $t48 := borrow_global>($t47) + // $t48 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t47) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t47) if iszero($AlignedStorageLoad($base_offset)) { @@ -5910,13 +5910,13 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { } $t48 := $MakePtr(true, add($base_offset, 32)) } - // $t49 := borrow_field>.v($t48) + // $t49 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t48) $t49 := $t48 // $t50 := 1 $t50 := 1 - // $t51 := vector::borrow($t49, $t50) + // $t51 := vector::borrow<0x2::GlobalVectors::S>($t49, $t50) $t51 := A1_vector_borrow$A2_GlobalVectors_S$($t49, $t50) - // $t52 := borrow_field.x($t51) + // $t52 := borrow_field<0x2::GlobalVectors::S>.x($t51) $t52 := $t51 // $t53 := read_ref($t52) $t53 := $LoadU128($t52) @@ -5945,7 +5945,7 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { // label L8 // $t57 := 0x42 $t57 := 0x42 - // $t58 := borrow_global>($t57) + // $t58 := borrow_global<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>($t57) { let $base_offset := $MakeTypeStorageBase(0, 0x27c9b6b7, $t57) if iszero($AlignedStorageLoad($base_offset)) { @@ -5953,13 +5953,13 @@ object "test_A2_GlobalVectors_test_push_back_struct_global" { } $t58 := $MakePtr(true, add($base_offset, 32)) } - // $t59 := borrow_field>.v($t58) + // $t59 := borrow_field<0x2::GlobalVectors::T<0x2::GlobalVectors::S>>.v($t58) $t59 := $t58 // $t60 := 2 $t60 := 2 - // $t61 := vector::borrow($t59, $t60) + // $t61 := vector::borrow<0x2::GlobalVectors::S>($t59, $t60) $t61 := A1_vector_borrow$A2_GlobalVectors_S$($t59, $t60) - // $t62 := borrow_field.x($t61) + // $t62 := borrow_field<0x2::GlobalVectors::S>.x($t61) $t62 := $t61 // $t63 := read_ref($t62) $t63 := $LoadU128($t62) @@ -6327,13 +6327,13 @@ object "test_A2_GlobalVectors_test_read_ref_copy" { $t6 := $MakePtr(false, add($locals, 32)) // $t7 := move($t1) $t7 := mload($locals) - // $t8 := pack GlobalVectors::T($t7) + // $t8 := pack 0x2::GlobalVectors::T($t7) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t7) $t8 := $mem } - // move_to>($t8, $t6) + // move_to<0x2::GlobalVectors::T>($t8, $t6) { let $base_offset := $MakeTypeStorageBase(0, 0x10b7746c, $LoadU256($t6)) if $AlignedStorageLoad($base_offset) { @@ -6362,7 +6362,7 @@ object "test_A2_GlobalVectors_test_read_ref_copy" { } // $t9 := 0x42 $t9 := 0x42 - // $t10 := borrow_global>($t9) + // $t10 := borrow_global<0x2::GlobalVectors::T>($t9) { let $base_offset := $MakeTypeStorageBase(0, 0x10b7746c, $t9) if iszero($AlignedStorageLoad($base_offset)) { @@ -6370,7 +6370,7 @@ object "test_A2_GlobalVectors_test_read_ref_copy" { } $t10 := $MakePtr(true, add($base_offset, 32)) } - // $t11 := borrow_field>.v($t10) + // $t11 := borrow_field<0x2::GlobalVectors::T>.v($t10) $t11 := $t10 // $t2 := read_ref($t11) mstore(add($locals, 64), $LoadU256($t11)) @@ -6802,13 +6802,13 @@ object "test_A2_GlobalVectors_test_swap_global" { $t9 := $MakePtr(false, add($locals, 32)) // $t10 := move($t1) $t10 := mload($locals) - // $t11 := pack GlobalVectors::T($t10) + // $t11 := pack 0x2::GlobalVectors::T($t10) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t10) $t11 := $mem } - // move_to>($t11, $t9) + // move_to<0x2::GlobalVectors::T>($t11, $t9) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $LoadU256($t9)) if $AlignedStorageLoad($base_offset) { @@ -6837,7 +6837,7 @@ object "test_A2_GlobalVectors_test_swap_global" { } // $t12 := 0x42 $t12 := 0x42 - // $t13 := borrow_global>($t12) + // $t13 := borrow_global<0x2::GlobalVectors::T>($t12) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t12) if iszero($AlignedStorageLoad($base_offset)) { @@ -6845,7 +6845,7 @@ object "test_A2_GlobalVectors_test_swap_global" { } $t13 := $MakePtr(true, add($base_offset, 32)) } - // $t14 := borrow_field>.v($t13) + // $t14 := borrow_field<0x2::GlobalVectors::T>.v($t13) $t14 := $t13 // $t15 := 0 $t15 := 0 @@ -6855,7 +6855,7 @@ object "test_A2_GlobalVectors_test_swap_global" { A1_vector_swap$u64$($t14, $t15, $t16) // $t17 := 0x42 $t17 := 0x42 - // $t18 := borrow_global>($t17) + // $t18 := borrow_global<0x2::GlobalVectors::T>($t17) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t17) if iszero($AlignedStorageLoad($base_offset)) { @@ -6863,7 +6863,7 @@ object "test_A2_GlobalVectors_test_swap_global" { } $t18 := $MakePtr(true, add($base_offset, 32)) } - // $t19 := borrow_field>.v($t18) + // $t19 := borrow_field<0x2::GlobalVectors::T>.v($t18) $t19 := $t18 // $t20 := vector::length($t19) $t20 := A1_vector_length$u64$($t19) @@ -6880,7 +6880,7 @@ object "test_A2_GlobalVectors_test_swap_global" { // label L2 // $t24 := 0x42 $t24 := 0x42 - // $t25 := borrow_global>($t24) + // $t25 := borrow_global<0x2::GlobalVectors::T>($t24) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t24) if iszero($AlignedStorageLoad($base_offset)) { @@ -6888,7 +6888,7 @@ object "test_A2_GlobalVectors_test_swap_global" { } $t25 := $MakePtr(true, add($base_offset, 32)) } - // $t26 := borrow_field>.v($t25) + // $t26 := borrow_field<0x2::GlobalVectors::T>.v($t25) $t26 := $t25 // $t27 := 0 $t27 := 0 @@ -6921,7 +6921,7 @@ object "test_A2_GlobalVectors_test_swap_global" { // label L5 // $t33 := 0x42 $t33 := 0x42 - // $t34 := borrow_global>($t33) + // $t34 := borrow_global<0x2::GlobalVectors::T>($t33) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t33) if iszero($AlignedStorageLoad($base_offset)) { @@ -6929,7 +6929,7 @@ object "test_A2_GlobalVectors_test_swap_global" { } $t34 := $MakePtr(true, add($base_offset, 32)) } - // $t35 := borrow_field>.v($t34) + // $t35 := borrow_field<0x2::GlobalVectors::T>.v($t34) $t35 := $t34 // $t36 := 1 $t36 := 1 @@ -6962,7 +6962,7 @@ object "test_A2_GlobalVectors_test_swap_global" { // label L8 // $t42 := 0x42 $t42 := 0x42 - // $t43 := borrow_global>($t42) + // $t43 := borrow_global<0x2::GlobalVectors::T>($t42) { let $base_offset := $MakeTypeStorageBase(0, 0x7da2a540, $t42) if iszero($AlignedStorageLoad($base_offset)) { @@ -6970,7 +6970,7 @@ object "test_A2_GlobalVectors_test_swap_global" { } $t43 := $MakePtr(true, add($base_offset, 32)) } - // $t44 := borrow_field>.v($t43) + // $t44 := borrow_field<0x2::GlobalVectors::T>.v($t43) $t44 := $t43 // $t45 := 2 $t45 := 2 diff --git a/third_party/move/evm/move-to-yul/tests/Resources.v2_exp b/third_party/move/evm/move-to-yul/tests/Resources.v2_exp index e75268ee3b854..d28737892fc66 100644 --- a/third_party/move/evm/move-to-yul/tests/Resources.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/Resources.v2_exp @@ -81,7 +81,7 @@ object "test_A2_M_test_increment_a" { A2_M_increment_a($t4) // $t5 := 0x3 $t5 := 0x3 - // $t6 := borrow_global($t5) + // $t6 := borrow_global<0x2::M::S>($t5) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $t5) if iszero($AlignedStorageLoad($base_offset)) { @@ -89,7 +89,7 @@ object "test_A2_M_test_increment_a" { } $t6 := $MakePtr(true, add($base_offset, 32)) } - // $t7 := borrow_field.a($t6) + // $t7 := borrow_field<0x2::M::S>.a($t6) $t7 := $IndexPtr($t6, 32) // $t8 := read_ref($t7) $t8 := $LoadU64($t7) @@ -113,7 +113,7 @@ object "test_A2_M_test_increment_a" { function A2_M_increment_a(addr) { let r, $t2, $t3, $t4, $t5, $t6, $t7 - // $t2 := borrow_global($t0) + // $t2 := borrow_global<0x2::M::S>($t0) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, addr) if iszero($AlignedStorageLoad($base_offset)) { @@ -121,7 +121,7 @@ object "test_A2_M_test_increment_a" { } $t2 := $MakePtr(true, add($base_offset, 32)) } - // $t3 := borrow_field.a($t2) + // $t3 := borrow_field<0x2::M::S>.a($t2) $t3 := $IndexPtr($t2, 32) // $t4 := read_ref($t3) $t4 := $LoadU64($t3) @@ -129,7 +129,7 @@ object "test_A2_M_test_increment_a" { $t5 := 1 // $t6 := +($t4, $t5) $t6 := $AddU64($t4, $t5) - // $t7 := borrow_field.a($t2) + // $t7 := borrow_field<0x2::M::S>.a($t2) $t7 := $IndexPtr($t2, 32) // write_ref($t7, $t6) $StoreU64($t7, $t6) @@ -148,13 +148,13 @@ object "test_A2_M_test_increment_a" { $t6 := $AddU64(a, a) // $t7 := (u128)($t6) $t7 := $CastU128($t6) - // $t8 := pack M::S2($t7) + // $t8 := pack 0x2::M::S2($t7) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), $t7) $t8 := $mem } - // $t9 := pack M::S($t1, $t5, $t8) + // $t9 := pack 0x2::M::S($t1, $t5, $t8) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -162,7 +162,7 @@ object "test_A2_M_test_increment_a" { $MemoryStoreU256(add($mem, 0), $t8) $t9 := $mem } - // move_to($t9, $t0) + // move_to<0x2::M::S>($t9, $t0) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $LoadU256(sg)) if $AlignedStorageLoad($base_offset) { @@ -441,7 +441,7 @@ object "test_A2_M_test_publish" { A2_M_publish($t2, $t3) // $t4 := 0x3 $t4 := 0x3 - // $t5 := exists($t4) + // $t5 := exists<0x2::M::S>($t4) $t5 := $AlignedStorageLoad($MakeTypeStorageBase(0, 0x698265eb, $t4)) // if ($t5) goto L1 else goto L0 switch $t5 @@ -452,7 +452,7 @@ object "test_A2_M_test_publish" { // label L2 // $t7 := 0x3 $t7 := 0x3 - // $t8 := borrow_global($t7) + // $t8 := borrow_global<0x2::M::S>($t7) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $t7) if iszero($AlignedStorageLoad($base_offset)) { @@ -460,7 +460,7 @@ object "test_A2_M_test_publish" { } $t8 := $MakePtr(true, add($base_offset, 32)) } - // $t9 := borrow_field.a($t8) + // $t9 := borrow_field<0x2::M::S>.a($t8) $t9 := $IndexPtr($t8, 32) // $t10 := read_ref($t9) $t10 := $LoadU64($t9) @@ -489,7 +489,7 @@ object "test_A2_M_test_publish" { // label L5 // $t14 := 0x3 $t14 := 0x3 - // $t15 := borrow_global($t14) + // $t15 := borrow_global<0x2::M::S>($t14) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $t14) if iszero($AlignedStorageLoad($base_offset)) { @@ -497,7 +497,7 @@ object "test_A2_M_test_publish" { } $t15 := $MakePtr(true, add($base_offset, 32)) } - // $t16 := borrow_field.b($t15) + // $t16 := borrow_field<0x2::M::S>.b($t15) $t16 := $IndexPtr($t15, 40) // $t17 := read_ref($t16) $t17 := $LoadU8($t16) @@ -526,7 +526,7 @@ object "test_A2_M_test_publish" { // label L8 // $t21 := 0x3 $t21 := 0x3 - // $t22 := borrow_global($t21) + // $t22 := borrow_global<0x2::M::S>($t21) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $t21) if iszero($AlignedStorageLoad($base_offset)) { @@ -534,11 +534,11 @@ object "test_A2_M_test_publish" { } $t22 := $MakePtr(true, add($base_offset, 32)) } - // $t23 := borrow_field.c($t22) + // $t23 := borrow_field<0x2::M::S>.c($t22) { $t23 := $MakePtr($IsStoragePtr($t22), $LoadU256($t22)) } - // $t24 := borrow_field.x($t23) + // $t24 := borrow_field<0x2::M::S2>.x($t23) $t24 := $t23 // $t25 := read_ref($t24) $t25 := $LoadU128($t24) @@ -584,13 +584,13 @@ object "test_A2_M_test_publish" { $t6 := $AddU64(a, a) // $t7 := (u128)($t6) $t7 := $CastU128($t6) - // $t8 := pack M::S2($t7) + // $t8 := pack 0x2::M::S2($t7) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), $t7) $t8 := $mem } - // $t9 := pack M::S($t1, $t5, $t8) + // $t9 := pack 0x2::M::S($t1, $t5, $t8) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -598,7 +598,7 @@ object "test_A2_M_test_publish" { $MemoryStoreU256(add($mem, 0), $t8) $t9 := $mem } - // move_to($t9, $t0) + // move_to<0x2::M::S>($t9, $t0) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $LoadU256(sg)) if $AlignedStorageLoad($base_offset) { @@ -870,7 +870,7 @@ object "test_A2_M_test_publish_t" { A2_M_publish_t($t2, $t3) // $t4 := 0x3 $t4 := 0x3 - // $t5 := exists($t4) + // $t5 := exists<0x2::M::T>($t4) $t5 := $AlignedStorageLoad($MakeTypeStorageBase(0, 0x3948ca0a, $t4)) // if ($t5) goto L1 else goto L0 switch $t5 @@ -881,7 +881,7 @@ object "test_A2_M_test_publish_t" { // label L2 // $t7 := 0x3 $t7 := 0x3 - // $t8 := borrow_global($t7) + // $t8 := borrow_global<0x2::M::T>($t7) { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t7) if iszero($AlignedStorageLoad($base_offset)) { @@ -889,11 +889,11 @@ object "test_A2_M_test_publish_t" { } $t8 := $MakePtr(true, add($base_offset, 32)) } - // $t9 := borrow_field.s($t8) + // $t9 := borrow_field<0x2::M::T>.s($t8) { $t9 := $MakePtr($IsStoragePtr($t8), $LoadU256($t8)) } - // $t10 := borrow_field.a($t9) + // $t10 := borrow_field<0x2::M::S>.a($t9) $t10 := $IndexPtr($t9, 32) // $t11 := read_ref($t10) $t11 := $LoadU64($t10) @@ -922,7 +922,7 @@ object "test_A2_M_test_publish_t" { // label L5 // $t15 := 0x3 $t15 := 0x3 - // $t16 := borrow_global($t15) + // $t16 := borrow_global<0x2::M::T>($t15) { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t15) if iszero($AlignedStorageLoad($base_offset)) { @@ -930,11 +930,11 @@ object "test_A2_M_test_publish_t" { } $t16 := $MakePtr(true, add($base_offset, 32)) } - // $t17 := borrow_field.s($t16) + // $t17 := borrow_field<0x2::M::T>.s($t16) { $t17 := $MakePtr($IsStoragePtr($t16), $LoadU256($t16)) } - // $t18 := borrow_field.b($t17) + // $t18 := borrow_field<0x2::M::S>.b($t17) $t18 := $IndexPtr($t17, 40) // $t19 := read_ref($t18) $t19 := $LoadU8($t18) @@ -963,7 +963,7 @@ object "test_A2_M_test_publish_t" { // label L8 // $t23 := 0x3 $t23 := 0x3 - // $t24 := borrow_global($t23) + // $t24 := borrow_global<0x2::M::T>($t23) { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t23) if iszero($AlignedStorageLoad($base_offset)) { @@ -971,15 +971,15 @@ object "test_A2_M_test_publish_t" { } $t24 := $MakePtr(true, add($base_offset, 32)) } - // $t25 := borrow_field.s($t24) + // $t25 := borrow_field<0x2::M::T>.s($t24) { $t25 := $MakePtr($IsStoragePtr($t24), $LoadU256($t24)) } - // $t26 := borrow_field.c($t25) + // $t26 := borrow_field<0x2::M::S>.c($t25) { $t26 := $MakePtr($IsStoragePtr($t25), $LoadU256($t25)) } - // $t27 := borrow_field.x($t26) + // $t27 := borrow_field<0x2::M::S2>.x($t26) $t27 := $t26 // $t28 := read_ref($t27) $t28 := $LoadU128($t27) @@ -1025,13 +1025,13 @@ object "test_A2_M_test_publish_t" { $t6 := $AddU64(a, a) // $t7 := (u128)($t6) $t7 := $CastU128($t6) - // $t8 := pack M::S2($t7) + // $t8 := pack 0x2::M::S2($t7) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), $t7) $t8 := $mem } - // $t9 := pack M::S($t1, $t5, $t8) + // $t9 := pack 0x2::M::S($t1, $t5, $t8) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -1039,13 +1039,13 @@ object "test_A2_M_test_publish_t" { $MemoryStoreU256(add($mem, 0), $t8) $t9 := $mem } - // $t10 := pack M::T($t9) + // $t10 := pack 0x2::M::T($t9) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t9) $t10 := $mem } - // move_to($t10, $t0) + // move_to<0x2::M::T>($t10, $t0) { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $LoadU256(sg)) if $AlignedStorageLoad($base_offset) { @@ -1325,12 +1325,12 @@ object "test_A2_M_test_unpublish" { $t6 := 0x3 // $t7 := M::unpublish($t6) $t7 := A2_M_unpublish($t6) - // ($t8, $t9, $t10) := unpack M::S($t7) + // ($t8, $t9, $t10) := unpack 0x2::M::S($t7) $t8 := $MemoryLoadU64(add($t7, 32)) $t9 := $MemoryLoadU8(add($t7, 40)) $t10 := $MemoryLoadU256(add($t7, 0)) $Free($t7, 41) - // $t11 := unpack M::S2($t10) + // $t11 := unpack 0x2::M::S2($t10) $t11 := $MemoryLoadU128(add($t10, 0)) $Free($t10, 16) // $t12 := 33 @@ -1399,7 +1399,7 @@ object "test_A2_M_test_unpublish" { function A2_M_unpublish(a) -> $result { let $t1 - // $t1 := move_from($t0) + // $t1 := move_from<0x2::M::S>($t0) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, a) if iszero($AlignedStorageLoad($base_offset)) { @@ -1440,13 +1440,13 @@ object "test_A2_M_test_unpublish" { $t6 := $AddU64(a, a) // $t7 := (u128)($t6) $t7 := $CastU128($t6) - // $t8 := pack M::S2($t7) + // $t8 := pack 0x2::M::S2($t7) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), $t7) $t8 := $mem } - // $t9 := pack M::S($t1, $t5, $t8) + // $t9 := pack 0x2::M::S($t1, $t5, $t8) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -1454,7 +1454,7 @@ object "test_A2_M_test_unpublish" { $MemoryStoreU256(add($mem, 0), $t8) $t9 := $mem } - // move_to($t9, $t0) + // move_to<0x2::M::S>($t9, $t0) { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $LoadU256(sg)) if $AlignedStorageLoad($base_offset) { diff --git a/third_party/move/evm/move-to-yul/tests/Resources.v2_exp.capture-source-info b/third_party/move/evm/move-to-yul/tests/Resources.v2_exp.capture-source-info index c04def6d750e5..9832954c64548 100644 --- a/third_party/move/evm/move-to-yul/tests/Resources.v2_exp.capture-source-info +++ b/third_party/move/evm/move-to-yul/tests/Resources.v2_exp.capture-source-info @@ -96,7 +96,7 @@ object "test_A2_M_test_increment_a" { // $t5 := 0x3 /// @src 1:1309:1311 $t5 := 0x3 - // $t6 := borrow_global($t5) + // $t6 := borrow_global<0x2::M::S>($t5) /// @src 1:1292:1305 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $t5) @@ -105,7 +105,7 @@ object "test_A2_M_test_increment_a" { } $t6 := $MakePtr(true, add($base_offset, 32)) } - // $t7 := borrow_field.a($t6) + // $t7 := borrow_field<0x2::M::S>.a($t6) /// @src 1:1292:1314 $t7 := $IndexPtr($t6, 32) // $t8 := read_ref($t7) @@ -135,7 +135,7 @@ object "test_A2_M_test_increment_a" { function A2_M_increment_a(addr) { let r, $t2, $t3, $t4, $t5, $t6, $t7 - // $t2 := borrow_global($t0) + // $t2 := borrow_global<0x2::M::S>($t0) /// @src 1:1106:1123 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, addr) @@ -144,7 +144,7 @@ object "test_A2_M_test_increment_a" { } $t2 := $MakePtr(true, add($base_offset, 32)) } - // $t3 := borrow_field.a($t2) + // $t3 := borrow_field<0x2::M::S>.a($t2) /// @src 1:1148:1151 $t3 := $IndexPtr($t2, 32) // $t4 := read_ref($t3) @@ -156,7 +156,7 @@ object "test_A2_M_test_increment_a" { // $t6 := +($t4, $t5) /// @src 1:1152:1153 $t6 := $AddU64($t4, $t5) - // $t7 := borrow_field.a($t2) + // $t7 := borrow_field<0x2::M::S>.a($t2) /// @src 1:1142:1145 $t7 := $IndexPtr($t2, 32) // write_ref($t7, $t6) @@ -183,14 +183,14 @@ object "test_A2_M_test_increment_a" { // $t7 := (u128)($t6) /// @src 1:405:422 $t7 := $CastU128($t6) - // $t8 := pack M::S2($t7) + // $t8 := pack 0x2::M::S2($t7) /// @src 1:399:423 { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), $t7) $t8 := $mem } - // $t9 := pack M::S($t1, $t5, $t8) + // $t9 := pack 0x2::M::S($t1, $t5, $t8) /// @src 1:371:424 { let $mem := $Malloc(41) @@ -199,7 +199,7 @@ object "test_A2_M_test_increment_a" { $MemoryStoreU256(add($mem, 0), $t8) $t9 := $mem } - // move_to($t9, $t0) + // move_to<0x2::M::S>($t9, $t0) /// @src 1:434:441 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $LoadU256(sg)) @@ -492,7 +492,7 @@ object "test_A2_M_test_publish" { // $t4 := 0x3 /// @src 1:566:568 $t4 := 0x3 - // $t5 := exists($t4) + // $t5 := exists<0x2::M::S>($t4) /// @src 1:556:562 $t5 := $AlignedStorageLoad($MakeTypeStorageBase(0, 0x698265eb, $t4)) // if ($t5) goto L1 else goto L0 @@ -506,7 +506,7 @@ object "test_A2_M_test_publish" { // $t7 := 0x3 /// @src 1:609:611 $t7 := 0x3 - // $t8 := borrow_global($t7) + // $t8 := borrow_global<0x2::M::S>($t7) /// @src 1:592:605 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $t7) @@ -515,7 +515,7 @@ object "test_A2_M_test_publish" { } $t8 := $MakePtr(true, add($base_offset, 32)) } - // $t9 := borrow_field.a($t8) + // $t9 := borrow_field<0x2::M::S>.a($t8) /// @src 1:592:614 $t9 := $IndexPtr($t8, 32) // $t10 := read_ref($t9) @@ -553,7 +553,7 @@ object "test_A2_M_test_publish" { // $t14 := 0x3 /// @src 1:660:662 $t14 := 0x3 - // $t15 := borrow_global($t14) + // $t15 := borrow_global<0x2::M::S>($t14) /// @src 1:643:656 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $t14) @@ -562,7 +562,7 @@ object "test_A2_M_test_publish" { } $t15 := $MakePtr(true, add($base_offset, 32)) } - // $t16 := borrow_field.b($t15) + // $t16 := borrow_field<0x2::M::S>.b($t15) /// @src 1:643:665 $t16 := $IndexPtr($t15, 40) // $t17 := read_ref($t16) @@ -600,7 +600,7 @@ object "test_A2_M_test_publish" { // $t21 := 0x3 /// @src 1:711:713 $t21 := 0x3 - // $t22 := borrow_global($t21) + // $t22 := borrow_global<0x2::M::S>($t21) /// @src 1:694:707 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $t21) @@ -609,12 +609,12 @@ object "test_A2_M_test_publish" { } $t22 := $MakePtr(true, add($base_offset, 32)) } - // $t23 := borrow_field.c($t22) + // $t23 := borrow_field<0x2::M::S>.c($t22) /// @src 1:694:716 { $t23 := $MakePtr($IsStoragePtr($t22), $LoadU256($t22)) } - // $t24 := borrow_field.x($t23) + // $t24 := borrow_field<0x2::M::S2>.x($t23) /// @src 1:694:718 $t24 := $t23 // $t25 := read_ref($t24) @@ -674,14 +674,14 @@ object "test_A2_M_test_publish" { // $t7 := (u128)($t6) /// @src 1:405:422 $t7 := $CastU128($t6) - // $t8 := pack M::S2($t7) + // $t8 := pack 0x2::M::S2($t7) /// @src 1:399:423 { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), $t7) $t8 := $mem } - // $t9 := pack M::S($t1, $t5, $t8) + // $t9 := pack 0x2::M::S($t1, $t5, $t8) /// @src 1:371:424 { let $mem := $Malloc(41) @@ -690,7 +690,7 @@ object "test_A2_M_test_publish" { $MemoryStoreU256(add($mem, 0), $t8) $t9 := $mem } - // move_to($t9, $t0) + // move_to<0x2::M::S>($t9, $t0) /// @src 1:434:441 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $LoadU256(sg)) @@ -976,7 +976,7 @@ object "test_A2_M_test_publish_t" { // $t4 := 0x3 /// @src 1:1602:1604 $t4 := 0x3 - // $t5 := exists($t4) + // $t5 := exists<0x2::M::T>($t4) /// @src 1:1592:1598 $t5 := $AlignedStorageLoad($MakeTypeStorageBase(0, 0x3948ca0a, $t4)) // if ($t5) goto L1 else goto L0 @@ -990,7 +990,7 @@ object "test_A2_M_test_publish_t" { // $t7 := 0x3 /// @src 1:1646:1648 $t7 := 0x3 - // $t8 := borrow_global($t7) + // $t8 := borrow_global<0x2::M::T>($t7) /// @src 1:1629:1642 { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t7) @@ -999,12 +999,12 @@ object "test_A2_M_test_publish_t" { } $t8 := $MakePtr(true, add($base_offset, 32)) } - // $t9 := borrow_field.s($t8) + // $t9 := borrow_field<0x2::M::T>.s($t8) /// @src 1:1629:1651 { $t9 := $MakePtr($IsStoragePtr($t8), $LoadU256($t8)) } - // $t10 := borrow_field.a($t9) + // $t10 := borrow_field<0x2::M::S>.a($t9) /// @src 1:1629:1653 $t10 := $IndexPtr($t9, 32) // $t11 := read_ref($t10) @@ -1042,7 +1042,7 @@ object "test_A2_M_test_publish_t" { // $t15 := 0x3 /// @src 1:1700:1702 $t15 := 0x3 - // $t16 := borrow_global($t15) + // $t16 := borrow_global<0x2::M::T>($t15) /// @src 1:1683:1696 { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t15) @@ -1051,12 +1051,12 @@ object "test_A2_M_test_publish_t" { } $t16 := $MakePtr(true, add($base_offset, 32)) } - // $t17 := borrow_field.s($t16) + // $t17 := borrow_field<0x2::M::T>.s($t16) /// @src 1:1683:1705 { $t17 := $MakePtr($IsStoragePtr($t16), $LoadU256($t16)) } - // $t18 := borrow_field.b($t17) + // $t18 := borrow_field<0x2::M::S>.b($t17) /// @src 1:1683:1707 $t18 := $IndexPtr($t17, 40) // $t19 := read_ref($t18) @@ -1094,7 +1094,7 @@ object "test_A2_M_test_publish_t" { // $t23 := 0x3 /// @src 1:1754:1756 $t23 := 0x3 - // $t24 := borrow_global($t23) + // $t24 := borrow_global<0x2::M::T>($t23) /// @src 1:1737:1750 { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t23) @@ -1103,17 +1103,17 @@ object "test_A2_M_test_publish_t" { } $t24 := $MakePtr(true, add($base_offset, 32)) } - // $t25 := borrow_field.s($t24) + // $t25 := borrow_field<0x2::M::T>.s($t24) /// @src 1:1737:1759 { $t25 := $MakePtr($IsStoragePtr($t24), $LoadU256($t24)) } - // $t26 := borrow_field.c($t25) + // $t26 := borrow_field<0x2::M::S>.c($t25) /// @src 1:1737:1761 { $t26 := $MakePtr($IsStoragePtr($t25), $LoadU256($t25)) } - // $t27 := borrow_field.x($t26) + // $t27 := borrow_field<0x2::M::S2>.x($t26) /// @src 1:1737:1763 $t27 := $t26 // $t28 := read_ref($t27) @@ -1173,14 +1173,14 @@ object "test_A2_M_test_publish_t" { // $t7 := (u128)($t6) /// @src 1:1434:1451 $t7 := $CastU128($t6) - // $t8 := pack M::S2($t7) + // $t8 := pack 0x2::M::S2($t7) /// @src 1:1428:1452 { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), $t7) $t8 := $mem } - // $t9 := pack M::S($t1, $t5, $t8) + // $t9 := pack 0x2::M::S($t1, $t5, $t8) /// @src 1:1400:1453 { let $mem := $Malloc(41) @@ -1189,14 +1189,14 @@ object "test_A2_M_test_publish_t" { $MemoryStoreU256(add($mem, 0), $t8) $t9 := $mem } - // $t10 := pack M::T($t9) + // $t10 := pack 0x2::M::T($t9) /// @src 1:1393:1454 { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t9) $t10 := $mem } - // move_to($t10, $t0) + // move_to<0x2::M::T>($t10, $t0) /// @src 1:1464:1471 { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $LoadU256(sg)) @@ -1491,13 +1491,13 @@ object "test_A2_M_test_unpublish" { // $t7 := M::unpublish($t6) /// @src 1:931:944 $t7 := A2_M_unpublish($t6) - // ($t8, $t9, $t10) := unpack M::S($t7) + // ($t8, $t9, $t10) := unpack 0x2::M::S($t7) /// @src 1:911:928 $t8 := $MemoryLoadU64(add($t7, 32)) $t9 := $MemoryLoadU8(add($t7, 40)) $t10 := $MemoryLoadU256(add($t7, 0)) $Free($t7, 41) - // $t11 := unpack M::S2($t10) + // $t11 := unpack 0x2::M::S2($t10) /// @src 1:922:927 $t11 := $MemoryLoadU128(add($t10, 0)) $Free($t10, 16) @@ -1583,7 +1583,7 @@ object "test_A2_M_test_unpublish" { function A2_M_unpublish(a) -> $result { let $t1 - // $t1 := move_from($t0) + // $t1 := move_from<0x2::M::S>($t0) /// @src 1:793:802 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, a) @@ -1631,14 +1631,14 @@ object "test_A2_M_test_unpublish" { // $t7 := (u128)($t6) /// @src 1:405:422 $t7 := $CastU128($t6) - // $t8 := pack M::S2($t7) + // $t8 := pack 0x2::M::S2($t7) /// @src 1:399:423 { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), $t7) $t8 := $mem } - // $t9 := pack M::S($t1, $t5, $t8) + // $t9 := pack 0x2::M::S($t1, $t5, $t8) /// @src 1:371:424 { let $mem := $Malloc(41) @@ -1647,7 +1647,7 @@ object "test_A2_M_test_unpublish" { $MemoryStoreU256(add($mem, 0), $t8) $t9 := $mem } - // move_to($t9, $t0) + // move_to<0x2::M::S>($t9, $t0) /// @src 1:434:441 { let $base_offset := $MakeTypeStorageBase(0, 0x698265eb, $LoadU256(sg)) diff --git a/third_party/move/evm/move-to-yul/tests/Structs.v2_exp b/third_party/move/evm/move-to-yul/tests/Structs.v2_exp index d79871424ed16..078aae2d530ec 100644 --- a/third_party/move/evm/move-to-yul/tests/Structs.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/Structs.v2_exp @@ -54,7 +54,7 @@ object "test_A2_M_test_drop" { $t1 := false // $t2 := M::pack_S($t0, $t1) $t2 := A2_M_pack_S($t0, $t1) - // $t3 := pack M::S3($t2) + // $t3 := pack 0x2::M::S3($t2) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t2) @@ -79,7 +79,7 @@ object "test_A2_M_test_drop" { $t2 := $CastU128(a) // $t3 := M::pack_S2($t2) $t3 := A2_M_pack_S2($t2) - // $t4 := pack M::S($t0, $t1, $t3) + // $t4 := pack 0x2::M::S($t0, $t1, $t3) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -93,7 +93,7 @@ object "test_A2_M_test_drop" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) @@ -330,7 +330,7 @@ object "test_A2_M_test_equality" { $t2 := $CastU128(a) // $t3 := M::pack_S2($t2) $t3 := A2_M_pack_S2($t2) - // $t4 := pack M::S($t0, $t1, $t3) + // $t4 := pack 0x2::M::S($t0, $t1, $t3) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -344,7 +344,7 @@ object "test_A2_M_test_equality" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) @@ -460,7 +460,7 @@ object "test_A2_M_test_pack_S" { s := A2_M_pack_S($t1, $t2) // $t3 := borrow_local($t0) $t3 := $MakePtr(false, s) - // $t4 := borrow_field.a($t3) + // $t4 := borrow_field<0x2::M::S>.a($t3) $t4 := $IndexPtr($t3, 32) // $t5 := read_ref($t4) $t5 := $LoadU64($t4) @@ -477,7 +477,7 @@ object "test_A2_M_test_pack_S" { // label L2 // $t9 := borrow_local($t0) $t9 := $MakePtr(false, s) - // $t10 := borrow_field.b($t9) + // $t10 := borrow_field<0x2::M::S>.b($t9) $t10 := $IndexPtr($t9, 40) // $t11 := read_ref($t10) $t11 := $LoadU8($t10) @@ -506,11 +506,11 @@ object "test_A2_M_test_pack_S" { // label L5 // $t15 := borrow_local($t0) $t15 := $MakePtr(false, s) - // $t16 := borrow_field.c($t15) + // $t16 := borrow_field<0x2::M::S>.c($t15) { $t16 := $MakePtr($IsStoragePtr($t15), $LoadU256($t15)) } - // $t17 := borrow_field.x($t16) + // $t17 := borrow_field<0x2::M::S2>.x($t16) $t17 := $t16 // $t18 := read_ref($t17) $t18 := $LoadU128($t17) @@ -549,7 +549,7 @@ object "test_A2_M_test_pack_S" { $t2 := $CastU128(a) // $t3 := M::pack_S2($t2) $t3 := A2_M_pack_S2($t2) - // $t4 := pack M::S($t0, $t1, $t3) + // $t4 := pack 0x2::M::S($t0, $t1, $t3) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -563,7 +563,7 @@ object "test_A2_M_test_pack_S" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) @@ -780,7 +780,7 @@ object "test_A2_M_test_pack_S2" { s := A2_M_pack_S2($t1) // $t2 := borrow_local($t0) $t2 := $MakePtr(false, s) - // $t3 := borrow_field.x($t2) + // $t3 := borrow_field<0x2::M::S2>.x($t2) $t3 := $t2 // $t4 := read_ref($t3) $t4 := $LoadU128($t3) @@ -803,7 +803,7 @@ object "test_A2_M_test_pack_S2" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) @@ -952,7 +952,7 @@ object "test_A2_M_test_pack_S2_fail" { s := A2_M_pack_S2($t1) // $t2 := borrow_local($t0) $t2 := $MakePtr(false, s) - // $t3 := borrow_field.x($t2) + // $t3 := borrow_field<0x2::M::S2>.x($t2) $t3 := $t2 // $t4 := read_ref($t3) $t4 := $LoadU128($t3) @@ -975,7 +975,7 @@ object "test_A2_M_test_pack_S2_fail" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) @@ -1147,15 +1147,15 @@ object "test_A2_M_test_read_S" { function A2_M_read_S(s) -> $result { let $t1, $t2, $t3, $t4, $t5, $t6, $t7 - // $t1 := borrow_field.a($t0) + // $t1 := borrow_field<0x2::M::S>.a($t0) $t1 := $IndexPtr(s, 32) // $t2 := read_ref($t1) $t2 := $LoadU64($t1) - // $t3 := borrow_field.c($t0) + // $t3 := borrow_field<0x2::M::S>.c($t0) { $t3 := $MakePtr($IsStoragePtr(s), $LoadU256(s)) } - // $t4 := borrow_field.x($t3) + // $t4 := borrow_field<0x2::M::S2>.x($t3) $t4 := $t3 // $t5 := read_ref($t4) $t5 := $LoadU128($t4) @@ -1173,7 +1173,7 @@ object "test_A2_M_test_read_S" { $t2 := $CastU128(a) // $t3 := M::pack_S2($t2) $t3 := A2_M_pack_S2($t2) - // $t4 := pack M::S($t0, $t1, $t3) + // $t4 := pack 0x2::M::S($t0, $t1, $t3) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -1187,7 +1187,7 @@ object "test_A2_M_test_read_S" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) @@ -1394,7 +1394,7 @@ object "test_A2_M_test_read_and_write_S" { s := A2_M_read_and_write_S() // $t1 := borrow_local($t0) $t1 := $MakePtr(false, s) - // $t2 := borrow_field.a($t1) + // $t2 := borrow_field<0x2::M::S>.a($t1) $t2 := $IndexPtr($t1, 32) // $t3 := read_ref($t2) $t3 := $LoadU64($t2) @@ -1411,11 +1411,11 @@ object "test_A2_M_test_read_and_write_S" { // label L2 // $t7 := borrow_local($t0) $t7 := $MakePtr(false, s) - // $t8 := borrow_field.c($t7) + // $t8 := borrow_field<0x2::M::S>.c($t7) { $t8 := $MakePtr($IsStoragePtr($t7), $LoadU256($t7)) } - // $t9 := borrow_field.x($t8) + // $t9 := borrow_field<0x2::M::S2>.x($t8) $t9 := $t8 // $t10 := read_ref($t9) $t10 := $LoadU128($t9) @@ -1472,21 +1472,21 @@ object "test_A2_M_test_read_and_write_S" { function A2_M_write_S(s, v) { let $t2, $t3, $t4, $t5, $t6, $t7 - // $t2 := borrow_field.a($t0) + // $t2 := borrow_field<0x2::M::S>.a($t0) $t2 := $IndexPtr(s, 32) // write_ref($t2, $t1) $StoreU64($t2, v) - // $t3 := borrow_field.a($t0) + // $t3 := borrow_field<0x2::M::S>.a($t0) $t3 := $IndexPtr(s, 32) // $t4 := read_ref($t3) $t4 := $LoadU64($t3) // $t5 := (u128)($t4) $t5 := $CastU128($t4) - // $t6 := borrow_field.c($t0) + // $t6 := borrow_field<0x2::M::S>.c($t0) { $t6 := $MakePtr($IsStoragePtr(s), $LoadU256(s)) } - // $t7 := borrow_field.x($t6) + // $t7 := borrow_field<0x2::M::S2>.x($t6) $t7 := $t6 // write_ref($t7, $t5) $StoreU128($t7, $t5) @@ -1495,15 +1495,15 @@ object "test_A2_M_test_read_and_write_S" { function A2_M_read_S(s) -> $result { let $t1, $t2, $t3, $t4, $t5, $t6, $t7 - // $t1 := borrow_field.a($t0) + // $t1 := borrow_field<0x2::M::S>.a($t0) $t1 := $IndexPtr(s, 32) // $t2 := read_ref($t1) $t2 := $LoadU64($t1) - // $t3 := borrow_field.c($t0) + // $t3 := borrow_field<0x2::M::S>.c($t0) { $t3 := $MakePtr($IsStoragePtr(s), $LoadU256(s)) } - // $t4 := borrow_field.x($t3) + // $t4 := borrow_field<0x2::M::S2>.x($t3) $t4 := $t3 // $t5 := read_ref($t4) $t5 := $LoadU128($t4) @@ -1521,7 +1521,7 @@ object "test_A2_M_test_read_and_write_S" { $t2 := $CastU128(a) // $t3 := M::pack_S2($t2) $t3 := A2_M_pack_S2($t2) - // $t4 := pack M::S($t0, $t1, $t3) + // $t4 := pack 0x2::M::S($t0, $t1, $t3) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -1535,7 +1535,7 @@ object "test_A2_M_test_read_and_write_S" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) @@ -1800,7 +1800,7 @@ object "test_A2_M_test_unpack" { s1 := A2_M_unpack($t3) // $t4 := borrow_local($t0) $t4 := $MakePtr(false, s1) - // $t5 := borrow_field.x($t4) + // $t5 := borrow_field<0x2::M::S2>.x($t4) $t5 := $t4 // $t6 := read_ref($t5) $t6 := $LoadU128($t5) @@ -1823,7 +1823,7 @@ object "test_A2_M_test_unpack" { function A2_M_unpack(s) -> $result { let c, $t2, $t3, $t4 - // ($t2, $t3, $t4) := unpack M::S($t0) + // ($t2, $t3, $t4) := unpack 0x2::M::S($t0) $t2 := $MemoryLoadU64(add(s, 32)) $t3 := $MemoryLoadU8(add(s, 40)) $t4 := $MemoryLoadU256(add(s, 0)) @@ -1840,7 +1840,7 @@ object "test_A2_M_test_unpack" { $t2 := $CastU128(a) // $t3 := M::pack_S2($t2) $t3 := A2_M_pack_S2($t2) - // $t4 := pack M::S($t0, $t1, $t3) + // $t4 := pack 0x2::M::S($t0, $t1, $t3) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -1854,7 +1854,7 @@ object "test_A2_M_test_unpack" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) @@ -2039,7 +2039,7 @@ object "test_A2_M_test_write_S" { A2_M_write_S($t3, $t4) // $t5 := borrow_local($t0) $t5 := $MakePtr(false, s) - // $t6 := borrow_field.a($t5) + // $t6 := borrow_field<0x2::M::S>.a($t5) $t6 := $IndexPtr($t5, 32) // $t7 := read_ref($t6) $t7 := $LoadU64($t6) @@ -2056,11 +2056,11 @@ object "test_A2_M_test_write_S" { // label L2 // $t11 := borrow_local($t0) $t11 := $MakePtr(false, s) - // $t12 := borrow_field.c($t11) + // $t12 := borrow_field<0x2::M::S>.c($t11) { $t12 := $MakePtr($IsStoragePtr($t11), $LoadU256($t11)) } - // $t13 := borrow_field.x($t12) + // $t13 := borrow_field<0x2::M::S2>.x($t12) $t13 := $t12 // $t14 := read_ref($t13) $t14 := $LoadU128($t13) @@ -2095,21 +2095,21 @@ object "test_A2_M_test_write_S" { function A2_M_write_S(s, v) { let $t2, $t3, $t4, $t5, $t6, $t7 - // $t2 := borrow_field.a($t0) + // $t2 := borrow_field<0x2::M::S>.a($t0) $t2 := $IndexPtr(s, 32) // write_ref($t2, $t1) $StoreU64($t2, v) - // $t3 := borrow_field.a($t0) + // $t3 := borrow_field<0x2::M::S>.a($t0) $t3 := $IndexPtr(s, 32) // $t4 := read_ref($t3) $t4 := $LoadU64($t3) // $t5 := (u128)($t4) $t5 := $CastU128($t4) - // $t6 := borrow_field.c($t0) + // $t6 := borrow_field<0x2::M::S>.c($t0) { $t6 := $MakePtr($IsStoragePtr(s), $LoadU256(s)) } - // $t7 := borrow_field.x($t6) + // $t7 := borrow_field<0x2::M::S2>.x($t6) $t7 := $t6 // write_ref($t7, $t5) $StoreU128($t7, $t5) @@ -2122,7 +2122,7 @@ object "test_A2_M_test_write_S" { $t2 := $CastU128(a) // $t3 := M::pack_S2($t2) $t3 := A2_M_pack_S2($t2) - // $t4 := pack M::S($t0, $t1, $t3) + // $t4 := pack 0x2::M::S($t0, $t1, $t3) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -2136,7 +2136,7 @@ object "test_A2_M_test_write_S" { function A2_M_pack_S2(x) -> $result { let $t1 - // $t1 := pack M::S2($t0) + // $t1 := pack 0x2::M::S2($t0) { let $mem := $Malloc(16) $MemoryStoreU128(add($mem, 0), x) diff --git a/third_party/move/evm/move-to-yul/tests/Tables.v2_exp b/third_party/move/evm/move-to-yul/tests/Tables.v2_exp index f6ce37ffea2a9..04a2ed965d8c1 100644 --- a/third_party/move/evm/move-to-yul/tests/Tables.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/Tables.v2_exp @@ -108,13 +108,13 @@ object "test_A2_Tables_test_borrow_fail" { $t19 := $MakePtr(false, add($locals, 96)) // $t20 := move($t6) $t20 := mload($locals) - // $t21 := pack Tables::S($t20) + // $t21 := pack 0x2::Tables::S($t20) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t20) $t21 := $mem } - // move_to>($t21, $t19) + // move_to<0x2::Tables::S>($t21, $t19) { let $base_offset := $MakeTypeStorageBase(0, 0x8a475b1c, $LoadU256($t19)) if $AlignedStorageLoad($base_offset) { @@ -456,13 +456,13 @@ object "test_A2_Tables_test_insert_fail" { $t30 := $MakePtr(false, add($locals, 160)) // $t31 := move($t9) $t31 := mload($locals) - // $t32 := pack Tables::S($t31) + // $t32 := pack 0x2::Tables::S($t31) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t31) $t32 := $mem } - // move_to>($t32, $t30) + // move_to<0x2::Tables::S>($t32, $t30) { let $base_offset := $MakeTypeStorageBase(0, 0x8a475b1c, $LoadU256($t30)) if $AlignedStorageLoad($base_offset) { @@ -1022,13 +1022,13 @@ object "test_A2_Tables_test_primitive" { $t98 := $MakePtr(false, add($locals, 384)) // $t99 := move($t31) $t99 := mload($locals) - // $t100 := pack Tables::S($t99) + // $t100 := pack 0x2::Tables::S($t99) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t99) $t100 := $mem } - // move_to>($t100, $t98) + // move_to<0x2::Tables::S>($t100, $t98) { let $base_offset := $MakeTypeStorageBase(0, 0x8a475b1c, $LoadU256($t98)) if $AlignedStorageLoad($base_offset) { @@ -1044,7 +1044,7 @@ object "test_A2_Tables_test_primitive" { } // $t101 := 0x42 $t101 := 0x42 - // $t102 := borrow_global>($t101) + // $t102 := borrow_global<0x2::Tables::S>($t101) { let $base_offset := $MakeTypeStorageBase(0, 0x8a475b1c, $t101) if iszero($AlignedStorageLoad($base_offset)) { @@ -1052,7 +1052,7 @@ object "test_A2_Tables_test_primitive" { } $t102 := $MakePtr(true, add($base_offset, 32)) } - // $t103 := borrow_field>.t($t102) + // $t103 := borrow_field<0x2::Tables::S>.t($t102) $t103 := $t102 // $t104 := 42 $t104 := 42 @@ -1119,7 +1119,7 @@ object "test_A2_Tables_test_primitive" { // label L32 // $t116 := 0x42 $t116 := 0x42 - // $t117 := move_from>($t116) + // $t117 := move_from<0x2::Tables::S>($t116) { let $base_offset := $MakeTypeStorageBase(0, 0x8a475b1c, $t116) if iszero($AlignedStorageLoad($base_offset)) { @@ -1135,7 +1135,7 @@ object "test_A2_Tables_test_primitive" { $t117 := $dst } } - // $t30 := unpack Tables::S($t117) + // $t30 := unpack 0x2::Tables::S($t117) mstore(add($locals, 480), $MemoryLoadU256(add($t117, 0))) $Free($t117, 32) // $t118 := borrow_local($t30) @@ -1181,13 +1181,13 @@ object "test_A2_Tables_test_primitive" { $t127 := $MakePtr(false, add($locals, 544)) // $t128 := move($t30) $t128 := mload(add($locals, 480)) - // $t129 := pack Tables::S($t128) + // $t129 := pack 0x2::Tables::S($t128) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t128) $t129 := $mem } - // move_to>($t129, $t127) + // move_to<0x2::Tables::S>($t129, $t127) { let $base_offset := $MakeTypeStorageBase(0, 0x8a475b1c, $LoadU256($t127)) if $AlignedStorageLoad($base_offset) { @@ -1483,7 +1483,7 @@ object "test_A2_Tables_test_remove_fail" { $Abort($t11) } case 4 { - // $t3 := Table::empty() + // $t3 := Table::empty() mstore($locals, A2_Table_empty$u64_A2_Tables_Balance$()) // $t4 := borrow_local($t3) $t4 := $MakePtr(false, $locals) @@ -1493,9 +1493,9 @@ object "test_A2_Tables_test_remove_fail" { mstore(add($locals, 32), $t5) // $t6 := borrow_local($t0) $t6 := $MakePtr(false, add($locals, 56)) - // $t7 := Table::remove($t4, $t6) + // $t7 := Table::remove($t4, $t6) $t7 := A2_Table_remove$u64_A2_Tables_Balance$($t4, $t6) - // $t8 := unpack Tables::Balance($t7) + // $t8 := unpack 0x2::Tables::Balance($t7) $t8 := $MemoryLoadU256(add($t7, 0)) $Free($t7, 32) // $t9 := U256::zero() @@ -1517,13 +1517,13 @@ object "test_A2_Tables_test_remove_fail" { $t13 := $MakePtr(false, add($locals, 64)) // $t14 := move($t3) $t14 := mload($locals) - // $t15 := pack Tables::S($t14) + // $t15 := pack 0x2::Tables::S($t14) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t14) $t15 := $mem } - // move_to>($t15, $t13) + // move_to<0x2::Tables::S>($t15, $t13) { let $base_offset := $MakeTypeStorageBase(0, 0x6f98bffd, $LoadU256($t13)) if $AlignedStorageLoad($base_offset) { @@ -1749,7 +1749,7 @@ object "test_A2_Tables_test_struct" { $Abort($t40) } case 4 { - // $t27 := Table::empty() + // $t27 := Table::empty() mstore($locals, A2_Table_empty$address_A2_Tables_Balance$()) // $t30 := 3743106036130323098097120681749450326028 $t30 := 3743106036130323098097120681749450326028 @@ -1763,13 +1763,13 @@ object "test_A2_Tables_test_struct" { mstore(add($locals, 32), $t33) // $t34 := borrow_local($t0) $t34 := $MakePtr(false, add($locals, 32)) - // $t35 := pack Tables::Balance($t30) + // $t35 := pack 0x2::Tables::Balance($t30) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t30) $t35 := $mem } - // Table::insert($t32, $t34, $t35) + // Table::insert($t32, $t34, $t35) A2_Table_insert$address_A2_Tables_Balance$($t32, $t34, $t35) // $t36 := borrow_local($t27) $t36 := $MakePtr(false, $locals) @@ -1779,7 +1779,7 @@ object "test_A2_Tables_test_struct" { mstore(add($locals, 64), $t37) // $t38 := borrow_local($t18) $t38 := $MakePtr(false, add($locals, 64)) - // $t39 := Table::contains($t36, $t38) + // $t39 := Table::contains($t36, $t38) $t39 := A2_Table_contains$address_A2_Tables_Balance$($t36, $t38) // if ($t39) goto L1 else goto L0 switch $t39 @@ -1796,9 +1796,9 @@ object "test_A2_Tables_test_struct" { mstore(add($locals, 96), $t42) // $t43 := borrow_local($t20) $t43 := $MakePtr(false, add($locals, 96)) - // $t44 := Table::borrow($t41, $t43) + // $t44 := Table::borrow($t41, $t43) $t44 := A2_Table_borrow$address_A2_Tables_Balance$($t41, $t43) - // $t45 := borrow_field.value($t44) + // $t45 := borrow_field<0x2::Tables::Balance>.value($t44) $t45 := $t44 // $t46 := read_ref($t45) $t46 := $LoadU256($t45) @@ -1831,13 +1831,13 @@ object "test_A2_Tables_test_struct" { $t50 := $MakePtr(false, add($locals, 128)) // $t51 := move($t27) $t51 := mload($locals) - // $t52 := pack Tables::S($t51) + // $t52 := pack 0x2::Tables::S($t51) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t51) $t52 := $mem } - // move_to>($t52, $t50) + // move_to<0x2::Tables::S>($t52, $t50) { let $base_offset := $MakeTypeStorageBase(0, 0x7dd56ec3, $LoadU256($t50)) if $AlignedStorageLoad($base_offset) { @@ -1853,7 +1853,7 @@ object "test_A2_Tables_test_struct" { } // $t53 := 0x42 $t53 := 0x42 - // $t54 := borrow_global>($t53) + // $t54 := borrow_global<0x2::Tables::S>($t53) { let $base_offset := $MakeTypeStorageBase(0, 0x7dd56ec3, $t53) if iszero($AlignedStorageLoad($base_offset)) { @@ -1861,7 +1861,7 @@ object "test_A2_Tables_test_struct" { } $t54 := $MakePtr(true, add($base_offset, 32)) } - // $t55 := borrow_field>.t($t54) + // $t55 := borrow_field<0x2::Tables::S>.t($t54) $t55 := $t54 // $t56 := 0xcd $t56 := 0xcd @@ -1869,13 +1869,13 @@ object "test_A2_Tables_test_struct" { mstore(add($locals, 160), $t56) // $t57 := borrow_local($t23) $t57 := $MakePtr(false, add($locals, 160)) - // $t58 := pack Tables::Balance($t31) + // $t58 := pack 0x2::Tables::Balance($t31) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t31) $t58 := $mem } - // Table::insert($t55, $t57, $t58) + // Table::insert($t55, $t57, $t58) A2_Table_insert$address_A2_Tables_Balance$($t55, $t57, $t58) // $t59 := 0xab $t59 := 0xab @@ -1885,9 +1885,9 @@ object "test_A2_Tables_test_struct" { $t60 := $MakePtr(false, add($locals, 192)) // $t61 := freeze_ref($t55) $t61 := $t55 - // $t62 := Table::borrow($t61, $t60) + // $t62 := Table::borrow($t61, $t60) $t62 := A2_Table_borrow$address_A2_Tables_Balance$($t61, $t60) - // $t63 := borrow_field.value($t62) + // $t63 := borrow_field<0x2::Tables::Balance>.value($t62) $t63 := $t62 // $t64 := read_ref($t63) $t64 := $LoadU256($t63) @@ -1921,9 +1921,9 @@ object "test_A2_Tables_test_struct" { $t68 := $MakePtr(false, add($locals, 224)) // $t69 := freeze_ref($t55) $t69 := $t55 - // $t70 := Table::borrow($t69, $t68) + // $t70 := Table::borrow($t69, $t68) $t70 := A2_Table_borrow$address_A2_Tables_Balance$($t69, $t68) - // $t71 := borrow_field.value($t70) + // $t71 := borrow_field<0x2::Tables::Balance>.value($t70) $t71 := $t70 // $t72 := read_ref($t71) $t72 := $LoadU256($t71) @@ -1955,9 +1955,9 @@ object "test_A2_Tables_test_struct" { mstore(add($locals, 256), $t75) // $t76 := borrow_local($t7) $t76 := $MakePtr(false, add($locals, 256)) - // $t77 := Table::borrow_mut($t55, $t76) + // $t77 := Table::borrow_mut($t55, $t76) $t77 := A2_Table_borrow_mut$address_A2_Tables_Balance$($t55, $t76) - // $t78 := borrow_field.value($t77) + // $t78 := borrow_field<0x2::Tables::Balance>.value($t77) $t78 := $t77 // $t79 := read_ref($t78) $t79 := $LoadU256($t78) @@ -1965,7 +1965,7 @@ object "test_A2_Tables_test_struct" { $t80 := A2_U256_one() // $t81 := -($t79, $t80) $t81 := $Sub($t79, $t80) - // $t82 := borrow_field.value($t77) + // $t82 := borrow_field<0x2::Tables::Balance>.value($t77) $t82 := $t77 // write_ref($t82, $t81) $StoreU256($t82, $t81) @@ -1977,9 +1977,9 @@ object "test_A2_Tables_test_struct" { $t84 := $MakePtr(false, add($locals, 288)) // $t85 := freeze_ref($t55) $t85 := $t55 - // $t86 := Table::borrow($t85, $t84) + // $t86 := Table::borrow($t85, $t84) $t86 := A2_Table_borrow$address_A2_Tables_Balance$($t85, $t84) - // $t87 := borrow_field.value($t86) + // $t87 := borrow_field<0x2::Tables::Balance>.value($t86) $t87 := $t86 // $t88 := read_ref($t87) $t88 := $LoadU256($t87) @@ -2013,9 +2013,9 @@ object "test_A2_Tables_test_struct" { mstore(add($locals, 320), $t92) // $t93 := borrow_local($t13) $t93 := $MakePtr(false, add($locals, 320)) - // $t94 := Table::remove($t55, $t93) + // $t94 := Table::remove($t55, $t93) $t94 := A2_Table_remove$address_A2_Tables_Balance$($t55, $t93) - // $t95 := unpack Tables::Balance($t94) + // $t95 := unpack 0x2::Tables::Balance($t94) $t95 := $MemoryLoadU256(add($t94, 0)) $Free($t94, 32) // $t96 := ==($t95, $t30) @@ -2048,7 +2048,7 @@ object "test_A2_Tables_test_struct" { $t99 := $MakePtr(false, add($locals, 352)) // $t100 := freeze_ref($t55) $t100 := $t55 - // $t101 := Table::contains($t100, $t99) + // $t101 := Table::contains($t100, $t99) $t101 := A2_Table_contains$address_A2_Tables_Balance$($t100, $t99) // $t102 := !($t101) $t102 := $LogicalNot($t101) @@ -2356,7 +2356,7 @@ object "test_A2_Tables_test_table_of_tables" { $Abort($t75) } case 4 { - // $t45 := Table::empty>() + // $t45 := Table::empty>() mstore(add($locals, 128), A2_Table_empty$address_A2_Table_Table$address_A2_U256_U256$$()) // $t51 := 3743106036130323098097120681749450326028 $t51 := 3743106036130323098097120681749450326028 @@ -2364,7 +2364,7 @@ object "test_A2_Tables_test_table_of_tables" { $t52 := 15312706511442230855851857334429569515566 // $t53 := 26542024619833200150143219379677920493647 $t53 := 26542024619833200150143219379677920493647 - // $t46 := Table::empty() + // $t46 := Table::empty() mstore($locals, A2_Table_empty$address_A2_U256_U256$()) // $t54 := borrow_local($t46) $t54 := $MakePtr(false, $locals) @@ -2374,9 +2374,9 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 32), $t55) // $t56 := borrow_local($t0) $t56 := $MakePtr(false, add($locals, 32)) - // Table::insert($t54, $t56, $t51) + // Table::insert($t54, $t56, $t51) A2_Table_insert$address_A2_U256_U256$($t54, $t56, $t51) - // $t47 := Table::empty() + // $t47 := Table::empty() mstore(add($locals, 64), A2_Table_empty$address_A2_U256_U256$()) // $t57 := borrow_local($t47) $t57 := $MakePtr(false, add($locals, 64)) @@ -2386,7 +2386,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 96), $t58) // $t59 := borrow_local($t22) $t59 := $MakePtr(false, add($locals, 96)) - // Table::insert($t57, $t59, $t52) + // Table::insert($t57, $t59, $t52) A2_Table_insert$address_A2_U256_U256$($t57, $t59, $t52) // $t60 := borrow_local($t45) $t60 := $MakePtr(false, add($locals, 128)) @@ -2398,7 +2398,7 @@ object "test_A2_Tables_test_table_of_tables" { $t62 := $MakePtr(false, add($locals, 160)) // $t63 := move($t46) $t63 := mload($locals) - // Table::insert>($t60, $t62, $t63) + // Table::insert>($t60, $t62, $t63) A2_Table_insert$address_A2_Table_Table$address_A2_U256_U256$$($t60, $t62, $t63) // $t64 := borrow_local($t45) $t64 := $MakePtr(false, add($locals, 128)) @@ -2410,7 +2410,7 @@ object "test_A2_Tables_test_table_of_tables" { $t66 := $MakePtr(false, add($locals, 192)) // $t67 := move($t47) $t67 := mload(add($locals, 64)) - // Table::insert>($t64, $t66, $t67) + // Table::insert>($t64, $t66, $t67) A2_Table_insert$address_A2_Table_Table$address_A2_U256_U256$$($t64, $t66, $t67) // $t68 := borrow_local($t45) $t68 := $MakePtr(false, add($locals, 128)) @@ -2420,7 +2420,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 224), $t69) // $t70 := borrow_local($t1) $t70 := $MakePtr(false, add($locals, 224)) - // $t71 := Table::borrow>($t68, $t70) + // $t71 := Table::borrow>($t68, $t70) $t71 := A2_Table_borrow$address_A2_Table_Table$address_A2_U256_U256$$($t68, $t70) // $t72 := 0xab $t72 := 0xab @@ -2428,7 +2428,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 256), $t72) // $t73 := borrow_local($t44) $t73 := $MakePtr(false, add($locals, 256)) - // $t74 := Table::contains($t71, $t73) + // $t74 := Table::contains($t71, $t73) $t74 := A2_Table_contains$address_A2_U256_U256$($t71, $t73) // if ($t74) goto L1 else goto L0 switch $t74 @@ -2445,7 +2445,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 288), $t77) // $t78 := borrow_local($t5) $t78 := $MakePtr(false, add($locals, 288)) - // $t79 := Table::borrow>($t76, $t78) + // $t79 := Table::borrow>($t76, $t78) $t79 := A2_Table_borrow$address_A2_Table_Table$address_A2_U256_U256$$($t76, $t78) // $t80 := 0xcd $t80 := 0xcd @@ -2453,7 +2453,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 320), $t80) // $t81 := borrow_local($t4) $t81 := $MakePtr(false, add($locals, 320)) - // $t82 := Table::contains($t79, $t81) + // $t82 := Table::contains($t79, $t81) $t82 := A2_Table_contains$address_A2_U256_U256$($t79, $t81) // if ($t82) goto L4 else goto L3 switch $t82 @@ -2482,7 +2482,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 352), $t85) // $t86 := borrow_local($t9) $t86 := $MakePtr(false, add($locals, 352)) - // $t87 := Table::borrow>($t84, $t86) + // $t87 := Table::borrow>($t84, $t86) $t87 := A2_Table_borrow$address_A2_Table_Table$address_A2_U256_U256$$($t84, $t86) // $t88 := 0xab $t88 := 0xab @@ -2490,7 +2490,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 384), $t88) // $t89 := borrow_local($t8) $t89 := $MakePtr(false, add($locals, 384)) - // $t90 := Table::borrow($t87, $t89) + // $t90 := Table::borrow($t87, $t89) $t90 := A2_Table_borrow$address_A2_U256_U256$($t87, $t89) // $t91 := read_ref($t90) $t91 := $LoadU256($t90) @@ -2523,7 +2523,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 416), $t95) // $t96 := borrow_local($t14) $t96 := $MakePtr(false, add($locals, 416)) - // $t97 := Table::borrow>($t94, $t96) + // $t97 := Table::borrow>($t94, $t96) $t97 := A2_Table_borrow$address_A2_Table_Table$address_A2_U256_U256$$($t94, $t96) // $t98 := 0xcd $t98 := 0xcd @@ -2531,7 +2531,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 448), $t98) // $t99 := borrow_local($t13) $t99 := $MakePtr(false, add($locals, 448)) - // $t100 := Table::borrow($t97, $t99) + // $t100 := Table::borrow($t97, $t99) $t100 := A2_Table_borrow$address_A2_U256_U256$($t97, $t99) // $t101 := read_ref($t100) $t101 := $LoadU256($t100) @@ -2564,7 +2564,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 480), $t105) // $t106 := borrow_local($t18) $t106 := $MakePtr(false, add($locals, 480)) - // $t107 := Table::borrow_mut>($t104, $t106) + // $t107 := Table::borrow_mut>($t104, $t106) $t107 := A2_Table_borrow_mut$address_A2_Table_Table$address_A2_U256_U256$$($t104, $t106) // $t108 := 0xef $t108 := 0xef @@ -2572,7 +2572,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 512), $t108) // $t109 := borrow_local($t17) $t109 := $MakePtr(false, add($locals, 512)) - // Table::insert($t107, $t109, $t53) + // Table::insert($t107, $t109, $t53) A2_Table_insert$address_A2_U256_U256$($t107, $t109, $t53) // $t110 := borrow_local($t45) $t110 := $MakePtr(false, add($locals, 128)) @@ -2582,7 +2582,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 544), $t111) // $t112 := borrow_local($t23) $t112 := $MakePtr(false, add($locals, 544)) - // $t113 := Table::borrow>($t110, $t112) + // $t113 := Table::borrow>($t110, $t112) $t113 := A2_Table_borrow$address_A2_Table_Table$address_A2_U256_U256$$($t110, $t112) // $t114 := 0xef $t114 := 0xef @@ -2590,7 +2590,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 576), $t114) // $t115 := borrow_local($t21) $t115 := $MakePtr(false, add($locals, 576)) - // $t116 := Table::borrow($t113, $t115) + // $t116 := Table::borrow($t113, $t115) $t116 := A2_Table_borrow$address_A2_U256_U256$($t113, $t115) // $t117 := read_ref($t116) $t117 := $LoadU256($t116) @@ -2623,7 +2623,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 608), $t121) // $t122 := borrow_local($t27) $t122 := $MakePtr(false, add($locals, 608)) - // $t123 := Table::borrow>($t120, $t122) + // $t123 := Table::borrow>($t120, $t122) $t123 := A2_Table_borrow$address_A2_Table_Table$address_A2_U256_U256$$($t120, $t122) // $t124 := 0xab $t124 := 0xab @@ -2631,7 +2631,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 640), $t124) // $t125 := borrow_local($t26) $t125 := $MakePtr(false, add($locals, 640)) - // $t126 := Table::borrow($t123, $t125) + // $t126 := Table::borrow($t123, $t125) $t126 := A2_Table_borrow$address_A2_U256_U256$($t123, $t125) // $t127 := read_ref($t126) $t127 := $LoadU256($t126) @@ -2664,7 +2664,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 672), $t131) // $t132 := borrow_local($t31) $t132 := $MakePtr(false, add($locals, 672)) - // $t133 := Table::borrow_mut>($t130, $t132) + // $t133 := Table::borrow_mut>($t130, $t132) $t133 := A2_Table_borrow_mut$address_A2_Table_Table$address_A2_U256_U256$$($t130, $t132) // $t134 := 0xcd $t134 := 0xcd @@ -2672,7 +2672,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 704), $t134) // $t135 := borrow_local($t30) $t135 := $MakePtr(false, add($locals, 704)) - // $t136 := Table::remove($t133, $t135) + // $t136 := Table::remove($t133, $t135) $t136 := A2_Table_remove$address_A2_U256_U256$($t133, $t135) // $t137 := ==($t136, $t52) $t137 := $Eq($t136, $t52) @@ -2703,7 +2703,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 736), $t140) // $t141 := borrow_local($t36) $t141 := $MakePtr(false, add($locals, 736)) - // $t142 := Table::borrow>($t139, $t141) + // $t142 := Table::borrow>($t139, $t141) $t142 := A2_Table_borrow$address_A2_Table_Table$address_A2_U256_U256$$($t139, $t141) // $t143 := 0xcd $t143 := 0xcd @@ -2711,7 +2711,7 @@ object "test_A2_Tables_test_table_of_tables" { mstore(add($locals, 768), $t143) // $t144 := borrow_local($t35) $t144 := $MakePtr(false, add($locals, 768)) - // $t145 := Table::contains($t142, $t144) + // $t145 := Table::contains($t142, $t144) $t145 := A2_Table_contains$address_A2_U256_U256$($t142, $t144) // $t146 := !($t145) $t146 := $LogicalNot($t145) @@ -2742,13 +2742,13 @@ object "test_A2_Tables_test_table_of_tables" { $t149 := $MakePtr(false, add($locals, 800)) // $t150 := move($t45) $t150 := mload(add($locals, 128)) - // $t151 := pack Tables::S>($t150) + // $t151 := pack 0x2::Tables::S>($t150) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t150) $t151 := $mem } - // move_to>>($t151, $t149) + // move_to<0x2::Tables::S>>($t151, $t149) { let $base_offset := $MakeTypeStorageBase(0, 0xc5110c9a, $LoadU256($t149)) if $AlignedStorageLoad($base_offset) { @@ -3047,7 +3047,7 @@ object "test_A2_Tables_test_u256" { $Abort($t14) } case 4 { - // $t3 := Table::empty() + // $t3 := Table::empty<0x2::U256::U256, 0x2::U256::U256>() mstore($locals, A2_Table_empty$A2_U256_U256_A2_U256_U256$()) // $t6 := 26542024619833200150143219379677920493647 $t6 := 26542024619833200150143219379677920493647 @@ -3061,13 +3061,13 @@ object "test_A2_Tables_test_u256" { $t9 := $MakePtr(false, $locals) // $t10 := borrow_local($t2) $t10 := $MakePtr(false, add($locals, 32)) - // Table::insert($t9, $t10, $t7) + // Table::insert<0x2::U256::U256, 0x2::U256::U256>($t9, $t10, $t7) A2_Table_insert$A2_U256_U256_A2_U256_U256$($t9, $t10, $t7) // $t11 := borrow_local($t3) $t11 := $MakePtr(false, $locals) // $t12 := borrow_local($t2) $t12 := $MakePtr(false, add($locals, 32)) - // $t13 := Table::contains($t11, $t12) + // $t13 := Table::contains<0x2::U256::U256, 0x2::U256::U256>($t11, $t12) $t13 := A2_Table_contains$A2_U256_U256_A2_U256_U256$($t11, $t12) // if ($t13) goto L1 else goto L0 switch $t13 @@ -3080,7 +3080,7 @@ object "test_A2_Tables_test_u256" { $t15 := $MakePtr(false, $locals) // $t16 := borrow_local($t2) $t16 := $MakePtr(false, add($locals, 32)) - // $t17 := Table::borrow($t15, $t16) + // $t17 := Table::borrow<0x2::U256::U256, 0x2::U256::U256>($t15, $t16) $t17 := A2_Table_borrow$A2_U256_U256_A2_U256_U256$($t15, $t16) // $t18 := read_ref($t17) $t18 := $LoadU256($t17) @@ -3111,7 +3111,7 @@ object "test_A2_Tables_test_u256" { $t22 := $MakePtr(false, $locals) // $t23 := borrow_local($t2) $t23 := $MakePtr(false, add($locals, 32)) - // $t24 := Table::borrow_mut($t22, $t23) + // $t24 := Table::borrow_mut<0x2::U256::U256, 0x2::U256::U256>($t22, $t23) $t24 := A2_Table_borrow_mut$A2_U256_U256_A2_U256_U256$($t22, $t23) // write_ref($t24, $t8) $StoreU256($t24, $t8) @@ -3119,7 +3119,7 @@ object "test_A2_Tables_test_u256" { $t25 := $MakePtr(false, $locals) // $t26 := borrow_local($t2) $t26 := $MakePtr(false, add($locals, 32)) - // $t27 := Table::borrow($t25, $t26) + // $t27 := Table::borrow<0x2::U256::U256, 0x2::U256::U256>($t25, $t26) $t27 := A2_Table_borrow$A2_U256_U256_A2_U256_U256$($t25, $t26) // $t28 := read_ref($t27) $t28 := $LoadU256($t27) @@ -3152,13 +3152,13 @@ object "test_A2_Tables_test_u256" { $t32 := $MakePtr(false, add($locals, 64)) // $t33 := move($t3) $t33 := mload($locals) - // $t34 := pack Tables::S($t33) + // $t34 := pack 0x2::Tables::S<0x2::U256::U256, 0x2::U256::U256>($t33) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t33) $t34 := $mem } - // move_to>($t34, $t32) + // move_to<0x2::Tables::S<0x2::U256::U256, 0x2::U256::U256>>($t34, $t32) { let $base_offset := $MakeTypeStorageBase(0, 0xa20c17a3, $LoadU256($t32)) if $AlignedStorageLoad($base_offset) { @@ -3576,13 +3576,13 @@ object "test_A2_Tables_test_vector" { $t59 := $MakePtr(false, add($locals, 192)) // $t60 := move($t22) $t60 := mload($locals) - // $t61 := pack Tables::S>($t60) + // $t61 := pack 0x2::Tables::S>($t60) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t60) $t61 := $mem } - // move_to>>($t61, $t59) + // move_to<0x2::Tables::S>>($t61, $t59) { let $base_offset := $MakeTypeStorageBase(0, 0xa0362133, $LoadU256($t59)) if $AlignedStorageLoad($base_offset) { @@ -3598,7 +3598,7 @@ object "test_A2_Tables_test_vector" { } // $t62 := 0x42 $t62 := 0x42 - // $t63 := borrow_global>>($t62) + // $t63 := borrow_global<0x2::Tables::S>>($t62) { let $base_offset := $MakeTypeStorageBase(0, 0xa0362133, $t62) if iszero($AlignedStorageLoad($base_offset)) { @@ -3606,7 +3606,7 @@ object "test_A2_Tables_test_vector" { } $t63 := $MakePtr(true, add($base_offset, 32)) } - // $t64 := borrow_field>>.t($t63) + // $t64 := borrow_field<0x2::Tables::S>>.t($t63) $t64 := $t63 // $t65 := 42 $t65 := 42 @@ -3620,7 +3620,7 @@ object "test_A2_Tables_test_vector" { $t68 := 0x1013 // vector::push_back
($t67, $t68) A1_vector_push_back$address$($t67, $t68) - // $t69 := borrow_field>>.t($t63) + // $t69 := borrow_field<0x2::Tables::S>>.t($t63) $t69 := $t63 // $t70 := 42 $t70 := 42 @@ -3656,7 +3656,7 @@ object "test_A2_Tables_test_vector" { } case 17 { // label L14 - // $t77 := borrow_field>>.t($t63) + // $t77 := borrow_field<0x2::Tables::S>>.t($t63) $t77 := $t63 // $t78 := 42 $t78 := 42 @@ -3696,7 +3696,7 @@ object "test_A2_Tables_test_vector" { } case 20 { // label L17 - // $t87 := borrow_field>>.t($t63) + // $t87 := borrow_field<0x2::Tables::S>>.t($t63) $t87 := $t63 // $t88 := 42 $t88 := 42 @@ -3798,7 +3798,7 @@ object "test_A2_Tables_test_vector" { } case 29 { // label L26 - // $t109 := borrow_field>>.t($t63) + // $t109 := borrow_field<0x2::Tables::S>>.t($t63) $t109 := $t63 // $t110 := 42 $t110 := 42 diff --git a/third_party/move/evm/move-to-yul/tests/TestABIStructs.v2_exp b/third_party/move/evm/move-to-yul/tests/TestABIStructs.v2_exp index 49a3eb0ea4782..06d766ee22495 100644 --- a/third_party/move/evm/move-to-yul/tests/TestABIStructs.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/TestABIStructs.v2_exp @@ -101,13 +101,13 @@ object "A2_M" { $t1 := true // $t2 := M::pack_S($t0, $t1) $t2 := A2_M_pack_S($t0, $t1) - // $t3 := pack M::Event_S($t2) + // $t3 := pack 0x2::M::Event_S($t2) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t2) $t3 := $mem } - // Evm::emit($t3) + // Evm::emit<0x2::M::Event_S>($t3) A2_Evm_emit$A2_M_Event_S$($t3) // return () } @@ -130,7 +130,7 @@ object "A2_M" { $t1 := $MakePtr(false, $locals) // $t2 := 0 $t2 := 0 - // $t3 := vector::borrow>($t1, $t2) + // $t3 := vector::borrow>($t1, $t2) $t3 := A1_vector_borrow$vec$A2_M_S$$($t1, $t2) // $t4 := read_ref($t3) $t4 := $LoadU256($t3) @@ -244,7 +244,7 @@ object "A2_M" { function A2_M_pack_S(a, b) -> $result { let s2, $t4, $t5, $t6, $t7, $t8 let $locals := $Malloc(32) - // $t3 := vector::empty() + // $t3 := vector::empty<0x2::M::S2>() mstore($locals, A1_vector_empty$A2_M_S2$()) // $t4 := (u128)($t0) $t4 := $CastU128(a) @@ -252,11 +252,11 @@ object "A2_M" { $t5 := A2_M_pack_S2($t4) // $t6 := borrow_local($t3) $t6 := $MakePtr(false, $locals) - // vector::push_back($t6, $t5) + // vector::push_back<0x2::M::S2>($t6, $t5) A1_vector_push_back$A2_M_S2$($t6, $t5) // $t7 := move($t3) $t7 := mload($locals) - // $t8 := pack M::S($t0, $t1, $t7) + // $t8 := pack 0x2::M::S($t0, $t1, $t7) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -314,7 +314,7 @@ object "A2_M" { A1_vector_push_back$u128$($t2, x) // $t3 := move($t1) $t3 := mload($locals) - // $t4 := pack M::S2($t3) + // $t4 := pack 0x2::M::S2($t3) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t3) @@ -1068,13 +1068,13 @@ object "test_A2_M_test_abi_S" { _s := A2_M_decode_S($t7) // $t8 := borrow_local($t2) $t8 := $MakePtr(false, s) - // $t9 := borrow_field.a($t8) + // $t9 := borrow_field<0x2::M::S>.a($t8) $t9 := $IndexPtr($t8, 32) // $t10 := read_ref($t9) $t10 := $LoadU64($t9) // $t11 := borrow_local($t0) $t11 := $MakePtr(false, _s) - // $t12 := borrow_field.a($t11) + // $t12 := borrow_field<0x2::M::S>.a($t11) $t12 := $IndexPtr($t11, 32) // $t13 := read_ref($t12) $t13 := $LoadU64($t12) @@ -1089,7 +1089,7 @@ object "test_A2_M_test_abi_S" { // label L2 // $t16 := borrow_local($t0) $t16 := $MakePtr(false, _s) - // $t17 := borrow_field.a($t16) + // $t17 := borrow_field<0x2::M::S>.a($t16) $t17 := $IndexPtr($t16, 32) // $t18 := read_ref($t17) $t18 := $LoadU64($t17) @@ -1118,13 +1118,13 @@ object "test_A2_M_test_abi_S" { // label L5 // $t22 := borrow_local($t2) $t22 := $MakePtr(false, s) - // $t23 := borrow_field.b($t22) + // $t23 := borrow_field<0x2::M::S>.b($t22) $t23 := $IndexPtr($t22, 40) // $t24 := read_ref($t23) $t24 := $LoadU8($t23) // $t25 := borrow_local($t0) $t25 := $MakePtr(false, _s) - // $t26 := borrow_field.b($t25) + // $t26 := borrow_field<0x2::M::S>.b($t25) $t26 := $IndexPtr($t25, 40) // $t27 := read_ref($t26) $t27 := $LoadU8($t26) @@ -1151,7 +1151,7 @@ object "test_A2_M_test_abi_S" { // label L8 // $t30 := borrow_local($t0) $t30 := $MakePtr(false, _s) - // $t31 := borrow_field.b($t30) + // $t31 := borrow_field<0x2::M::S>.b($t30) $t31 := $IndexPtr($t30, 40) // $t32 := read_ref($t31) $t32 := $LoadU8($t31) @@ -1180,7 +1180,7 @@ object "test_A2_M_test_abi_S" { // label L11 // $t36 := borrow_local($t2) $t36 := $MakePtr(false, s) - // $t37 := borrow_field.c($t36) + // $t37 := borrow_field<0x2::M::S>.c($t36) $t37 := $t36 // $t3 := read_ref($t37) mstore($locals, $LoadU256($t37)) @@ -1222,7 +1222,7 @@ object "test_A2_M_test_abi_S" { } // $t38 := borrow_local($t0) $t38 := $MakePtr(false, _s) - // $t39 := borrow_field.c($t38) + // $t39 := borrow_field<0x2::M::S>.c($t38) $t39 := $t38 // $t1 := read_ref($t39) mstore(add($locals, 32), $LoadU256($t39)) @@ -1264,7 +1264,7 @@ object "test_A2_M_test_abi_S" { } // $t40 := borrow_local($t3) $t40 := $MakePtr(false, $locals) - // $t41 := vector::length($t40) + // $t41 := vector::length<0x2::M::S2>($t40) $t41 := A1_vector_length$A2_M_S2$($t40) // $t42 := 1 $t42 := 1 @@ -1291,7 +1291,7 @@ object "test_A2_M_test_abi_S" { // label L14 // $t45 := borrow_local($t1) $t45 := $MakePtr(false, add($locals, 32)) - // $t46 := vector::length($t45) + // $t46 := vector::length<0x2::M::S2>($t45) $t46 := A1_vector_length$A2_M_S2$($t45) // $t47 := 1 $t47 := 1 @@ -1320,9 +1320,9 @@ object "test_A2_M_test_abi_S" { $t50 := $MakePtr(false, add($locals, 32)) // $t51 := 0 $t51 := 0 - // $t52 := vector::borrow($t50, $t51) + // $t52 := vector::borrow<0x2::M::S2>($t50, $t51) $t52 := A1_vector_borrow$A2_M_S2$($t50, $t51) - // $t53 := borrow_field.x($t52) + // $t53 := borrow_field<0x2::M::S2>.x($t52) $t53 := $t52 // $t54 := 0 $t54 := 0 @@ -1404,7 +1404,7 @@ object "test_A2_M_test_abi_S" { function A2_M_pack_S(a, b) -> $result { let s2, $t4, $t5, $t6, $t7, $t8 let $locals := $Malloc(32) - // $t3 := vector::empty() + // $t3 := vector::empty<0x2::M::S2>() mstore($locals, A1_vector_empty$A2_M_S2$()) // $t4 := (u128)($t0) $t4 := $CastU128(a) @@ -1412,11 +1412,11 @@ object "test_A2_M_test_abi_S" { $t5 := A2_M_pack_S2($t4) // $t6 := borrow_local($t3) $t6 := $MakePtr(false, $locals) - // vector::push_back($t6, $t5) + // vector::push_back<0x2::M::S2>($t6, $t5) A1_vector_push_back$A2_M_S2$($t6, $t5) // $t7 := move($t3) $t7 := mload($locals) - // $t8 := pack M::S($t0, $t1, $t7) + // $t8 := pack 0x2::M::S($t0, $t1, $t7) { let $mem := $Malloc(41) $MemoryStoreU64(add($mem, 32), a) @@ -1474,7 +1474,7 @@ object "test_A2_M_test_abi_S" { A1_vector_push_back$u128$($t2, x) // $t3 := move($t1) $t3 := mload($locals) - // $t4 := pack M::S2($t3) + // $t4 := pack 0x2::M::S2($t3) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t3) @@ -2216,7 +2216,7 @@ object "test_A2_M_test_abi_String" { } function A1_ascii_into_bytes(string) -> $result { let $t1 - // $t1 := unpack ascii::String($t0) + // $t1 := unpack 0x1::ascii::String($t0) $t1 := $MemoryLoadU256(add(string, 0)) $Free(string, 32) // return $t1 @@ -2249,7 +2249,7 @@ object "test_A2_M_test_abi_String" { function A1_ascii_as_bytes(string) -> $result { let $t1 - // $t1 := borrow_field.bytes($t0) + // $t1 := borrow_field<0x1::ascii::String>.bytes($t0) $t1 := string // return $t1 $result := $t1 @@ -2297,7 +2297,7 @@ object "test_A2_M_test_abi_String" { x := A1_ascii_try_string(bytes) // $t2 := borrow_local($t1) $t2 := $MakePtr(false, x) - // $t3 := option::is_some($t2) + // $t3 := option::is_some<0x1::ascii::String>($t2) $t3 := A1_option_is_some$A1_ascii_String$($t2) // if ($t3) goto L1 else goto L0 switch $t3 @@ -2308,7 +2308,7 @@ object "test_A2_M_test_abi_String" { // label L2 // $t5 := move($t1) $t5 := x - // $t6 := option::destroy_some($t5) + // $t6 := option::destroy_some<0x1::ascii::String>($t5) $t6 := A1_option_destroy_some$A1_ascii_String$($t5) // return $t6 $result := $t6 @@ -2349,7 +2349,7 @@ object "test_A2_M_test_abi_String" { // label L2 // $t6 := move($t0) $t6 := t - // $t2 := unpack option::Option<#0>($t6) + // $t2 := unpack 0x1::option::Option<#0>($t6) mstore($locals, $MemoryLoadU256(add($t6, 0))) $Free($t6, 32) // $t7 := borrow_local($t2) @@ -2409,7 +2409,7 @@ object "test_A2_M_test_abi_String" { } function A1_option_is_some$A1_ascii_String$(t) -> $result { let $t1, $t2, $t3 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$A1_ascii_String$($t1) @@ -2477,13 +2477,13 @@ object "test_A2_M_test_abi_String" { // assert forall j: num: Range(0, $t4): ascii::is_valid_char(Index($t0, j)) // $t14 := move($t0) $t14 := mload($locals) - // $t15 := pack ascii::String($t14) + // $t15 := pack 0x1::ascii::String($t14) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t14) $t15 := $mem } - // $t16 := option::some($t15) + // $t16 := option::some<0x1::ascii::String>($t15) $t16 := A1_option_some$A1_ascii_String$($t15) // return $t16 $result := $t16 @@ -2509,7 +2509,7 @@ object "test_A2_M_test_abi_String" { } case 7 { // label L4 - // $t12 := option::none() + // $t12 := option::none<0x1::ascii::String>() $t12 := A1_option_none$A1_ascii_String$() // return $t12 $result := $t12 @@ -2532,7 +2532,7 @@ object "test_A2_M_test_abi_String" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$A1_ascii_String$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -2550,7 +2550,7 @@ object "test_A2_M_test_abi_String" { let $t1, $t2 // $t1 := vector::singleton<#0>($t0) $t1 := A1_vector_singleton$A1_ascii_String$(e) - // $t2 := pack option::Option<#0>($t1) + // $t2 := pack 0x1::option::Option<#0>($t1) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t1) diff --git a/third_party/move/evm/move-to-yul/tests/TestExternalResult.v2_exp b/third_party/move/evm/move-to-yul/tests/TestExternalResult.v2_exp index 0efdfd006698d..53d43f5dcd892 100644 --- a/third_party/move/evm/move-to-yul/tests/TestExternalResult.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/TestExternalResult.v2_exp @@ -171,7 +171,7 @@ object "test_A2_M_extract_err_data" { } function A2_ExternalResult_unwrap_err_data$u64$(result) -> $result { let err_data, err_reason, panic_code, $t4, $t5, $t6, $t7, $t8 - // ($t4, $t5, $t6, $t7) := unpack ExternalResult::ExternalResult<#0>($t0) + // ($t4, $t5, $t6, $t7) := unpack 0x2::ExternalResult::ExternalResult<#0>($t0) $t4 := $MemoryLoadU256(add(result, 0)) $t5 := $MemoryLoadU256(add(result, 32)) $t6 := $MemoryLoadU256(add(result, 64)) @@ -181,7 +181,7 @@ object "test_A2_M_extract_err_data" { A1_option_destroy_none$u64$($t4) // option::destroy_none>($t6) A1_option_destroy_none$vec$u8$$($t6) - // option::destroy_none($t7) + // option::destroy_none<0x2::U256::U256>($t7) A1_option_destroy_none$A2_U256_U256$($t7) // $t8 := option::destroy_some>($t5) $t8 := A1_option_destroy_some$vec$u8$$($t5) @@ -221,7 +221,7 @@ object "test_A2_M_extract_err_data" { // label L2 // $t6 := move($t0) $t6 := t - // $t2 := unpack option::Option<#0>($t6) + // $t2 := unpack 0x1::option::Option<#0>($t6) mstore($locals, $MemoryLoadU256(add($t6, 0))) $Free($t6, 32) // $t7 := borrow_local($t2) @@ -274,7 +274,7 @@ object "test_A2_M_extract_err_data" { } function A1_option_is_some$vec$u8$$(t) -> $result { let $t1, $t2, $t3 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$vec$u8$$($t1) @@ -332,7 +332,7 @@ object "test_A2_M_extract_err_data" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -351,7 +351,7 @@ object "test_A2_M_extract_err_data" { } function A1_option_is_none$A2_U256_U256$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$A2_U256_U256$($t1) @@ -407,7 +407,7 @@ object "test_A2_M_extract_err_data" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -420,7 +420,7 @@ object "test_A2_M_extract_err_data" { function A1_option_is_none$vec$u8$$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$vec$u8$$($t1) @@ -459,7 +459,7 @@ object "test_A2_M_extract_err_data" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -478,7 +478,7 @@ object "test_A2_M_extract_err_data" { } function A1_option_is_none$u64$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$u64$($t1) @@ -505,7 +505,7 @@ object "test_A2_M_extract_err_data" { } function A2_ExternalResult_is_err_data$u64$(result) -> $result { let $t1, $t2 - // $t1 := borrow_field>.err_data($t0) + // $t1 := borrow_field<0x2::ExternalResult::ExternalResult<#0>>.err_data($t0) { let $field_ptr := $IndexPtr(result, 32) $t1 := $MakePtr($IsStoragePtr($field_ptr), $LoadU256($field_ptr)) @@ -532,9 +532,9 @@ object "test_A2_M_extract_err_data" { $t2 := A1_option_some$vec$u8$$(error) // $t3 := option::none>() $t3 := A1_option_none$vec$u8$$() - // $t4 := option::none() + // $t4 := option::none<0x2::U256::U256>() $t4 := A1_option_none$A2_U256_U256$() - // $t5 := pack ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) + // $t5 := pack 0x2::ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t1) @@ -551,7 +551,7 @@ object "test_A2_M_extract_err_data" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$A2_U256_U256$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -569,7 +569,7 @@ object "test_A2_M_extract_err_data" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$vec$u8$$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -587,7 +587,7 @@ object "test_A2_M_extract_err_data" { let $t1, $t2 // $t1 := vector::singleton<#0>($t0) $t1 := A1_vector_singleton$vec$u8$$(e) - // $t2 := pack option::Option<#0>($t1) + // $t2 := pack 0x1::option::Option<#0>($t1) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t1) @@ -645,7 +645,7 @@ object "test_A2_M_extract_err_data" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$u64$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -1082,7 +1082,7 @@ object "test_A2_M_extract_err_reason" { } function A2_ExternalResult_unwrap_err_reason$u64$(result) -> $result { let err_data, err_reason, panic_code, $t4, $t5, $t6, $t7, $t8 - // ($t4, $t5, $t6, $t7) := unpack ExternalResult::ExternalResult<#0>($t0) + // ($t4, $t5, $t6, $t7) := unpack 0x2::ExternalResult::ExternalResult<#0>($t0) $t4 := $MemoryLoadU256(add(result, 0)) $t5 := $MemoryLoadU256(add(result, 32)) $t6 := $MemoryLoadU256(add(result, 64)) @@ -1092,7 +1092,7 @@ object "test_A2_M_extract_err_reason" { A1_option_destroy_none$u64$($t4) // option::destroy_none>($t5) A1_option_destroy_none$vec$u8$$($t5) - // option::destroy_none($t7) + // option::destroy_none<0x2::U256::U256>($t7) A1_option_destroy_none$A2_U256_U256$($t7) // $t8 := option::destroy_some>($t6) $t8 := A1_option_destroy_some$vec$u8$$($t6) @@ -1132,7 +1132,7 @@ object "test_A2_M_extract_err_reason" { // label L2 // $t6 := move($t0) $t6 := t - // $t2 := unpack option::Option<#0>($t6) + // $t2 := unpack 0x1::option::Option<#0>($t6) mstore($locals, $MemoryLoadU256(add($t6, 0))) $Free($t6, 32) // $t7 := borrow_local($t2) @@ -1185,7 +1185,7 @@ object "test_A2_M_extract_err_reason" { } function A1_option_is_some$vec$u8$$(t) -> $result { let $t1, $t2, $t3 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$vec$u8$$($t1) @@ -1243,7 +1243,7 @@ object "test_A2_M_extract_err_reason" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -1262,7 +1262,7 @@ object "test_A2_M_extract_err_reason" { } function A1_option_is_none$A2_U256_U256$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$A2_U256_U256$($t1) @@ -1318,7 +1318,7 @@ object "test_A2_M_extract_err_reason" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -1331,7 +1331,7 @@ object "test_A2_M_extract_err_reason" { function A1_option_is_none$vec$u8$$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$vec$u8$$($t1) @@ -1370,7 +1370,7 @@ object "test_A2_M_extract_err_reason" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -1389,7 +1389,7 @@ object "test_A2_M_extract_err_reason" { } function A1_option_is_none$u64$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$u64$($t1) @@ -1416,7 +1416,7 @@ object "test_A2_M_extract_err_reason" { } function A2_ExternalResult_is_err_reason$u64$(result) -> $result { let $t1, $t2 - // $t1 := borrow_field>.err_reason($t0) + // $t1 := borrow_field<0x2::ExternalResult::ExternalResult<#0>>.err_reason($t0) { let $field_ptr := $IndexPtr(result, 64) $t1 := $MakePtr($IsStoragePtr($field_ptr), $LoadU256($field_ptr)) @@ -1443,9 +1443,9 @@ object "test_A2_M_extract_err_reason" { $t6 := A1_option_some$vec$u8$$(error) // $t7 := option::none>() $t7 := A1_option_none$vec$u8$$() - // $t8 := option::none() + // $t8 := option::none<0x2::U256::U256>() $t8 := A1_option_none$A2_U256_U256$() - // $t9 := pack ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) + // $t9 := pack 0x2::ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t5) @@ -1462,7 +1462,7 @@ object "test_A2_M_extract_err_reason" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$A2_U256_U256$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -1480,7 +1480,7 @@ object "test_A2_M_extract_err_reason" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$vec$u8$$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -1498,7 +1498,7 @@ object "test_A2_M_extract_err_reason" { let $t1, $t2 // $t1 := vector::singleton<#0>($t0) $t1 := A1_vector_singleton$vec$u8$$(e) - // $t2 := pack option::Option<#0>($t1) + // $t2 := pack 0x1::option::Option<#0>($t1) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t1) @@ -1556,7 +1556,7 @@ object "test_A2_M_extract_err_reason" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$u64$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -1950,7 +1950,7 @@ object "test_A2_M_extract_panic_code" { function A2_ExternalResult_unwrap_panic$u64$(result) -> $result { let err_data, err_reason, panic_code, $t4, $t5, $t6, $t7, $t8 - // ($t4, $t5, $t6, $t7) := unpack ExternalResult::ExternalResult<#0>($t0) + // ($t4, $t5, $t6, $t7) := unpack 0x2::ExternalResult::ExternalResult<#0>($t0) $t4 := $MemoryLoadU256(add(result, 0)) $t5 := $MemoryLoadU256(add(result, 32)) $t6 := $MemoryLoadU256(add(result, 64)) @@ -1962,7 +1962,7 @@ object "test_A2_M_extract_panic_code" { A1_option_destroy_none$vec$u8$$($t6) // option::destroy_none>($t5) A1_option_destroy_none$vec$u8$$($t5) - // $t8 := option::destroy_some($t7) + // $t8 := option::destroy_some<0x2::U256::U256>($t7) $t8 := A1_option_destroy_some$A2_U256_U256$($t7) // return $t8 $result := $t8 @@ -2000,7 +2000,7 @@ object "test_A2_M_extract_panic_code" { // label L2 // $t6 := move($t0) $t6 := t - // $t2 := unpack option::Option<#0>($t6) + // $t2 := unpack 0x1::option::Option<#0>($t6) mstore($locals, $MemoryLoadU256(add($t6, 0))) $Free($t6, 32) // $t7 := borrow_local($t2) @@ -2036,7 +2036,7 @@ object "test_A2_M_extract_panic_code" { } function A1_option_is_some$A2_U256_U256$(t) -> $result { let $t1, $t2, $t3 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$A2_U256_U256$($t1) @@ -2094,7 +2094,7 @@ object "test_A2_M_extract_panic_code" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -2113,7 +2113,7 @@ object "test_A2_M_extract_panic_code" { } function A1_option_is_none$vec$u8$$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$vec$u8$$($t1) @@ -2169,7 +2169,7 @@ object "test_A2_M_extract_panic_code" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -2188,7 +2188,7 @@ object "test_A2_M_extract_panic_code" { } function A1_option_is_none$u64$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$u64$($t1) @@ -2215,12 +2215,12 @@ object "test_A2_M_extract_panic_code" { } function A2_ExternalResult_is_panic$u64$(result) -> $result { let $t1, $t2 - // $t1 := borrow_field>.panic_code($t0) + // $t1 := borrow_field<0x2::ExternalResult::ExternalResult<#0>>.panic_code($t0) { let $field_ptr := $IndexPtr(result, 96) $t1 := $MakePtr($IsStoragePtr($field_ptr), $LoadU256($field_ptr)) } - // $t2 := option::is_some($t1) + // $t2 := option::is_some<0x2::U256::U256>($t1) $t2 := A1_option_is_some$A2_U256_U256$($t1) // return $t2 $result := $t2 @@ -2242,9 +2242,9 @@ object "test_A2_M_extract_panic_code" { $t6 := A1_option_none$vec$u8$$() // $t7 := option::none>() $t7 := A1_option_none$vec$u8$$() - // $t8 := option::some($t0) + // $t8 := option::some<0x2::U256::U256>($t0) $t8 := A1_option_some$A2_U256_U256$(panic_code) - // $t9 := pack ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) + // $t9 := pack 0x2::ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t5) @@ -2261,7 +2261,7 @@ object "test_A2_M_extract_panic_code" { let $t1, $t2 // $t1 := vector::singleton<#0>($t0) $t1 := A1_vector_singleton$A2_U256_U256$(e) - // $t2 := pack option::Option<#0>($t1) + // $t2 := pack 0x1::option::Option<#0>($t1) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t1) @@ -2309,7 +2309,7 @@ object "test_A2_M_extract_panic_code" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$vec$u8$$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -2327,7 +2327,7 @@ object "test_A2_M_extract_panic_code" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$u64$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -2632,7 +2632,7 @@ object "test_A2_M_extract_value" { function A2_ExternalResult_unwrap$u64$(result) -> $result { let err_data, err_reason, panic_code, value, $t5, $t6, $t7, $t8, $t9 - // ($t5, $t6, $t7, $t8) := unpack ExternalResult::ExternalResult<#0>($t0) + // ($t5, $t6, $t7, $t8) := unpack 0x2::ExternalResult::ExternalResult<#0>($t0) $t5 := $MemoryLoadU256(add(result, 0)) $t6 := $MemoryLoadU256(add(result, 32)) $t7 := $MemoryLoadU256(add(result, 64)) @@ -2642,7 +2642,7 @@ object "test_A2_M_extract_value" { A1_option_destroy_none$vec$u8$$($t6) // option::destroy_none>($t7) A1_option_destroy_none$vec$u8$$($t7) - // option::destroy_none($t8) + // option::destroy_none<0x2::U256::U256>($t8) A1_option_destroy_none$A2_U256_U256$($t8) // $t9 := option::destroy_some<#0>($t5) $t9 := A1_option_destroy_some$u64$($t5) @@ -2682,7 +2682,7 @@ object "test_A2_M_extract_value" { // label L2 // $t6 := move($t0) $t6 := t - // $t2 := unpack option::Option<#0>($t6) + // $t2 := unpack 0x1::option::Option<#0>($t6) mstore($locals, $MemoryLoadU256(add($t6, 0))) $Free($t6, 32) // $t7 := borrow_local($t2) @@ -2718,7 +2718,7 @@ object "test_A2_M_extract_value" { } function A1_option_is_some$u64$(t) -> $result { let $t1, $t2, $t3 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$u64$($t1) @@ -2776,7 +2776,7 @@ object "test_A2_M_extract_value" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -2795,7 +2795,7 @@ object "test_A2_M_extract_value" { } function A1_option_is_none$A2_U256_U256$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$A2_U256_U256$($t1) @@ -2851,7 +2851,7 @@ object "test_A2_M_extract_value" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -2870,7 +2870,7 @@ object "test_A2_M_extract_value" { } function A1_option_is_none$vec$u8$$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$vec$u8$$($t1) @@ -2897,7 +2897,7 @@ object "test_A2_M_extract_value" { } function A2_ExternalResult_is_ok$u64$(result) -> $result { let $t1, $t2 - // $t1 := borrow_field>.value($t0) + // $t1 := borrow_field<0x2::ExternalResult::ExternalResult<#0>>.value($t0) { $t1 := $MakePtr($IsStoragePtr(result), $LoadU256(result)) } @@ -2923,9 +2923,9 @@ object "test_A2_M_extract_value" { $t2 := A1_option_none$vec$u8$$() // $t3 := option::none>() $t3 := A1_option_none$vec$u8$$() - // $t4 := option::none() + // $t4 := option::none<0x2::U256::U256>() $t4 := A1_option_none$A2_U256_U256$() - // $t5 := pack ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) + // $t5 := pack 0x2::ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t1) @@ -2942,7 +2942,7 @@ object "test_A2_M_extract_value" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$A2_U256_U256$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -2960,7 +2960,7 @@ object "test_A2_M_extract_value" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$vec$u8$$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -2978,7 +2978,7 @@ object "test_A2_M_extract_value" { let $t1, $t2 // $t1 := vector::singleton<#0>($t0) $t1 := A1_vector_singleton$u64$(e) - // $t2 := pack option::Option<#0>($t1) + // $t2 := pack 0x1::option::Option<#0>($t1) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t1) diff --git a/third_party/move/evm/move-to-yul/tests/TestStringLiteral.v2_exp b/third_party/move/evm/move-to-yul/tests/TestStringLiteral.v2_exp index 7ff6ff55a5591..d268ad845efe2 100644 --- a/third_party/move/evm/move-to-yul/tests/TestStringLiteral.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/TestStringLiteral.v2_exp @@ -76,13 +76,13 @@ object "test_A2_M_h1" { $MemoryStoreU64($t5, 3) $MemoryStoreU64(add($t5, 8), $ClosestGreaterPowerOfTwo(3)) copy_literal_string_to_memory_2053440334(add($t5, 32)) - // $t6 := pack M::T($t5) + // $t6 := pack 0x2::M::T($t5) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t5) $t6 := $mem } - // move_to($t6, $t4) + // move_to<0x2::M::T>($t6, $t4) { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $LoadU256($t4)) if $AlignedStorageLoad($base_offset) { @@ -111,7 +111,7 @@ object "test_A2_M_h1" { } // $t7 := 0x3 $t7 := 0x3 - // $t8 := borrow_global($t7) + // $t8 := borrow_global<0x2::M::T>($t7) { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t7) if iszero($AlignedStorageLoad($base_offset)) { @@ -119,7 +119,7 @@ object "test_A2_M_h1" { } $t8 := $MakePtr(true, add($base_offset, 32)) } - // $t9 := borrow_field.s($t8) + // $t9 := borrow_field<0x2::M::T>.s($t8) $t9 := $t8 // $t1 := read_ref($t9) mstore(add($locals, 32), $LoadU256($t9)) @@ -253,7 +253,7 @@ object "test_A2_M_h1" { copy_literal_string_to_memory_2788570470(add($t36, 32)) // $t37 := 0x3 $t37 := 0x3 - // $t38 := borrow_global($t37) + // $t38 := borrow_global<0x2::M::T>($t37) { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t37) if iszero($AlignedStorageLoad($base_offset)) { @@ -261,7 +261,7 @@ object "test_A2_M_h1" { } $t38 := $MakePtr(true, add($base_offset, 32)) } - // $t39 := borrow_field.s($t38) + // $t39 := borrow_field<0x2::M::T>.s($t38) $t39 := $t38 // write_ref($t39, $t36) if $IsStoragePtr($t39){ @@ -279,7 +279,7 @@ object "test_A2_M_h1" { $StoreU256($t39, $t36) // $t40 := 0x3 $t40 := 0x3 - // $t41 := borrow_global($t40) + // $t41 := borrow_global<0x2::M::T>($t40) { let $base_offset := $MakeTypeStorageBase(0, 0x3948ca0a, $t40) if iszero($AlignedStorageLoad($base_offset)) { @@ -287,7 +287,7 @@ object "test_A2_M_h1" { } $t41 := $MakePtr(true, add($base_offset, 32)) } - // $t42 := borrow_field.s($t41) + // $t42 := borrow_field<0x2::M::T>.s($t41) $t42 := $t41 // $t2 := read_ref($t42) mstore(add($locals, 64), $LoadU256($t42)) diff --git a/third_party/move/evm/move-to-yul/tests/Vectors.v2_exp b/third_party/move/evm/move-to-yul/tests/Vectors.v2_exp index b173205f13135..0c52bbbddab24 100644 --- a/third_party/move/evm/move-to-yul/tests/Vectors.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/Vectors.v2_exp @@ -622,7 +622,7 @@ object "test_A2_Vectors_test_borrow_mut" { $t5 := false // $t6 := 123 $t6 := 123 - // $t7 := pack Vectors::S($t4, $t5, $t6) + // $t7 := pack 0x2::Vectors::S($t4, $t5, $t6) { let $mem := $Malloc(25) $MemoryStoreU128(add($mem, 0), $t4) @@ -630,29 +630,29 @@ object "test_A2_Vectors_test_borrow_mut" { $MemoryStoreU64(add($mem, 16), $t6) $t7 := $mem } - // vector::push_back($t3, $t7) + // vector::push_back<0x2::Vectors::S>($t3, $t7) A1_vector_push_back$A2_Vectors_S$($t3, $t7) // $t8 := borrow_local($t2) $t8 := $MakePtr(false, $locals) // $t9 := 0 $t9 := 0 - // $t10 := vector::borrow_mut($t8, $t9) + // $t10 := vector::borrow_mut<0x2::Vectors::S>($t8, $t9) $t10 := A1_vector_borrow_mut$A2_Vectors_S$($t8, $t9) // $t11 := 90 $t11 := 90 - // $t12 := borrow_field.x($t10) + // $t12 := borrow_field<0x2::Vectors::S>.x($t10) $t12 := $t10 // write_ref($t12, $t11) $StoreU128($t12, $t11) // $t13 := false $t13 := false - // $t14 := borrow_field.y($t10) + // $t14 := borrow_field<0x2::Vectors::S>.y($t10) $t14 := $IndexPtr($t10, 24) // write_ref($t14, $t13) $StoreU8($t14, $t13) // $t15 := 1028 $t15 := 1028 - // $t16 := borrow_field.z($t10) + // $t16 := borrow_field<0x2::Vectors::S>.z($t10) $t16 := $IndexPtr($t10, 16) // write_ref($t16, $t15) $StoreU64($t16, $t15) @@ -660,9 +660,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t17 := $MakePtr(false, $locals) // $t18 := 0 $t18 := 0 - // $t19 := vector::borrow($t17, $t18) + // $t19 := vector::borrow<0x2::Vectors::S>($t17, $t18) $t19 := A1_vector_borrow$A2_Vectors_S$($t17, $t18) - // $t20 := borrow_field.x($t19) + // $t20 := borrow_field<0x2::Vectors::S>.x($t19) $t20 := $t19 // $t21 := read_ref($t20) $t21 := $LoadU128($t20) @@ -681,9 +681,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t25 := $MakePtr(false, $locals) // $t26 := 0 $t26 := 0 - // $t27 := vector::borrow($t25, $t26) + // $t27 := vector::borrow<0x2::Vectors::S>($t25, $t26) $t27 := A1_vector_borrow$A2_Vectors_S$($t25, $t26) - // $t28 := borrow_field.y($t27) + // $t28 := borrow_field<0x2::Vectors::S>.y($t27) $t28 := $IndexPtr($t27, 24) // $t29 := read_ref($t28) $t29 := $LoadU8($t28) @@ -714,9 +714,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t33 := $MakePtr(false, $locals) // $t34 := 0 $t34 := 0 - // $t35 := vector::borrow($t33, $t34) + // $t35 := vector::borrow<0x2::Vectors::S>($t33, $t34) $t35 := A1_vector_borrow$A2_Vectors_S$($t33, $t34) - // $t36 := borrow_field.z($t35) + // $t36 := borrow_field<0x2::Vectors::S>.z($t35) $t36 := $IndexPtr($t35, 16) // $t37 := read_ref($t36) $t37 := $LoadU64($t36) @@ -747,9 +747,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t41 := $MakePtr(false, $locals) // $t42 := 1 $t42 := 1 - // $t43 := vector::borrow($t41, $t42) + // $t43 := vector::borrow<0x2::Vectors::S>($t41, $t42) $t43 := A1_vector_borrow$A2_Vectors_S$($t41, $t42) - // $t44 := borrow_field.x($t43) + // $t44 := borrow_field<0x2::Vectors::S>.x($t43) $t44 := $t43 // $t45 := read_ref($t44) $t45 := $LoadU128($t44) @@ -780,9 +780,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t49 := $MakePtr(false, $locals) // $t50 := 1 $t50 := 1 - // $t51 := vector::borrow($t49, $t50) + // $t51 := vector::borrow<0x2::Vectors::S>($t49, $t50) $t51 := A1_vector_borrow$A2_Vectors_S$($t49, $t50) - // $t52 := borrow_field.y($t51) + // $t52 := borrow_field<0x2::Vectors::S>.y($t51) $t52 := $IndexPtr($t51, 24) // $t53 := read_ref($t52) $t53 := $LoadU8($t52) @@ -813,9 +813,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t57 := $MakePtr(false, $locals) // $t58 := 1 $t58 := 1 - // $t59 := vector::borrow($t57, $t58) + // $t59 := vector::borrow<0x2::Vectors::S>($t57, $t58) $t59 := A1_vector_borrow$A2_Vectors_S$($t57, $t58) - // $t60 := borrow_field.z($t59) + // $t60 := borrow_field<0x2::Vectors::S>.z($t59) $t60 := $IndexPtr($t59, 16) // $t61 := read_ref($t60) $t61 := $LoadU64($t60) @@ -846,23 +846,23 @@ object "test_A2_Vectors_test_borrow_mut" { $t65 := $MakePtr(false, $locals) // $t66 := 1 $t66 := 1 - // $t67 := vector::borrow_mut($t65, $t66) + // $t67 := vector::borrow_mut<0x2::Vectors::S>($t65, $t66) $t67 := A1_vector_borrow_mut$A2_Vectors_S$($t65, $t66) // $t68 := 10 $t68 := 10 - // $t69 := borrow_field.x($t67) + // $t69 := borrow_field<0x2::Vectors::S>.x($t67) $t69 := $t67 // write_ref($t69, $t68) $StoreU128($t69, $t68) // $t70 := true $t70 := true - // $t71 := borrow_field.y($t67) + // $t71 := borrow_field<0x2::Vectors::S>.y($t67) $t71 := $IndexPtr($t67, 24) // write_ref($t71, $t70) $StoreU8($t71, $t70) // $t72 := 456 $t72 := 456 - // $t73 := borrow_field.z($t67) + // $t73 := borrow_field<0x2::Vectors::S>.z($t67) $t73 := $IndexPtr($t67, 16) // write_ref($t73, $t72) $StoreU64($t73, $t72) @@ -870,9 +870,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t74 := $MakePtr(false, $locals) // $t75 := 1 $t75 := 1 - // $t76 := vector::borrow($t74, $t75) + // $t76 := vector::borrow<0x2::Vectors::S>($t74, $t75) $t76 := A1_vector_borrow$A2_Vectors_S$($t74, $t75) - // $t77 := borrow_field.x($t76) + // $t77 := borrow_field<0x2::Vectors::S>.x($t76) $t77 := $t76 // $t78 := read_ref($t77) $t78 := $LoadU128($t77) @@ -903,9 +903,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t82 := $MakePtr(false, $locals) // $t83 := 1 $t83 := 1 - // $t84 := vector::borrow($t82, $t83) + // $t84 := vector::borrow<0x2::Vectors::S>($t82, $t83) $t84 := A1_vector_borrow$A2_Vectors_S$($t82, $t83) - // $t85 := borrow_field.y($t84) + // $t85 := borrow_field<0x2::Vectors::S>.y($t84) $t85 := $IndexPtr($t84, 24) // $t86 := read_ref($t85) $t86 := $LoadU8($t85) @@ -936,9 +936,9 @@ object "test_A2_Vectors_test_borrow_mut" { $t90 := $MakePtr(false, $locals) // $t91 := 1 $t91 := 1 - // $t92 := vector::borrow($t90, $t91) + // $t92 := vector::borrow<0x2::Vectors::S>($t90, $t91) $t92 := A1_vector_borrow$A2_Vectors_S$($t90, $t91) - // $t93 := borrow_field.z($t92) + // $t93 := borrow_field<0x2::Vectors::S>.z($t92) $t93 := $IndexPtr($t92, 16) // $t94 := read_ref($t93) $t94 := $LoadU64($t93) @@ -1014,7 +1014,7 @@ object "test_A2_Vectors_test_borrow_mut" { function A2_Vectors_one_elem_struct() -> $result { let $t1, $t2, $t3, $t4, $t5, $t6 let $locals := $Malloc(32) - // $t0 := vector::empty() + // $t0 := vector::empty<0x2::Vectors::S>() mstore($locals, A1_vector_empty$A2_Vectors_S$()) // $t1 := borrow_local($t0) $t1 := $MakePtr(false, $locals) @@ -1024,7 +1024,7 @@ object "test_A2_Vectors_test_borrow_mut" { $t3 := true // $t4 := 789 $t4 := 789 - // $t5 := pack Vectors::S($t2, $t3, $t4) + // $t5 := pack 0x2::Vectors::S($t2, $t3, $t4) { let $mem := $Malloc(25) $MemoryStoreU128(add($mem, 0), $t2) @@ -1032,7 +1032,7 @@ object "test_A2_Vectors_test_borrow_mut" { $MemoryStoreU64(add($mem, 16), $t4) $t5 := $mem } - // vector::push_back($t1, $t5) + // vector::push_back<0x2::Vectors::S>($t1, $t5) A1_vector_push_back$A2_Vectors_S$($t1, $t5) // $t6 := move($t0) $t6 := mload($locals) @@ -1418,7 +1418,7 @@ object "test_A2_Vectors_test_destroy_non_empty_fail" { let $t0 // $t0 := Vectors::one_elem_struct() $t0 := A2_Vectors_one_elem_struct() - // vector::destroy_empty($t0) + // vector::destroy_empty<0x2::Vectors::S>($t0) A1_vector_destroy_empty$A2_Vectors_S$($t0) // return () } @@ -1432,7 +1432,7 @@ object "test_A2_Vectors_test_destroy_non_empty_fail" { function A2_Vectors_one_elem_struct() -> $result { let $t1, $t2, $t3, $t4, $t5, $t6 let $locals := $Malloc(32) - // $t0 := vector::empty() + // $t0 := vector::empty<0x2::Vectors::S>() mstore($locals, A1_vector_empty$A2_Vectors_S$()) // $t1 := borrow_local($t0) $t1 := $MakePtr(false, $locals) @@ -1442,7 +1442,7 @@ object "test_A2_Vectors_test_destroy_non_empty_fail" { $t3 := true // $t4 := 789 $t4 := 789 - // $t5 := pack Vectors::S($t2, $t3, $t4) + // $t5 := pack 0x2::Vectors::S($t2, $t3, $t4) { let $mem := $Malloc(25) $MemoryStoreU128(add($mem, 0), $t2) @@ -1450,7 +1450,7 @@ object "test_A2_Vectors_test_destroy_non_empty_fail" { $MemoryStoreU64(add($mem, 16), $t4) $t5 := $mem } - // vector::push_back($t1, $t5) + // vector::push_back<0x2::Vectors::S>($t1, $t5) A1_vector_push_back$A2_Vectors_S$($t1, $t5) // $t6 := move($t0) $t6 := mload($locals) @@ -3121,7 +3121,7 @@ object "test_A2_Vectors_test_one_elem_struct" { mstore($locals, A2_Vectors_one_elem_struct()) // $t1 := borrow_local($t0) $t1 := $MakePtr(false, $locals) - // $t2 := vector::length($t1) + // $t2 := vector::length<0x2::Vectors::S>($t1) $t2 := A1_vector_length$A2_Vectors_S$($t1) // $t3 := 1 $t3 := 1 @@ -3138,9 +3138,9 @@ object "test_A2_Vectors_test_one_elem_struct" { $t6 := $MakePtr(false, $locals) // $t7 := 0 $t7 := 0 - // $t8 := vector::borrow($t6, $t7) + // $t8 := vector::borrow<0x2::Vectors::S>($t6, $t7) $t8 := A1_vector_borrow$A2_Vectors_S$($t6, $t7) - // $t9 := borrow_field.x($t8) + // $t9 := borrow_field<0x2::Vectors::S>.x($t8) $t9 := $t8 // $t10 := read_ref($t9) $t10 := $LoadU128($t9) @@ -3171,9 +3171,9 @@ object "test_A2_Vectors_test_one_elem_struct" { $t14 := $MakePtr(false, $locals) // $t15 := 0 $t15 := 0 - // $t16 := vector::borrow($t14, $t15) + // $t16 := vector::borrow<0x2::Vectors::S>($t14, $t15) $t16 := A1_vector_borrow$A2_Vectors_S$($t14, $t15) - // $t17 := borrow_field.y($t16) + // $t17 := borrow_field<0x2::Vectors::S>.y($t16) $t17 := $IndexPtr($t16, 24) // $t18 := read_ref($t17) $t18 := $LoadU8($t17) @@ -3204,9 +3204,9 @@ object "test_A2_Vectors_test_one_elem_struct" { $t22 := $MakePtr(false, $locals) // $t23 := 0 $t23 := 0 - // $t24 := vector::borrow($t22, $t23) + // $t24 := vector::borrow<0x2::Vectors::S>($t22, $t23) $t24 := A1_vector_borrow$A2_Vectors_S$($t22, $t23) - // $t25 := borrow_field.z($t24) + // $t25 := borrow_field<0x2::Vectors::S>.z($t24) $t25 := $IndexPtr($t24, 16) // $t26 := read_ref($t25) $t26 := $LoadU64($t25) @@ -3257,7 +3257,7 @@ object "test_A2_Vectors_test_one_elem_struct" { function A2_Vectors_one_elem_struct() -> $result { let $t1, $t2, $t3, $t4, $t5, $t6 let $locals := $Malloc(32) - // $t0 := vector::empty() + // $t0 := vector::empty<0x2::Vectors::S>() mstore($locals, A1_vector_empty$A2_Vectors_S$()) // $t1 := borrow_local($t0) $t1 := $MakePtr(false, $locals) @@ -3267,7 +3267,7 @@ object "test_A2_Vectors_test_one_elem_struct" { $t3 := true // $t4 := 789 $t4 := 789 - // $t5 := pack Vectors::S($t2, $t3, $t4) + // $t5 := pack 0x2::Vectors::S($t2, $t3, $t4) { let $mem := $Malloc(25) $MemoryStoreU128(add($mem, 0), $t2) @@ -3275,7 +3275,7 @@ object "test_A2_Vectors_test_one_elem_struct" { $MemoryStoreU64(add($mem, 16), $t4) $t5 := $mem } - // vector::push_back($t1, $t5) + // vector::push_back<0x2::Vectors::S>($t1, $t5) A1_vector_push_back$A2_Vectors_S$($t1, $t5) // $t6 := move($t0) $t6 := mload($locals) @@ -6666,9 +6666,9 @@ object "test_A2_Vectors_test_vector_equality_struct" { $Abort($t7) } case 4 { - // $t2 := vector::empty() + // $t2 := vector::empty<0x2::Vectors::R>() mstore($locals, A1_vector_empty$A2_Vectors_R$()) - // $t3 := vector::empty() + // $t3 := vector::empty<0x2::Vectors::R>() mstore(add($locals, 32), A1_vector_empty$A2_Vectors_R$()) // $t4 := copy($t2) $t4 := mload($locals) @@ -6689,7 +6689,7 @@ object "test_A2_Vectors_test_vector_equality_struct" { $t9 := true // $t10 := 9 $t10 := 9 - // $t11 := pack Vectors::S($t8, $t9, $t10) + // $t11 := pack 0x2::Vectors::S($t8, $t9, $t10) { let $mem := $Malloc(25) $MemoryStoreU128(add($mem, 0), $t8) @@ -6699,7 +6699,7 @@ object "test_A2_Vectors_test_vector_equality_struct" { } // $t12 := Vectors::one_elem_u64() $t12 := A2_Vectors_one_elem_u64() - // $t13 := pack Vectors::R($t11, $t12) + // $t13 := pack 0x2::Vectors::R($t11, $t12) { let $mem := $Malloc(64) $MemoryStoreU256(add($mem, 0), $t11) @@ -6708,7 +6708,7 @@ object "test_A2_Vectors_test_vector_equality_struct" { } // $t14 := borrow_local($t2) $t14 := $MakePtr(false, $locals) - // vector::push_back($t14, $t13) + // vector::push_back<0x2::Vectors::R>($t14, $t13) A1_vector_push_back$A2_Vectors_R$($t14, $t13) // $t15 := copy($t2) $t15 := mload($locals) @@ -6737,7 +6737,7 @@ object "test_A2_Vectors_test_vector_equality_struct" { // label L5 // $t19 := borrow_local($t3) $t19 := $MakePtr(false, add($locals, 32)) - // vector::push_back($t19, $t13) + // vector::push_back<0x2::Vectors::R>($t19, $t13) A1_vector_push_back$A2_Vectors_R$($t19, $t13) // $t20 := copy($t2) $t20 := mload($locals) @@ -6770,7 +6770,7 @@ object "test_A2_Vectors_test_vector_equality_struct" { $t25 := false // $t26 := 9 $t26 := 9 - // $t27 := pack Vectors::S($t24, $t25, $t26) + // $t27 := pack 0x2::Vectors::S($t24, $t25, $t26) { let $mem := $Malloc(25) $MemoryStoreU128(add($mem, 0), $t24) @@ -6780,7 +6780,7 @@ object "test_A2_Vectors_test_vector_equality_struct" { } // $t28 := Vectors::one_elem_u64() $t28 := A2_Vectors_one_elem_u64() - // $t29 := pack Vectors::R($t27, $t28) + // $t29 := pack 0x2::Vectors::R($t27, $t28) { let $mem := $Malloc(64) $MemoryStoreU256(add($mem, 0), $t27) @@ -6789,7 +6789,7 @@ object "test_A2_Vectors_test_vector_equality_struct" { } // $t30 := borrow_local($t2) $t30 := $MakePtr(false, $locals) - // vector::push_back($t30, $t13) + // vector::push_back<0x2::Vectors::R>($t30, $t13) A1_vector_push_back$A2_Vectors_R$($t30, $t13) // $t31 := copy($t2) $t31 := mload($locals) @@ -6818,7 +6818,7 @@ object "test_A2_Vectors_test_vector_equality_struct" { // label L11 // $t35 := borrow_local($t3) $t35 := $MakePtr(false, add($locals, 32)) - // vector::push_back($t35, $t29) + // vector::push_back<0x2::Vectors::R>($t35, $t29) A1_vector_push_back$A2_Vectors_R$($t35, $t29) // $t36 := move($t2) $t36 := mload($locals) @@ -7282,7 +7282,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { $t9 := true // $t10 := 9 $t10 := 9 - // $t11 := pack Vectors::S($t8, $t9, $t10) + // $t11 := pack 0x2::Vectors::S($t8, $t9, $t10) { let $mem := $Malloc(25) $MemoryStoreU128(add($mem, 0), $t8) @@ -7292,7 +7292,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { } // $t12 := move($t1) $t12 := mload($locals) - // $t0 := pack Vectors::R($t11, $t12) + // $t0 := pack 0x2::Vectors::R($t11, $t12) { let $mem := $Malloc(64) $MemoryStoreU256(add($mem, 0), $t11) @@ -7301,7 +7301,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { } // $t13 := borrow_local($t0) $t13 := $MakePtr(false, r) - // $t14 := borrow_field.v($t13) + // $t14 := borrow_field<0x2::Vectors::R>.v($t13) $t14 := $IndexPtr($t13, 32) // $t15 := vector::length($t14) $t15 := A1_vector_length$u64$($t14) @@ -7318,7 +7318,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { // label L2 // $t19 := borrow_local($t0) $t19 := $MakePtr(false, r) - // $t20 := borrow_field.v($t19) + // $t20 := borrow_field<0x2::Vectors::R>.v($t19) $t20 := $IndexPtr($t19, 32) // $t21 := 0 $t21 := 0 @@ -7351,7 +7351,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { // label L5 // $t27 := borrow_local($t0) $t27 := $MakePtr(false, r) - // $t28 := borrow_field.v($t27) + // $t28 := borrow_field<0x2::Vectors::R>.v($t27) $t28 := $IndexPtr($t27, 32) // $t29 := 1 $t29 := 1 @@ -7384,7 +7384,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { // label L8 // $t35 := borrow_local($t0) $t35 := $MakePtr(false, r) - // $t36 := borrow_field.v($t35) + // $t36 := borrow_field<0x2::Vectors::R>.v($t35) $t36 := $IndexPtr($t35, 32) // $t37 := 2 $t37 := 2 @@ -7419,7 +7419,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { $t43 := 41 // $t44 := borrow_local($t0) $t44 := $MakePtr(false, r) - // $t45 := borrow_field.v($t44) + // $t45 := borrow_field<0x2::Vectors::R>.v($t44) $t45 := $IndexPtr($t44, 32) // $t46 := 1 $t46 := 1 @@ -7429,7 +7429,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { $StoreU64($t47, $t43) // $t48 := borrow_local($t0) $t48 := $MakePtr(false, r) - // $t49 := borrow_field.v($t48) + // $t49 := borrow_field<0x2::Vectors::R>.v($t48) $t49 := $IndexPtr($t48, 32) // $t50 := 1 $t50 := 1 @@ -7464,7 +7464,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { $t56 := A2_Vectors_one_elem_u64() // $t57 := borrow_local($t0) $t57 := $MakePtr(false, r) - // $t58 := borrow_field.v($t57) + // $t58 := borrow_field<0x2::Vectors::R>.v($t57) $t58 := $IndexPtr($t57, 32) // write_ref($t58, $t56) if $IsStoragePtr($t58){ @@ -7482,7 +7482,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { $StoreU256($t58, $t56) // $t59 := borrow_local($t0) $t59 := $MakePtr(false, r) - // $t60 := borrow_field.v($t59) + // $t60 := borrow_field<0x2::Vectors::R>.v($t59) $t60 := $IndexPtr($t59, 32) // $t61 := vector::length($t60) $t61 := A1_vector_length$u64$($t60) @@ -7511,7 +7511,7 @@ object "test_A2_Vectors_test_vectors_in_structs" { // label L17 // $t65 := borrow_local($t0) $t65 := $MakePtr(false, r) - // $t66 := borrow_field.v($t65) + // $t66 := borrow_field<0x2::Vectors::R>.v($t65) $t66 := $IndexPtr($t65, 32) // $t67 := 0 $t67 := 0 diff --git a/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherArrayDecoding.v2_exp b/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherArrayDecoding.v2_exp index 970b17cc61d8c..8d10b80137a38 100644 --- a/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherArrayDecoding.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherArrayDecoding.v2_exp @@ -461,7 +461,7 @@ object "A2_M" { case 3 { // $t7 := borrow_local($t0) $t7 := $MakePtr(false, $locals) - // $t8 := vector::length>($t7) + // $t8 := vector::length>($t7) $t8 := A1_vector_length$vec$A2_U256_U256$$($t7) // $t9 := 0 $t9 := 0 @@ -488,17 +488,17 @@ object "A2_M" { // label L2 // $t11 := borrow_local($t0) $t11 := $MakePtr(false, $locals) - // $t12 := vector::borrow>($t11, $t1) + // $t12 := vector::borrow>($t11, $t1) $t12 := A1_vector_borrow$vec$A2_U256_U256$$($t11, i) // $t13 := 0 $t13 := 0 - // $t14 := vector::borrow($t12, $t13) + // $t14 := vector::borrow<0x2::U256::U256>($t12, $t13) $t14 := A1_vector_borrow$A2_U256_U256$($t12, $t13) // $t15 := read_ref($t14) $t15 := $LoadU256($t14) // $t16 := 1 $t16 := 1 - // $t17 := vector::borrow($t12, $t16) + // $t17 := vector::borrow<0x2::U256::U256>($t12, $t16) $t17 := A1_vector_borrow$A2_U256_U256$($t12, $t16) // $t18 := read_ref($t17) $t18 := $LoadU256($t17) @@ -689,9 +689,9 @@ object "A2_M" { // label L2 // $t10 := borrow_local($t0) $t10 := $MakePtr(false, $locals) - // $t11 := vector::borrow>($t10, $t1) + // $t11 := vector::borrow>($t10, $t1) $t11 := A1_vector_borrow$vec$A2_U256_U256$$($t10, i) - // $t12 := vector::length($t11) + // $t12 := vector::length<0x2::U256::U256>($t11) $t12 := A1_vector_length$A2_U256_U256$($t11) // $t13 := 0 $t13 := 0 @@ -726,7 +726,7 @@ object "A2_M" { } case 10 { // label L5 - // $t15 := vector::borrow($t11, $t2) + // $t15 := vector::borrow<0x2::U256::U256>($t11, $t2) $t15 := A1_vector_borrow$A2_U256_U256$($t11, j) // $t16 := read_ref($t15) $t16 := $LoadU256($t15) @@ -959,7 +959,7 @@ object "A2_M" { case 3 { // $t7 := borrow_local($t0) $t7 := $MakePtr(false, $locals) - // $t8 := vector::length>($t7) + // $t8 := vector::length>($t7) $t8 := A1_vector_length$vec$A2_U256_U256$$($t7) // $t9 := 0 $t9 := 0 @@ -986,17 +986,17 @@ object "A2_M" { // label L2 // $t11 := borrow_local($t0) $t11 := $MakePtr(false, $locals) - // $t12 := vector::borrow>($t11, $t1) + // $t12 := vector::borrow>($t11, $t1) $t12 := A1_vector_borrow$vec$A2_U256_U256$$($t11, i) // $t13 := 0 $t13 := 0 - // $t14 := vector::borrow($t12, $t13) + // $t14 := vector::borrow<0x2::U256::U256>($t12, $t13) $t14 := A1_vector_borrow$A2_U256_U256$($t12, $t13) // $t15 := read_ref($t14) $t15 := $LoadU256($t14) // $t16 := 1 $t16 := 1 - // $t17 := vector::borrow($t12, $t16) + // $t17 := vector::borrow<0x2::U256::U256>($t12, $t16) $t17 := A1_vector_borrow$A2_U256_U256$($t12, $t16) // $t18 := read_ref($t17) $t18 := $LoadU256($t17) diff --git a/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherBasicStorage.v2_exp b/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherBasicStorage.v2_exp index bc0463b511e92..f18ac758a350e 100644 --- a/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherBasicStorage.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherBasicStorage.v2_exp @@ -26,7 +26,7 @@ object "A2_M" { let $t0, $t1 // $t0 := 0 $t0 := 0 - // $t1 := pack M::Storage($t0) + // $t1 := pack 0x2::M::Storage($t0) { let $mem := $Malloc(8) $MemoryStoreU64(add($mem, 0), $t0) @@ -139,7 +139,7 @@ object "A2_M" { } function A2_M_current(self) -> $result { let $t1, $t2 - // $t1 := borrow_field.counter($t0) + // $t1 := borrow_field<0x2::M::Storage>.counter($t0) $t1 := self // $t2 := read_ref($t1) $t2 := $LoadU64($t1) @@ -149,7 +149,7 @@ object "A2_M" { function A2_M_increment(self) { let $t1, $t2, $t3, $t4, $t5 - // $t1 := borrow_field.counter($t0) + // $t1 := borrow_field<0x2::M::Storage>.counter($t0) $t1 := self // $t2 := read_ref($t1) $t2 := $LoadU64($t1) @@ -157,7 +157,7 @@ object "A2_M" { $t3 := 1 // $t4 := +($t2, $t3) $t4 := $AddU64($t2, $t3) - // $t5 := borrow_field.counter($t0) + // $t5 := borrow_field<0x2::M::Storage>.counter($t0) $t5 := self // write_ref($t5, $t4) $StoreU64($t5, $t4) @@ -166,7 +166,7 @@ object "A2_M" { function A2_M_receive(self) { let $t1, $t2, $t3, $t4, $t5 - // $t1 := borrow_field.counter($t0) + // $t1 := borrow_field<0x2::M::Storage>.counter($t0) $t1 := self // $t2 := read_ref($t1) $t2 := $LoadU64($t1) @@ -174,7 +174,7 @@ object "A2_M" { $t3 := 2 // $t4 := +($t2, $t3) $t4 := $AddU64($t2, $t3) - // $t5 := borrow_field.counter($t0) + // $t5 := borrow_field<0x2::M::Storage>.counter($t0) $t5 := self // write_ref($t5, $t4) $StoreU64($t5, $t4) diff --git a/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherEncodingStorage.v2_exp b/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherEncodingStorage.v2_exp index 9112f59810d17..b748bf5ebed78 100644 --- a/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherEncodingStorage.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/test-dispatcher/DispatcherEncodingStorage.v2_exp @@ -61,13 +61,13 @@ object "A2_M" { $t5 := $MakePtr(false, add($locals, 32)) // $t6 := move($t1) $t6 := mload($locals) - // $t7 := pack M::T($t6) + // $t7 := pack 0x2::M::T($t6) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t6) $t7 := $mem } - // move_to>($t7, $t5) + // move_to<0x2::M::T>($t7, $t5) { let $base_offset := $MakeTypeStorageBase(0, 0x2e75402e, $LoadU256($t5)) if $AlignedStorageLoad($base_offset) { @@ -96,7 +96,7 @@ object "A2_M" { } // $t8 := 0x42 $t8 := 0x42 - // $t9 := borrow_global>($t8) + // $t9 := borrow_global<0x2::M::T>($t8) { let $base_offset := $MakeTypeStorageBase(0, 0x2e75402e, $t8) if iszero($AlignedStorageLoad($base_offset)) { @@ -104,7 +104,7 @@ object "A2_M" { } $t9 := $MakePtr(true, add($base_offset, 32)) } - // $t10 := borrow_field>.v($t9) + // $t10 := borrow_field<0x2::M::T>.v($t9) $t10 := $t9 // $t11 := read_ref($t10) $t11 := $LoadU256($t10) @@ -139,19 +139,19 @@ object "A2_M" { $t4 := 65 // vector::push_back($t3, $t4) A1_vector_push_back$u8$($t3, $t4) - // $t2 := vector::empty() + // $t2 := vector::empty<0x2::U256::U256>() mstore(add($locals, 32), A1_vector_empty$A2_U256_U256$()) // $t5 := borrow_local($t2) $t5 := $MakePtr(false, add($locals, 32)) // $t6 := 64 $t6 := 64 - // vector::push_back($t5, $t6) + // vector::push_back<0x2::U256::U256>($t5, $t6) A1_vector_push_back$A2_U256_U256$($t5, $t6) // $t7 := borrow_local($t2) $t7 := $MakePtr(false, add($locals, 32)) // $t8 := 65 $t8 := 65 - // vector::push_back($t7, $t8) + // vector::push_back<0x2::U256::U256>($t7, $t8) A1_vector_push_back$A2_U256_U256$($t7, $t8) // $t9 := 0x42 $t9 := 0x42 @@ -163,14 +163,14 @@ object "A2_M" { $t11 := mload($locals) // $t12 := move($t2) $t12 := mload(add($locals, 32)) - // $t13 := pack M::State($t11, $t12) + // $t13 := pack 0x2::M::State($t11, $t12) { let $mem := $Malloc(64) $MemoryStoreU256(add($mem, 0), $t11) $MemoryStoreU256(add($mem, 32), $t12) $t13 := $mem } - // move_to($t13, $t10) + // move_to<0x2::M::State>($t13, $t10) { let $base_offset := $MakeTypeStorageBase(0, 0x7d9cc237, $LoadU256($t10)) if $AlignedStorageLoad($base_offset) { @@ -213,7 +213,7 @@ object "A2_M" { } // $t14 := 0x42 $t14 := 0x42 - // $t15 := borrow_global($t14) + // $t15 := borrow_global<0x2::M::State>($t14) { let $base_offset := $MakeTypeStorageBase(0, 0x7d9cc237, $t14) if iszero($AlignedStorageLoad($base_offset)) { @@ -221,7 +221,7 @@ object "A2_M" { } $t15 := $MakePtr(true, add($base_offset, 32)) } - // $t16 := borrow_field.s1($t15) + // $t16 := borrow_field<0x2::M::State>.s1($t15) $t16 := $t15 // $t17 := read_ref($t16) $t17 := $LoadU256($t16) @@ -242,7 +242,7 @@ object "A2_M" { } // $t18 := 0x42 $t18 := 0x42 - // $t19 := borrow_global($t18) + // $t19 := borrow_global<0x2::M::State>($t18) { let $base_offset := $MakeTypeStorageBase(0, 0x7d9cc237, $t18) if iszero($AlignedStorageLoad($base_offset)) { @@ -250,7 +250,7 @@ object "A2_M" { } $t19 := $MakePtr(true, add($base_offset, 32)) } - // $t20 := borrow_field.s2($t19) + // $t20 := borrow_field<0x2::M::State>.s2($t19) $t20 := $IndexPtr($t19, 32) // $t21 := read_ref($t20) $t21 := $LoadU256($t20) diff --git a/third_party/move/evm/move-to-yul/tests/test-dispatcher/ExternalCall.v2_exp b/third_party/move/evm/move-to-yul/tests/test-dispatcher/ExternalCall.v2_exp index a4be571a266c6..3026fbefb4c60 100644 --- a/third_party/move/evm/move-to-yul/tests/test-dispatcher/ExternalCall.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/test-dispatcher/ExternalCall.v2_exp @@ -114,7 +114,7 @@ object "A2_M" { // label L1 // $t4 := move($t1) $t4 := v - // $t5 := ExternalResult::unwrap($t4) + // $t5 := ExternalResult::unwrap<0x2::U256::U256>($t4) $t5 := A2_ExternalResult_unwrap$A2_U256_U256$($t4) // return $t5 $result := $t5 @@ -133,7 +133,7 @@ object "A2_M" { v := A2_M_success(addr) // $t2 := borrow_local($t1) $t2 := $MakePtr(false, v) - // $t3 := ExternalResult::is_ok($t2) + // $t3 := ExternalResult::is_ok<0x2::U256::U256>($t2) $t3 := A2_ExternalResult_is_ok$A2_U256_U256$($t2) // if ($t3) goto L1 else goto L0 switch $t3 @@ -152,7 +152,7 @@ object "A2_M" { // label L1 // $t4 := move($t1) $t4 := v - // $t5 := ExternalResult::unwrap($t4) + // $t5 := ExternalResult::unwrap<0x2::Evm::Unit>($t4) $t5 := A2_ExternalResult_unwrap$A2_Evm_Unit$($t4) // drop($t5) $Free($t5, 1) @@ -169,7 +169,7 @@ object "A2_M" { v := A2_M_test_unit(addr) // $t2 := borrow_local($t1) $t2 := $MakePtr(false, v) - // $t3 := ExternalResult::is_ok($t2) + // $t3 := ExternalResult::is_ok<0x2::Evm::Unit>($t2) $t3 := A2_ExternalResult_is_ok$A2_Evm_Unit$($t2) // if ($t3) goto L1 else goto L0 switch $t3 @@ -197,7 +197,7 @@ object "A2_M" { let data, v, $t2, $t3, $t4, $t5, $t6 // $t2 := 0 $t2 := 0 - // $t3 := vector::empty() + // $t3 := vector::empty<0x2::U256::U256>() $t3 := A1_vector_empty$A2_U256_U256$() // $t4 := 0x3 $t4 := 0x3 @@ -251,7 +251,7 @@ object "A2_M" { // label L0 // $t7 := borrow_local($t1) $t7 := $MakePtr(false, value) - // $t8 := ExternalResult::is_err_reason($t7) + // $t8 := ExternalResult::is_err_reason<0x2::U256::U256>($t7) $t8 := A2_ExternalResult_is_err_reason$A2_U256_U256$($t7) // if ($t8) goto L3 else goto L2 switch $t8 @@ -267,7 +267,7 @@ object "A2_M" { value := A2_M_test_try_call($t3, $t2) // $t4 := borrow_local($t1) $t4 := $MakePtr(false, value) - // $t5 := ExternalResult::is_ok($t4) + // $t5 := ExternalResult::is_ok<0x2::U256::U256>($t4) $t5 := A2_ExternalResult_is_ok$A2_U256_U256$($t4) // if ($t5) goto L1 else goto L0 switch $t5 @@ -286,7 +286,7 @@ object "A2_M" { // label L2 // $t10 := borrow_local($t1) $t10 := $MakePtr(false, value) - // $t11 := ExternalResult::is_panic($t10) + // $t11 := ExternalResult::is_panic<0x2::U256::U256>($t10) $t11 := A2_ExternalResult_is_panic$A2_U256_U256$($t10) // if ($t11) goto L5 else goto L4 switch $t11 @@ -314,12 +314,12 @@ object "A2_M" { function A2_ExternalResult_is_panic$A2_U256_U256$(result) -> $result { let $t1, $t2 - // $t1 := borrow_field>.panic_code($t0) + // $t1 := borrow_field<0x2::ExternalResult::ExternalResult<#0>>.panic_code($t0) { let $field_ptr := $IndexPtr(result, 96) $t1 := $MakePtr($IsStoragePtr($field_ptr), $LoadU256($field_ptr)) } - // $t2 := option::is_some($t1) + // $t2 := option::is_some<0x2::U256::U256>($t1) $t2 := A1_option_is_some$A2_U256_U256$($t1) // return $t2 $result := $t2 @@ -327,7 +327,7 @@ object "A2_M" { function A1_option_is_some$A2_U256_U256$(t) -> $result { let $t1, $t2, $t3 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$A2_U256_U256$($t1) @@ -356,7 +356,7 @@ object "A2_M" { } function A2_ExternalResult_is_ok$A2_U256_U256$(result) -> $result { let $t1, $t2 - // $t1 := borrow_field>.value($t0) + // $t1 := borrow_field<0x2::ExternalResult::ExternalResult<#0>>.value($t0) { $t1 := $MakePtr($IsStoragePtr(result), $LoadU256(result)) } @@ -412,9 +412,9 @@ object "A2_M" { $t2 := A1_option_some$vec$u8$$(error) // $t3 := option::none>() $t3 := A1_option_none$vec$u8$$() - // $t4 := option::none() + // $t4 := option::none<0x2::U256::U256>() $t4 := A1_option_none$A2_U256_U256$() - // $t5 := pack ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) + // $t5 := pack 0x2::ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t1) @@ -431,7 +431,7 @@ object "A2_M" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$A2_U256_U256$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -449,7 +449,7 @@ object "A2_M" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$vec$u8$$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -467,7 +467,7 @@ object "A2_M" { let $t1, $t2 // $t1 := vector::singleton<#0>($t0) $t1 := A1_vector_singleton$vec$u8$$(e) - // $t2 := pack option::Option<#0>($t1) + // $t2 := pack 0x1::option::Option<#0>($t1) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t1) @@ -529,9 +529,9 @@ object "A2_M" { $t6 := A1_option_none$vec$u8$$() // $t7 := option::none>() $t7 := A1_option_none$vec$u8$$() - // $t8 := option::some($t0) + // $t8 := option::some<0x2::U256::U256>($t0) $t8 := A1_option_some$A2_U256_U256$(panic_code) - // $t9 := pack ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) + // $t9 := pack 0x2::ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t5) @@ -548,7 +548,7 @@ object "A2_M" { let $t1, $t2 // $t1 := vector::singleton<#0>($t0) $t1 := A1_vector_singleton$A2_U256_U256$(e) - // $t2 := pack option::Option<#0>($t1) + // $t2 := pack 0x1::option::Option<#0>($t1) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t1) @@ -596,9 +596,9 @@ object "A2_M" { $t6 := A1_option_some$vec$u8$$(error) // $t7 := option::none>() $t7 := A1_option_none$vec$u8$$() - // $t8 := option::none() + // $t8 := option::none<0x2::U256::U256>() $t8 := A1_option_none$A2_U256_U256$() - // $t9 := pack ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) + // $t9 := pack 0x2::ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t5) @@ -619,9 +619,9 @@ object "A2_M" { $t2 := A1_option_none$vec$u8$$() // $t3 := option::none>() $t3 := A1_option_none$vec$u8$$() - // $t4 := option::none() + // $t4 := option::none<0x2::U256::U256>() $t4 := A1_option_none$A2_U256_U256$() - // $t5 := pack ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) + // $t5 := pack 0x2::ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t1) @@ -636,7 +636,7 @@ object "A2_M" { function A2_ExternalResult_is_err_reason$A2_U256_U256$(result) -> $result { let $t1, $t2 - // $t1 := borrow_field>.err_reason($t0) + // $t1 := borrow_field<0x2::ExternalResult::ExternalResult<#0>>.err_reason($t0) { let $field_ptr := $IndexPtr(result, 64) $t1 := $MakePtr($IsStoragePtr($field_ptr), $LoadU256($field_ptr)) @@ -649,7 +649,7 @@ object "A2_M" { function A1_option_is_some$vec$u8$$(t) -> $result { let $t1, $t2, $t3 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$vec$u8$$($t1) @@ -742,7 +742,7 @@ object "A2_M" { } function A2_ExternalResult_is_ok$A2_Evm_Unit$(result) -> $result { let $t1, $t2 - // $t1 := borrow_field>.value($t0) + // $t1 := borrow_field<0x2::ExternalResult::ExternalResult<#0>>.value($t0) { $t1 := $MakePtr($IsStoragePtr(result), $LoadU256(result)) } @@ -754,7 +754,7 @@ object "A2_M" { function A1_option_is_some$A2_Evm_Unit$(t) -> $result { let $t1, $t2, $t3 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$A2_Evm_Unit$($t1) @@ -827,9 +827,9 @@ object "A2_M" { $t2 := A1_option_some$vec$u8$$(error) // $t3 := option::none>() $t3 := A1_option_none$vec$u8$$() - // $t4 := option::none() + // $t4 := option::none<0x2::U256::U256>() $t4 := A1_option_none$A2_U256_U256$() - // $t5 := pack ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) + // $t5 := pack 0x2::ExternalResult::ExternalResult<#0>($t1, $t2, $t3, $t4) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t1) @@ -846,7 +846,7 @@ object "A2_M" { let $t0, $t1 // $t0 := vector::empty<#0>() $t0 := A1_vector_empty$A2_Evm_Unit$() - // $t1 := pack option::Option<#0>($t0) + // $t1 := pack 0x1::option::Option<#0>($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), $t0) @@ -868,9 +868,9 @@ object "A2_M" { $t6 := A1_option_none$vec$u8$$() // $t7 := option::none>() $t7 := A1_option_none$vec$u8$$() - // $t8 := option::some($t0) + // $t8 := option::some<0x2::U256::U256>($t0) $t8 := A1_option_some$A2_U256_U256$(panic_code) - // $t9 := pack ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) + // $t9 := pack 0x2::ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t5) @@ -891,9 +891,9 @@ object "A2_M" { $t6 := A1_option_some$vec$u8$$(error) // $t7 := option::none>() $t7 := A1_option_none$vec$u8$$() - // $t8 := option::none() + // $t8 := option::none<0x2::U256::U256>() $t8 := A1_option_none$A2_U256_U256$() - // $t9 := pack ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) + // $t9 := pack 0x2::ExternalResult::ExternalResult<#0>($t5, $t7, $t6, $t8) { let $mem := $Malloc(128) $MemoryStoreU256(add($mem, 0), $t5) @@ -908,7 +908,7 @@ object "A2_M" { function A2_ExternalResult_unwrap$A2_Evm_Unit$(result) -> $result { let err_data, err_reason, panic_code, value, $t5, $t6, $t7, $t8, $t9 - // ($t5, $t6, $t7, $t8) := unpack ExternalResult::ExternalResult<#0>($t0) + // ($t5, $t6, $t7, $t8) := unpack 0x2::ExternalResult::ExternalResult<#0>($t0) $t5 := $MemoryLoadU256(add(result, 0)) $t6 := $MemoryLoadU256(add(result, 32)) $t7 := $MemoryLoadU256(add(result, 64)) @@ -918,7 +918,7 @@ object "A2_M" { A1_option_destroy_none$vec$u8$$($t6) // option::destroy_none>($t7) A1_option_destroy_none$vec$u8$$($t7) - // option::destroy_none($t8) + // option::destroy_none<0x2::U256::U256>($t8) A1_option_destroy_none$A2_U256_U256$($t8) // $t9 := option::destroy_some<#0>($t5) $t9 := A1_option_destroy_some$A2_Evm_Unit$($t5) @@ -958,7 +958,7 @@ object "A2_M" { // label L2 // $t6 := move($t0) $t6 := t - // $t2 := unpack option::Option<#0>($t6) + // $t2 := unpack 0x1::option::Option<#0>($t6) mstore($locals, $MemoryLoadU256(add($t6, 0))) $Free($t6, 32) // $t7 := borrow_local($t2) @@ -1031,7 +1031,7 @@ object "A2_M" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -1050,7 +1050,7 @@ object "A2_M" { } function A1_option_is_none$A2_U256_U256$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$A2_U256_U256$($t1) @@ -1089,7 +1089,7 @@ object "A2_M" { // label L2 // $t4 := move($t0) $t4 := t - // $t5 := unpack option::Option<#0>($t4) + // $t5 := unpack 0x1::option::Option<#0>($t4) $t5 := $MemoryLoadU256(add($t4, 0)) $Free($t4, 32) // vector::destroy_empty<#0>($t5) @@ -1108,7 +1108,7 @@ object "A2_M" { } function A1_option_is_none$vec$u8$$(t) -> $result { let $t1, $t2 - // $t1 := borrow_field>.vec($t0) + // $t1 := borrow_field<0x1::option::Option<#0>>.vec($t0) $t1 := t // $t2 := vector::is_empty<#0>($t1) $t2 := A1_vector_is_empty$vec$u8$$($t1) @@ -1164,7 +1164,7 @@ object "A2_M" { function A2_ExternalResult_unwrap$A2_U256_U256$(result) -> $result { let err_data, err_reason, panic_code, value, $t5, $t6, $t7, $t8, $t9 - // ($t5, $t6, $t7, $t8) := unpack ExternalResult::ExternalResult<#0>($t0) + // ($t5, $t6, $t7, $t8) := unpack 0x2::ExternalResult::ExternalResult<#0>($t0) $t5 := $MemoryLoadU256(add(result, 0)) $t6 := $MemoryLoadU256(add(result, 32)) $t7 := $MemoryLoadU256(add(result, 64)) @@ -1174,7 +1174,7 @@ object "A2_M" { A1_option_destroy_none$vec$u8$$($t6) // option::destroy_none>($t7) A1_option_destroy_none$vec$u8$$($t7) - // option::destroy_none($t8) + // option::destroy_none<0x2::U256::U256>($t8) A1_option_destroy_none$A2_U256_U256$($t8) // $t9 := option::destroy_some<#0>($t5) $t9 := A1_option_destroy_some$A2_U256_U256$($t5) @@ -1214,7 +1214,7 @@ object "A2_M" { // label L2 // $t6 := move($t0) $t6 := t - // $t2 := unpack option::Option<#0>($t6) + // $t2 := unpack 0x1::option::Option<#0>($t6) mstore($locals, $MemoryLoadU256(add($t6, 0))) $Free($t6, 32) // $t7 := borrow_local($t2) diff --git a/third_party/move/evm/move-to-yul/tests/test-events/CallEmit.v2_exp b/third_party/move/evm/move-to-yul/tests/test-events/CallEmit.v2_exp index ab8e443702abe..57270d396370a 100644 --- a/third_party/move/evm/move-to-yul/tests/test-events/CallEmit.v2_exp +++ b/third_party/move/evm/move-to-yul/tests/test-events/CallEmit.v2_exp @@ -137,7 +137,7 @@ object "A2_M" { $Abort(97) function A2_M_do_event_1(from, to, amount) { let $t3 - // $t3 := pack M::Event_1($t0, $t1, $t2) + // $t3 := pack 0x2::M::Event_1($t0, $t1, $t2) { let $mem := $Malloc(65) $MemoryStoreU8(add($mem, 64), from) @@ -145,14 +145,14 @@ object "A2_M" { $MemoryStoreU256(add($mem, 32), amount) $t3 := $mem } - // Evm::emit($t3) + // Evm::emit<0x2::M::Event_1>($t3) A2_Evm_emit$A2_M_Event_1$($t3) // return () } function A2_M_do_event_2(v1, v2, v3, v4) { let $t4 - // $t4 := pack M::Event_2($t0, $t1, $t2, $t3) + // $t4 := pack 0x2::M::Event_2($t0, $t1, $t2, $t3) { let $mem := $Malloc(73) $MemoryStoreU8(add($mem, 72), v1) @@ -161,14 +161,14 @@ object "A2_M" { $MemoryStoreU256(add($mem, 0), v4) $t4 := $mem } - // Evm::emit($t4) + // Evm::emit<0x2::M::Event_2>($t4) A2_Evm_emit$A2_M_Event_2$($t4) // return () } function A2_M_do_event_3(from, to, amount) { let $t3 - // $t3 := pack M::Event_3($t0, $t1, $t2) + // $t3 := pack 0x2::M::Event_3($t0, $t1, $t2) { let $mem := $Malloc(65) $MemoryStoreU8(add($mem, 64), from) @@ -176,14 +176,14 @@ object "A2_M" { $MemoryStoreU256(add($mem, 32), amount) $t3 := $mem } - // Evm::emit($t3) + // Evm::emit<0x2::M::Event_3>($t3) A2_Evm_emit$A2_M_Event_3$($t3) // return () } function A2_M_do_event_4(v1, v2, v3) { let $t3 - // $t3 := pack M::Event_4($t0, $t1, $t2) + // $t3 := pack 0x2::M::Event_4($t0, $t1, $t2) { let $mem := $Malloc(96) $MemoryStoreU256(add($mem, 0), v1) @@ -191,28 +191,28 @@ object "A2_M" { $MemoryStoreU256(add($mem, 64), v3) $t3 := $mem } - // Evm::emit($t3) + // Evm::emit<0x2::M::Event_4>($t3) A2_Evm_emit$A2_M_Event_4$($t3) // return () } function A2_M_do_event_5(bys, str) { let $t2 - // $t2 := pack M::Event_5($t0, $t1) + // $t2 := pack 0x2::M::Event_5($t0, $t1) { let $mem := $Malloc(64) $MemoryStoreU256(add($mem, 0), bys) $MemoryStoreU256(add($mem, 32), str) $t2 := $mem } - // Evm::emit($t2) + // Evm::emit<0x2::M::Event_5>($t2) A2_Evm_emit$A2_M_Event_5$($t2) // return () } function A2_M_do_event_6(bys, str, uint16_array) { let $t3 - // $t3 := pack M::Event_6($t0, $t1, $t2) + // $t3 := pack 0x2::M::Event_6($t0, $t1, $t2) { let $mem := $Malloc(96) $MemoryStoreU256(add($mem, 0), bys) @@ -220,41 +220,41 @@ object "A2_M" { $MemoryStoreU256(add($mem, 64), uint16_array) $t3 := $mem } - // Evm::emit($t3) + // Evm::emit<0x2::M::Event_6>($t3) A2_Evm_emit$A2_M_Event_6$($t3) // return () } function A2_M_do_event_7(bys) { let $t1 - // $t1 := pack M::Event_7($t0) + // $t1 := pack 0x2::M::Event_7($t0) { let $mem := $Malloc(32) $MemoryStoreU256(add($mem, 0), bys) $t1 := $mem } - // Evm::emit($t1) + // Evm::emit<0x2::M::Event_7>($t1) A2_Evm_emit$A2_M_Event_7$($t1) // return () } function A2_M_do_event_8(bys, strs) { let $t2 - // $t2 := pack M::Event_8($t0, $t1) + // $t2 := pack 0x2::M::Event_8($t0, $t1) { let $mem := $Malloc(64) $MemoryStoreU256(add($mem, 0), bys) $MemoryStoreU256(add($mem, 32), strs) $t2 := $mem } - // Evm::emit($t2) + // Evm::emit<0x2::M::Event_8>($t2) A2_Evm_emit$A2_M_Event_8$($t2) // return () } function A2_M_do_transfer(from, to, amount) { let $t3 - // $t3 := pack M::Transfer($t0, $t1, $t2) + // $t3 := pack 0x2::M::Transfer($t0, $t1, $t2) { let $mem := $Malloc(96) $MemoryStoreU256(add($mem, 0), from) @@ -262,7 +262,7 @@ object "A2_M" { $MemoryStoreU256(add($mem, 64), amount) $t3 := $mem } - // Evm::emit($t3) + // Evm::emit<0x2::M::Transfer>($t3) A2_Evm_emit$A2_M_Transfer$($t3) // return () } diff --git a/third_party/move/move-bytecode-verifier/transactional-tests/tests/type_safety/gerbens_test.v2_exp b/third_party/move/move-bytecode-verifier/transactional-tests/tests/type_safety/gerbens_test.v2_exp index 0d2a8cf708b95..367e3b6d0b831 100644 --- a/third_party/move/move-bytecode-verifier/transactional-tests/tests/type_safety/gerbens_test.v2_exp +++ b/third_party/move/move-bytecode-verifier/transactional-tests/tests/type_safety/gerbens_test.v2_exp @@ -6,6 +6,6 @@ Error: compilation errors: ┌─ TEMPFILE:9:16 │ 9 │ public fun for_each_ref(v: &vector, f: |&Element|) { - │ ^^^^^^^^^^^^ - Parameter `f` has a function type. + │ ^^^^^^^^^^^^ - Parameter `f` has function-valued type `|&Element|`. diff --git a/third_party/move/move-compiler/transactional-tests/tests/inlining/objects.exp b/third_party/move/move-compiler/transactional-tests/tests/inlining/objects.exp index fc5a4436b29d4..c5676312fe22b 100644 --- a/third_party/move/move-compiler/transactional-tests/tests/inlining/objects.exp +++ b/third_party/move/move-compiler/transactional-tests/tests/inlining/objects.exp @@ -1 +1,133 @@ processed 3 tasks + +task 1 'publish'. lines 76-101: +Error: error[E03002]: unbound module + ┌─ TEMPFILE1:78:9 + │ +78 │ use 0x42::objects as obj; + │ ^^^^^^^^^^^^^ Invalid 'use'. Unbound module: '0x42::objects' + +error[E03002]: unbound module + ┌─ TEMPFILE1:80:48 + │ +80 │ public fun create(signer: &signer, owner: &obj::OwnerRef, val: u64) { + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:81:9 + │ +81 │ obj::create(signer, owner, Token{val}) + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:83:31 + │ +83 │ public fun reader_ref(r: &obj::OwnerRef): obj::ReaderRef { + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:83:47 + │ +83 │ public fun reader_ref(r: &obj::OwnerRef): obj::ReaderRef { + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:84:9 + │ +84 │ obj::reader_ref(r) + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:86:31 + │ +86 │ public fun writer_ref(r: &obj::OwnerRef): obj::WriterRef { + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:86:47 + │ +86 │ public fun writer_ref(r: &obj::OwnerRef): obj::WriterRef { + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:87:9 + │ +87 │ obj::writer_ref(r) + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:89:32 + │ +89 │ public fun get_value(ref: &obj::ReaderRef): u64 acquires Token { + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:90:9 + │ +90 │ obj::reader(ref).val + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:92:32 + │ +92 │ public fun set_value(ref: &obj::WriterRef, val: u64) acquires Token { + │ ^^^ Unbound module or type alias 'obj' + +error[E03002]: unbound module + ┌─ TEMPFILE1:93:9 + │ +93 │ obj::writer(ref).val = val + │ ^^^ Unbound module or type alias 'obj' + + + +task 2 'run'. lines 103-115: +Error: error[E03002]: unbound module + ┌─ TEMPFILE2:105:9 + │ +105 │ use 0x42::token; + │ ^^^^^^^^^^^ Invalid 'use'. Unbound module: '0x42::token' + +error[E03002]: unbound module + ┌─ TEMPFILE2:107:18 + │ +107 │ let or = 0x42::objects::make_owner_ref(@0x42); + │ ^^^^^^^^^^^^^ Unbound module '0x42::objects' + +error[E03002]: unbound module + ┌─ TEMPFILE2:108:9 + │ +108 │ token::create(&s, &or, 22); + │ ^^^^^ Unbound module or type alias 'token' + +error[E03002]: unbound module + ┌─ TEMPFILE2:109:18 + │ +109 │ let rr = token::reader_ref(&or); + │ ^^^^^ Unbound module or type alias 'token' + +error[E03002]: unbound module + ┌─ TEMPFILE2:110:18 + │ +110 │ let wr = token::writer_ref(&or); + │ ^^^^^ Unbound module or type alias 'token' + +error[E03002]: unbound module + ┌─ TEMPFILE2:111:17 + │ +111 │ assert!(token::get_value(&rr) == 22, 0); + │ ^^^^^ Unbound module or type alias 'token' + +error[E03002]: unbound module + ┌─ TEMPFILE2:112:9 + │ +112 │ token::set_value(&wr, 23); + │ ^^^^^ Unbound module or type alias 'token' + +error[E03002]: unbound module + ┌─ TEMPFILE2:113:17 + │ +113 │ assert!(token::get_value(&rr) == 23, 1) + │ ^^^^^ Unbound module or type alias 'token' + + diff --git a/third_party/move/move-model/bytecode/tests/borrow/basic_test.v2_exp b/third_party/move/move-model/bytecode/tests/borrow/basic_test.v2_exp index 56d9c7305b1cd..642a1c7f3fa3e 100644 --- a/third_party/move/move-model/bytecode/tests/borrow/basic_test.v2_exp +++ b/third_party/move/move-model/bytecode/tests/borrow/basic_test.v2_exp @@ -1,21 +1,21 @@ ============ initial translation from Move ================ [variant baseline] -fun TestBorrow::test1(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test1(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1|x_ref: &mut u64 var $t2: u64 - var $t3: TestBorrow::R - var $t4: &mut TestBorrow::R + var $t3: 0x42::TestBorrow::R + var $t4: &mut 0x42::TestBorrow::R var $t5: &mut u64 var $t6: u64 var $t7: &mut u64 - var $t8: TestBorrow::R + var $t8: 0x42::TestBorrow::R 0: $t2 := 3 - 1: $t3 := pack TestBorrow::R($t2) + 1: $t3 := pack 0x42::TestBorrow::R($t2) 2: $t0 := $t3 3: $t4 := borrow_local($t0) - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::TestBorrow::R>.x($t4) 5: $t1 := $t5 6: $t6 := 0 7: $t7 := move($t1) @@ -37,12 +37,12 @@ fun TestBorrow::test2($t0|x_ref: &mut u64, $t1|v: u64) { [variant baseline] -public fun TestBorrow::test3($t0|r_ref: &mut TestBorrow::R, $t1|v: u64) { - var $t2: &mut TestBorrow::R +public fun TestBorrow::test3($t0|r_ref: &mut 0x42::TestBorrow::R, $t1|v: u64) { + var $t2: &mut 0x42::TestBorrow::R var $t3: &mut u64 var $t4: u64 0: $t2 := move($t0) - 1: $t3 := borrow_field.x($t2) + 1: $t3 := borrow_field<0x42::TestBorrow::R>.x($t2) 2: $t4 := move($t1) 3: TestBorrow::test2($t3, $t4) 4: return () @@ -50,15 +50,15 @@ public fun TestBorrow::test3($t0|r_ref: &mut TestBorrow::R, $t1|v: u64) { [variant baseline] -fun TestBorrow::test4(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test4(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1: u64 - var $t2: TestBorrow::R - var $t3: &mut TestBorrow::R + var $t2: 0x42::TestBorrow::R + var $t3: &mut 0x42::TestBorrow::R var $t4: u64 - var $t5: TestBorrow::R + var $t5: 0x42::TestBorrow::R 0: $t1 := 3 - 1: $t2 := pack TestBorrow::R($t1) + 1: $t2 := pack 0x42::TestBorrow::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := 0 @@ -69,26 +69,26 @@ fun TestBorrow::test4(): TestBorrow::R { [variant baseline] -public fun TestBorrow::test5($t0|r_ref: &mut TestBorrow::R): &mut u64 { - var $t1: &mut TestBorrow::R +public fun TestBorrow::test5($t0|r_ref: &mut 0x42::TestBorrow::R): &mut u64 { + var $t1: &mut 0x42::TestBorrow::R var $t2: &mut u64 0: $t1 := move($t0) - 1: $t2 := borrow_field.x($t1) + 1: $t2 := borrow_field<0x42::TestBorrow::R>.x($t1) 2: return $t2 } [variant baseline] -fun TestBorrow::test6(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test6(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1: u64 - var $t2: TestBorrow::R - var $t3: &mut TestBorrow::R + var $t2: 0x42::TestBorrow::R + var $t3: &mut 0x42::TestBorrow::R var $t4: &mut u64 var $t5: u64 - var $t6: TestBorrow::R + var $t6: 0x42::TestBorrow::R 0: $t1 := 3 - 1: $t2 := pack TestBorrow::R($t1) + 1: $t2 := pack 0x42::TestBorrow::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := TestBorrow::test5($t3) @@ -101,24 +101,24 @@ fun TestBorrow::test6(): TestBorrow::R { [variant baseline] fun TestBorrow::test7($t0|b: bool) { - var $t1|r1: TestBorrow::R - var $t2|r2: TestBorrow::R - var $t3|r_ref: &mut TestBorrow::R + var $t1|r1: 0x42::TestBorrow::R + var $t2|r2: 0x42::TestBorrow::R + var $t3|r_ref: &mut 0x42::TestBorrow::R var $t4: u64 - var $t5: TestBorrow::R + var $t5: 0x42::TestBorrow::R var $t6: u64 - var $t7: TestBorrow::R - var $t8: &mut TestBorrow::R + var $t7: 0x42::TestBorrow::R + var $t8: &mut 0x42::TestBorrow::R var $t9: bool - var $t10: &mut TestBorrow::R - var $t11: &mut TestBorrow::R - var $t12: &mut TestBorrow::R + var $t10: &mut 0x42::TestBorrow::R + var $t11: &mut 0x42::TestBorrow::R + var $t12: &mut 0x42::TestBorrow::R var $t13: u64 0: $t4 := 3 - 1: $t5 := pack TestBorrow::R($t4) + 1: $t5 := pack 0x42::TestBorrow::R($t4) 2: $t1 := $t5 3: $t6 := 4 - 4: $t7 := pack TestBorrow::R($t6) + 4: $t7 := pack 0x42::TestBorrow::R($t6) 5: $t2 := $t7 6: $t8 := borrow_local($t1) 7: $t3 := $t8 @@ -139,41 +139,41 @@ fun TestBorrow::test7($t0|b: bool) { [variant baseline] -fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestBorrow::R) { - var $t3|r1: TestBorrow::R - var $t4|r2: TestBorrow::R - var $t5|t_ref: &mut TestBorrow::R +fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut 0x42::TestBorrow::R) { + var $t3|r1: 0x42::TestBorrow::R + var $t4|r2: 0x42::TestBorrow::R + var $t5|t_ref: &mut 0x42::TestBorrow::R var $t6: u64 - var $t7: TestBorrow::R + var $t7: 0x42::TestBorrow::R var $t8: u64 - var $t9: TestBorrow::R - var $t10: &mut TestBorrow::R + var $t9: 0x42::TestBorrow::R + var $t10: &mut 0x42::TestBorrow::R var $t11: u64 var $t12: u64 var $t13: bool - var $t14: &mut TestBorrow::R + var $t14: &mut 0x42::TestBorrow::R var $t15: u64 var $t16: u64 var $t17: u64 var $t18: u64 var $t19: bool - var $t20: &mut TestBorrow::R - var $t21: &mut TestBorrow::R + var $t20: &mut 0x42::TestBorrow::R + var $t21: &mut 0x42::TestBorrow::R var $t22: u64 var $t23: u64 var $t24: u64 var $t25: bool - var $t26: &mut TestBorrow::R - var $t27: &mut TestBorrow::R + var $t26: &mut 0x42::TestBorrow::R + var $t27: &mut 0x42::TestBorrow::R var $t28: u64 - var $t29: &mut TestBorrow::R - var $t30: &mut TestBorrow::R + var $t29: &mut 0x42::TestBorrow::R + var $t30: &mut 0x42::TestBorrow::R var $t31: u64 0: $t6 := 3 - 1: $t7 := pack TestBorrow::R($t6) + 1: $t7 := pack 0x42::TestBorrow::R($t6) 2: $t3 := $t7 3: $t8 := 4 - 4: $t9 := pack TestBorrow::R($t8) + 4: $t9 := pack 0x42::TestBorrow::R($t8) 5: $t4 := $t9 6: $t10 := borrow_local($t4) 7: $t5 := $t10 @@ -232,21 +232,21 @@ fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestBorrow::R) { ============ after pipeline `borrow` ================ [variant baseline] -fun TestBorrow::test1(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test1(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1|x_ref: &mut u64 [unused] var $t2: u64 - var $t3: &mut TestBorrow::R + var $t3: &mut 0x42::TestBorrow::R var $t4: &mut u64 var $t5: u64 - var $t6: TestBorrow::R + var $t6: 0x42::TestBorrow::R 0: $t2 := 3 - 1: $t0 := pack TestBorrow::R($t2) + 1: $t0 := pack 0x42::TestBorrow::R($t2) 2: $t3 := borrow_local($t0) # live_nodes: Reference($t3) # borrowed_by: LocalRoot($t0) -> {(@, Reference($t3))} # borrows_from: Reference($t3) -> {(@, LocalRoot($t0))} - 3: $t4 := borrow_field.x($t3) + 3: $t4 := borrow_field<0x42::TestBorrow::R>.x($t3) # live_nodes: Reference($t4) # borrowed_by: LocalRoot($t0) -> {(@, Reference($t3))}, Reference($t3) -> {(.x (u64), Reference($t4))} # borrows_from: Reference($t3) -> {(@, LocalRoot($t0))}, Reference($t4) -> {(.x (u64), Reference($t3))} @@ -275,10 +275,10 @@ fun TestBorrow::test2($t0|x_ref: &mut u64, $t1|v: u64) { [variant baseline] -public fun TestBorrow::test3($t0|r_ref: &mut TestBorrow::R, $t1|v: u64) { +public fun TestBorrow::test3($t0|r_ref: &mut 0x42::TestBorrow::R, $t1|v: u64) { var $t2: &mut u64 # live_nodes: LocalRoot($t1), Reference($t0) - 0: $t2 := borrow_field.x($t0) + 0: $t2 := borrow_field<0x42::TestBorrow::R>.x($t0) # live_nodes: LocalRoot($t1), Reference($t2) # borrowed_by: Reference($t0) -> {(.x (u64), Reference($t2))} # borrows_from: Reference($t2) -> {(.x (u64), Reference($t0))} @@ -291,14 +291,14 @@ public fun TestBorrow::test3($t0|r_ref: &mut TestBorrow::R, $t1|v: u64) { [variant baseline] -fun TestBorrow::test4(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test4(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1: u64 - var $t2: &mut TestBorrow::R + var $t2: &mut 0x42::TestBorrow::R var $t3: u64 - var $t4: TestBorrow::R + var $t4: 0x42::TestBorrow::R 0: $t1 := 3 - 1: $t0 := pack TestBorrow::R($t1) + 1: $t0 := pack 0x42::TestBorrow::R($t1) 2: $t2 := borrow_local($t0) # live_nodes: Reference($t2) # borrowed_by: LocalRoot($t0) -> {(@, Reference($t2))} @@ -319,10 +319,10 @@ fun TestBorrow::test4(): TestBorrow::R { [variant baseline] -public fun TestBorrow::test5($t0|r_ref: &mut TestBorrow::R): &mut u64 { +public fun TestBorrow::test5($t0|r_ref: &mut 0x42::TestBorrow::R): &mut u64 { var $t1: &mut u64 # live_nodes: Reference($t0) - 0: $t1 := borrow_field.x($t0) + 0: $t1 := borrow_field<0x42::TestBorrow::R>.x($t0) # live_nodes: Reference($t1) # borrowed_by: Reference($t0) -> {(.x (u64), Reference($t1))} # borrows_from: Reference($t1) -> {(.x (u64), Reference($t0))} @@ -331,15 +331,15 @@ public fun TestBorrow::test5($t0|r_ref: &mut TestBorrow::R): &mut u64 { [variant baseline] -fun TestBorrow::test6(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test6(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1: u64 - var $t2: &mut TestBorrow::R + var $t2: &mut 0x42::TestBorrow::R var $t3: &mut u64 var $t4: u64 - var $t5: TestBorrow::R + var $t5: 0x42::TestBorrow::R 0: $t1 := 3 - 1: $t0 := pack TestBorrow::R($t1) + 1: $t0 := pack 0x42::TestBorrow::R($t1) 2: $t2 := borrow_local($t0) # live_nodes: Reference($t2) # borrowed_by: LocalRoot($t0) -> {(@, Reference($t2))} @@ -365,22 +365,22 @@ fun TestBorrow::test6(): TestBorrow::R { [variant baseline] fun TestBorrow::test7($t0|b: bool) { - var $t1|r1: TestBorrow::R - var $t2|r2: TestBorrow::R - var $t3|r_ref: &mut TestBorrow::R + var $t1|r1: 0x42::TestBorrow::R + var $t2|r2: 0x42::TestBorrow::R + var $t3|r_ref: &mut 0x42::TestBorrow::R var $t4: u64 var $t5: u64 - var $t6: &mut TestBorrow::R - var $t7: &mut TestBorrow::R + var $t6: &mut 0x42::TestBorrow::R + var $t7: &mut 0x42::TestBorrow::R var $t8: u64 # live_nodes: LocalRoot($t0) 0: $t4 := 3 # live_nodes: LocalRoot($t0) - 1: $t1 := pack TestBorrow::R($t4) + 1: $t1 := pack 0x42::TestBorrow::R($t4) # live_nodes: LocalRoot($t0) 2: $t5 := 4 # live_nodes: LocalRoot($t0) - 3: $t2 := pack TestBorrow::R($t5) + 3: $t2 := pack 0x42::TestBorrow::R($t5) # live_nodes: LocalRoot($t0) 4: $t6 := borrow_local($t1) # live_nodes: LocalRoot($t0), Reference($t6) @@ -455,32 +455,32 @@ fun TestBorrow::test7($t0|b: bool) { [variant baseline] -fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestBorrow::R) { - var $t3|r1: TestBorrow::R - var $t4|r2: TestBorrow::R - var $t5|t_ref: &mut TestBorrow::R +fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut 0x42::TestBorrow::R) { + var $t3|r1: 0x42::TestBorrow::R + var $t4|r2: 0x42::TestBorrow::R + var $t5|t_ref: &mut 0x42::TestBorrow::R var $t6: u64 var $t7: u64 - var $t8: &mut TestBorrow::R + var $t8: &mut 0x42::TestBorrow::R var $t9: u64 var $t10: bool var $t11: u64 var $t12: u64 var $t13: u64 var $t14: bool - var $t15: &mut TestBorrow::R - var $t16: &mut TestBorrow::R + var $t15: &mut 0x42::TestBorrow::R + var $t16: &mut 0x42::TestBorrow::R var $t17: u64 var $t18: u64 var $t19: u64 # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) 0: $t6 := 3 # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) - 1: $t3 := pack TestBorrow::R($t6) + 1: $t3 := pack 0x42::TestBorrow::R($t6) # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) 2: $t7 := 4 # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) - 3: $t4 := pack TestBorrow::R($t7) + 3: $t4 := pack 0x42::TestBorrow::R($t7) # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) 4: $t8 := borrow_local($t4) # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2), Reference($t8) diff --git a/third_party/move/move-model/bytecode/tests/borrow/function_call.v2_exp b/third_party/move/move-model/bytecode/tests/borrow/function_call.v2_exp index 38764bb039850..076624b485816 100644 --- a/third_party/move/move-model/bytecode/tests/borrow/function_call.v2_exp +++ b/third_party/move/move-model/bytecode/tests/borrow/function_call.v2_exp @@ -78,23 +78,23 @@ public intrinsic fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64) [variant baseline] -fun MultiLayerCalling::inner($t0|has_vector: &mut MultiLayerCalling::HasVector): &mut MultiLayerCalling::HasAnotherVector { - var $t1: &mut MultiLayerCalling::HasVector - var $t2: &mut vector +fun MultiLayerCalling::inner($t0|has_vector: &mut 0x2::MultiLayerCalling::HasVector): &mut 0x2::MultiLayerCalling::HasAnotherVector { + var $t1: &mut 0x2::MultiLayerCalling::HasVector + var $t2: &mut vector<0x2::MultiLayerCalling::HasAnotherVector> var $t3: u64 - var $t4: &mut MultiLayerCalling::HasAnotherVector + var $t4: &mut 0x2::MultiLayerCalling::HasAnotherVector 0: $t1 := move($t0) - 1: $t2 := borrow_field.v($t1) + 1: $t2 := borrow_field<0x2::MultiLayerCalling::HasVector>.v($t1) 2: $t3 := 7 - 3: $t4 := vector::borrow_mut($t2, $t3) + 3: $t4 := vector::borrow_mut<0x2::MultiLayerCalling::HasAnotherVector>($t2, $t3) 4: return $t4 } [variant baseline] -fun MultiLayerCalling::mid($t0|has_vector: &mut MultiLayerCalling::HasVector): &mut MultiLayerCalling::HasAnotherVector { - var $t1: &mut MultiLayerCalling::HasVector - var $t2: &mut MultiLayerCalling::HasAnotherVector +fun MultiLayerCalling::mid($t0|has_vector: &mut 0x2::MultiLayerCalling::HasVector): &mut 0x2::MultiLayerCalling::HasAnotherVector { + var $t1: &mut 0x2::MultiLayerCalling::HasVector + var $t2: &mut 0x2::MultiLayerCalling::HasAnotherVector 0: $t1 := move($t0) 1: $t2 := MultiLayerCalling::inner($t1) 2: return $t2 @@ -102,14 +102,14 @@ fun MultiLayerCalling::mid($t0|has_vector: &mut MultiLayerCalling::HasVector): & [variant baseline] -fun MultiLayerCalling::outer($t0|has_vector: &mut MultiLayerCalling::HasVector) { - var $t1: &mut MultiLayerCalling::HasVector - var $t2: &mut MultiLayerCalling::HasAnotherVector +fun MultiLayerCalling::outer($t0|has_vector: &mut 0x2::MultiLayerCalling::HasVector) { + var $t1: &mut 0x2::MultiLayerCalling::HasVector + var $t2: &mut 0x2::MultiLayerCalling::HasAnotherVector var $t3: &mut vector var $t4: u8 0: $t1 := move($t0) 1: $t2 := MultiLayerCalling::mid($t1) - 2: $t3 := borrow_field.v($t2) + 2: $t3 := borrow_field<0x2::MultiLayerCalling::HasAnotherVector>.v($t2) 3: $t4 := 42 4: vector::push_back($t3, $t4) 5: return () @@ -202,60 +202,60 @@ public intrinsic fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64) [variant baseline] -fun MultiLayerCalling::inner($t0|has_vector: &mut MultiLayerCalling::HasVector): &mut MultiLayerCalling::HasAnotherVector { - var $t1: &mut vector +fun MultiLayerCalling::inner($t0|has_vector: &mut 0x2::MultiLayerCalling::HasVector): &mut 0x2::MultiLayerCalling::HasAnotherVector { + var $t1: &mut vector<0x2::MultiLayerCalling::HasAnotherVector> var $t2: u64 - var $t3: &mut MultiLayerCalling::HasAnotherVector + var $t3: &mut 0x2::MultiLayerCalling::HasAnotherVector # live_nodes: Reference($t0) - 0: $t1 := borrow_field.v($t0) + 0: $t1 := borrow_field<0x2::MultiLayerCalling::HasVector>.v($t0) # live_nodes: Reference($t1) - # borrowed_by: Reference($t0) -> {(.v (vector), Reference($t1))} - # borrows_from: Reference($t1) -> {(.v (vector), Reference($t0))} + # borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>), Reference($t1))} + # borrows_from: Reference($t1) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>), Reference($t0))} 1: $t2 := 7 # live_nodes: Reference($t1) - # borrowed_by: Reference($t0) -> {(.v (vector), Reference($t1))} - # borrows_from: Reference($t1) -> {(.v (vector), Reference($t0))} - 2: $t3 := vector::borrow_mut($t1, $t2) + # borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>), Reference($t1))} + # borrows_from: Reference($t1) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>), Reference($t0))} + 2: $t3 := vector::borrow_mut<0x2::MultiLayerCalling::HasAnotherVector>($t1, $t2) # live_nodes: Reference($t3) - # borrowed_by: Reference($t0) -> {(.v (vector), Reference($t1))}, Reference($t1) -> {([], Reference($t3))} - # borrows_from: Reference($t1) -> {(.v (vector), Reference($t0))}, Reference($t3) -> {([], Reference($t1))} + # borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>), Reference($t1))}, Reference($t1) -> {([], Reference($t3))} + # borrows_from: Reference($t1) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>), Reference($t0))}, Reference($t3) -> {([], Reference($t1))} 3: return $t3 } [variant baseline] -fun MultiLayerCalling::mid($t0|has_vector: &mut MultiLayerCalling::HasVector): &mut MultiLayerCalling::HasAnotherVector { - var $t1: &mut MultiLayerCalling::HasAnotherVector +fun MultiLayerCalling::mid($t0|has_vector: &mut 0x2::MultiLayerCalling::HasVector): &mut 0x2::MultiLayerCalling::HasAnotherVector { + var $t1: &mut 0x2::MultiLayerCalling::HasAnotherVector # live_nodes: Reference($t0) 0: $t1 := MultiLayerCalling::inner($t0) # live_nodes: Reference($t1) - # borrowed_by: Reference($t0) -> {(.v (vector)/[], Reference($t1))} - # borrows_from: Reference($t1) -> {(.v (vector)/[], Reference($t0))} + # borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t1))} + # borrows_from: Reference($t1) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t0))} 1: return $t1 } [variant baseline] -fun MultiLayerCalling::outer($t0|has_vector: &mut MultiLayerCalling::HasVector) { - var $t1: &mut MultiLayerCalling::HasAnotherVector +fun MultiLayerCalling::outer($t0|has_vector: &mut 0x2::MultiLayerCalling::HasVector) { + var $t1: &mut 0x2::MultiLayerCalling::HasAnotherVector var $t2: &mut vector var $t3: u8 # live_nodes: Reference($t0) 0: $t1 := MultiLayerCalling::mid($t0) # live_nodes: Reference($t1) - # borrowed_by: Reference($t0) -> {(.v (vector)/[], Reference($t1))} - # borrows_from: Reference($t1) -> {(.v (vector)/[], Reference($t0))} - 1: $t2 := borrow_field.v($t1) + # borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t1))} + # borrows_from: Reference($t1) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t0))} + 1: $t2 := borrow_field<0x2::MultiLayerCalling::HasAnotherVector>.v($t1) # live_nodes: Reference($t2) - # borrowed_by: Reference($t0) -> {(.v (vector)/[], Reference($t1))}, Reference($t1) -> {(.v (vector), Reference($t2))} - # borrows_from: Reference($t1) -> {(.v (vector)/[], Reference($t0))}, Reference($t2) -> {(.v (vector), Reference($t1))} + # borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t1))}, Reference($t1) -> {(.v (vector), Reference($t2))} + # borrows_from: Reference($t1) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t0))}, Reference($t2) -> {(.v (vector), Reference($t1))} 2: $t3 := 42 # live_nodes: Reference($t2) - # borrowed_by: Reference($t0) -> {(.v (vector)/[], Reference($t1))}, Reference($t1) -> {(.v (vector), Reference($t2))} - # borrows_from: Reference($t1) -> {(.v (vector)/[], Reference($t0))}, Reference($t2) -> {(.v (vector), Reference($t1))} + # borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t1))}, Reference($t1) -> {(.v (vector), Reference($t2))} + # borrows_from: Reference($t1) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t0))}, Reference($t2) -> {(.v (vector), Reference($t1))} 3: vector::push_back($t2, $t3) - # borrowed_by: Reference($t0) -> {(.v (vector)/[], Reference($t1))}, Reference($t1) -> {(.v (vector), Reference($t2))} - # borrows_from: Reference($t1) -> {(.v (vector)/[], Reference($t0))}, Reference($t2) -> {(.v (vector), Reference($t1))} + # borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t1))}, Reference($t1) -> {(.v (vector), Reference($t2))} + # borrows_from: Reference($t1) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t0))}, Reference($t2) -> {(.v (vector), Reference($t1))} 4: return () } @@ -268,9 +268,9 @@ borrowed_by: Reference($t0) -> {([], Return(0))} borrows_from: Return(0) -> {([], Reference($t0))} fun MultiLayerCalling::inner[baseline] -borrowed_by: Reference($t0) -> {(.v (vector)/[], Return(0))} -borrows_from: Return(0) -> {(.v (vector)/[], Reference($t0))} +borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Return(0))} +borrows_from: Return(0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t0))} fun MultiLayerCalling::mid[baseline] -borrowed_by: Reference($t0) -> {(.v (vector)/[], Return(0))} -borrows_from: Return(0) -> {(.v (vector)/[], Reference($t0))} +borrowed_by: Reference($t0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Return(0))} +borrows_from: Return(0) -> {(.v (vector<0x2::MultiLayerCalling::HasAnotherVector>)/[], Reference($t0))} diff --git a/third_party/move/move-model/bytecode/tests/borrow/hyper_edge.v2_exp b/third_party/move/move-model/bytecode/tests/borrow/hyper_edge.v2_exp index 40b0b00802900..43729e7c1a943 100644 --- a/third_party/move/move-model/bytecode/tests/borrow/hyper_edge.v2_exp +++ b/third_party/move/move-model/bytecode/tests/borrow/hyper_edge.v2_exp @@ -78,13 +78,13 @@ public intrinsic fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64) [variant baseline] -public fun Collection::borrow_mut<#0>($t0|c: &mut Collection::Collection<#0>, $t1|i: u64): &mut #0 { - var $t2: &mut Collection::Collection<#0> +public fun Collection::borrow_mut<#0>($t0|c: &mut 0x2::Collection::Collection<#0>, $t1|i: u64): &mut #0 { + var $t2: &mut 0x2::Collection::Collection<#0> var $t3: &mut vector<#0> var $t4: u64 var $t5: &mut #0 0: $t2 := move($t0) - 1: $t3 := borrow_field>.items($t2) + 1: $t3 := borrow_field<0x2::Collection::Collection<#0>>.items($t2) 2: $t4 := move($t1) 3: $t5 := vector::borrow_mut<#0>($t3, $t4) 4: return $t5 @@ -92,37 +92,37 @@ public fun Collection::borrow_mut<#0>($t0|c: &mut Collection::Collection<#0>, $t [variant baseline] -public fun Collection::make_collection<#0>(): Collection::Collection<#0> { +public fun Collection::make_collection<#0>(): 0x2::Collection::Collection<#0> { var $t0: vector<#0> var $t1: address - var $t2: Collection::Collection<#0> + var $t2: 0x2::Collection::Collection<#0> 0: $t0 := vector::empty<#0>() 1: $t1 := 0x2 - 2: $t2 := pack Collection::Collection<#0>($t0, $t1) + 2: $t2 := pack 0x2::Collection::Collection<#0>($t0, $t1) 3: return $t2 } [variant baseline] public fun Test::foo<#0>($t0|i: u64) { - var $t1|c: Collection::Collection> - var $t2|t: &mut Test::Token<#0> - var $t3: Collection::Collection> - var $t4: &mut Collection::Collection> + var $t1|c: 0x2::Collection::Collection<0x2::Test::Token<#0>> + var $t2|t: &mut 0x2::Test::Token<#0> + var $t3: 0x2::Collection::Collection<0x2::Test::Token<#0>> + var $t4: &mut 0x2::Collection::Collection<0x2::Test::Token<#0>> var $t5: u64 - var $t6: &mut Test::Token<#0> + var $t6: &mut 0x2::Test::Token<#0> var $t7: u64 - var $t8: &mut Test::Token<#0> + var $t8: &mut 0x2::Test::Token<#0> var $t9: &mut u64 - 0: $t3 := Collection::make_collection>() + 0: $t3 := Collection::make_collection<0x2::Test::Token<#0>>() 1: $t1 := $t3 2: $t4 := borrow_local($t1) 3: $t5 := move($t0) - 4: $t6 := Collection::borrow_mut>($t4, $t5) + 4: $t6 := Collection::borrow_mut<0x2::Test::Token<#0>>($t4, $t5) 5: $t2 := $t6 6: $t7 := 0 7: $t8 := move($t2) - 8: $t9 := borrow_field>.value($t8) + 8: $t9 := borrow_field<0x2::Test::Token<#0>>.value($t8) 9: write_ref($t9, $t7) 10: return () } @@ -214,11 +214,11 @@ public intrinsic fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64) [variant baseline] -public fun Collection::borrow_mut<#0>($t0|c: &mut Collection::Collection<#0>, $t1|i: u64): &mut #0 { +public fun Collection::borrow_mut<#0>($t0|c: &mut 0x2::Collection::Collection<#0>, $t1|i: u64): &mut #0 { var $t2: &mut vector<#0> var $t3: &mut #0 # live_nodes: LocalRoot($t1), Reference($t0) - 0: $t2 := borrow_field>.items($t0) + 0: $t2 := borrow_field<0x2::Collection::Collection<#0>>.items($t0) # live_nodes: LocalRoot($t1), Reference($t2) # borrowed_by: Reference($t0) -> {(.items (vector<#0>), Reference($t2))} # borrows_from: Reference($t2) -> {(.items (vector<#0>), Reference($t0))} @@ -231,48 +231,48 @@ public fun Collection::borrow_mut<#0>($t0|c: &mut Collection::Collection<#0>, $t [variant baseline] -public fun Collection::make_collection<#0>(): Collection::Collection<#0> { +public fun Collection::make_collection<#0>(): 0x2::Collection::Collection<#0> { var $t0: vector<#0> var $t1: address - var $t2: Collection::Collection<#0> + var $t2: 0x2::Collection::Collection<#0> 0: $t0 := vector::empty<#0>() 1: $t1 := 0x2 - 2: $t2 := pack Collection::Collection<#0>($t0, $t1) + 2: $t2 := pack 0x2::Collection::Collection<#0>($t0, $t1) 3: return $t2 } [variant baseline] public fun Test::foo<#0>($t0|i: u64) { - var $t1|c: Collection::Collection> - var $t2|t: &mut Test::Token<#0> [unused] - var $t3: &mut Collection::Collection> - var $t4: &mut Test::Token<#0> + var $t1|c: 0x2::Collection::Collection<0x2::Test::Token<#0>> + var $t2|t: &mut 0x2::Test::Token<#0> [unused] + var $t3: &mut 0x2::Collection::Collection<0x2::Test::Token<#0>> + var $t4: &mut 0x2::Test::Token<#0> var $t5: u64 var $t6: &mut u64 # live_nodes: LocalRoot($t0) - 0: $t1 := Collection::make_collection>() + 0: $t1 := Collection::make_collection<0x2::Test::Token<#0>>() # live_nodes: LocalRoot($t0) 1: $t3 := borrow_local($t1) # live_nodes: LocalRoot($t0), Reference($t3) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))} # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))} - 2: $t4 := Collection::borrow_mut>($t3, $t0) + 2: $t4 := Collection::borrow_mut<0x2::Test::Token<#0>>($t3, $t0) # live_nodes: LocalRoot($t0), Reference($t4) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))}, Reference($t3) -> {(.items (vector>)/[], Reference($t4))} - # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))}, Reference($t4) -> {(.items (vector>)/[], Reference($t3))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))}, Reference($t3) -> {(.items (vector<0x2::Test::Token<#0>>)/[], Reference($t4))} + # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))}, Reference($t4) -> {(.items (vector<0x2::Test::Token<#0>>)/[], Reference($t3))} 3: $t5 := 0 # live_nodes: LocalRoot($t0), Reference($t4) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))}, Reference($t3) -> {(.items (vector>)/[], Reference($t4))} - # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))}, Reference($t4) -> {(.items (vector>)/[], Reference($t3))} - 4: $t6 := borrow_field>.value($t4) + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))}, Reference($t3) -> {(.items (vector<0x2::Test::Token<#0>>)/[], Reference($t4))} + # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))}, Reference($t4) -> {(.items (vector<0x2::Test::Token<#0>>)/[], Reference($t3))} + 4: $t6 := borrow_field<0x2::Test::Token<#0>>.value($t4) # live_nodes: LocalRoot($t0), Reference($t6) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))}, Reference($t3) -> {(.items (vector>)/[], Reference($t4))}, Reference($t4) -> {(.value (u64), Reference($t6))} - # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))}, Reference($t4) -> {(.items (vector>)/[], Reference($t3))}, Reference($t6) -> {(.value (u64), Reference($t4))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))}, Reference($t3) -> {(.items (vector<0x2::Test::Token<#0>>)/[], Reference($t4))}, Reference($t4) -> {(.value (u64), Reference($t6))} + # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))}, Reference($t4) -> {(.items (vector<0x2::Test::Token<#0>>)/[], Reference($t3))}, Reference($t6) -> {(.value (u64), Reference($t4))} 5: write_ref($t6, $t5) # live_nodes: LocalRoot($t0) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))}, Reference($t3) -> {(.items (vector>)/[], Reference($t4))}, Reference($t4) -> {(.value (u64), Reference($t6))} - # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))}, Reference($t4) -> {(.items (vector>)/[], Reference($t3))}, Reference($t6) -> {(.value (u64), Reference($t4))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t3))}, Reference($t3) -> {(.items (vector<0x2::Test::Token<#0>>)/[], Reference($t4))}, Reference($t4) -> {(.value (u64), Reference($t6))} + # borrows_from: Reference($t3) -> {(@, LocalRoot($t1))}, Reference($t4) -> {(.items (vector<0x2::Test::Token<#0>>)/[], Reference($t3))}, Reference($t6) -> {(.value (u64), Reference($t4))} 6: return () } diff --git a/third_party/move/move-model/bytecode/tests/borrow_strong/basic_test.v2_exp b/third_party/move/move-model/bytecode/tests/borrow_strong/basic_test.v2_exp index 306d38d91de86..14b016a0701ea 100644 --- a/third_party/move/move-model/bytecode/tests/borrow_strong/basic_test.v2_exp +++ b/third_party/move/move-model/bytecode/tests/borrow_strong/basic_test.v2_exp @@ -1,23 +1,23 @@ ============ initial translation from Move ================ [variant baseline] -fun TestBorrow::test1(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test1(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1|x_ref: &mut u64 var $t2: u64 var $t3: u64 - var $t4: TestBorrow::R - var $t5: &mut TestBorrow::R + var $t4: 0x42::TestBorrow::R + var $t5: &mut 0x42::TestBorrow::R var $t6: &mut u64 var $t7: u64 var $t8: &mut u64 - var $t9: TestBorrow::R + var $t9: 0x42::TestBorrow::R 0: $t2 := 3 1: $t3 := 4 - 2: $t4 := pack TestBorrow::R($t2, $t3) + 2: $t4 := pack 0x42::TestBorrow::R($t2, $t3) 3: $t0 := $t4 4: $t5 := borrow_local($t0) - 5: $t6 := borrow_field.x($t5) + 5: $t6 := borrow_field<0x42::TestBorrow::R>.x($t5) 6: $t1 := $t6 7: $t7 := 0 8: $t8 := move($t1) @@ -28,33 +28,33 @@ fun TestBorrow::test1(): TestBorrow::R { [variant baseline] -fun TestBorrow::test10($t0|b: bool): TestBorrow::R { - var $t1|r: TestBorrow::R +fun TestBorrow::test10($t0|b: bool): 0x42::TestBorrow::R { + var $t1|r: 0x42::TestBorrow::R var $t2|r_field: &mut u64 - var $t3|r_ref: &mut TestBorrow::R + var $t3|r_ref: &mut 0x42::TestBorrow::R var $t4: u64 var $t5: u64 - var $t6: TestBorrow::R - var $t7: &mut TestBorrow::R - var $t8: &mut TestBorrow::R + var $t6: 0x42::TestBorrow::R + var $t7: &mut 0x42::TestBorrow::R + var $t8: &mut 0x42::TestBorrow::R var $t9: &mut u64 var $t10: bool var $t11: &mut u64 var $t12: bool - var $t13: &mut TestBorrow::R + var $t13: &mut 0x42::TestBorrow::R var $t14: &mut u64 - var $t15: &mut TestBorrow::R + var $t15: &mut 0x42::TestBorrow::R var $t16: u64 var $t17: &mut u64 - var $t18: TestBorrow::R + var $t18: 0x42::TestBorrow::R 0: $t4 := 3 1: $t5 := 4 - 2: $t6 := pack TestBorrow::R($t4, $t5) + 2: $t6 := pack 0x42::TestBorrow::R($t4, $t5) 3: $t1 := $t6 4: $t7 := borrow_local($t1) 5: $t3 := $t7 6: $t8 := copy($t3) - 7: $t9 := borrow_field.x($t8) + 7: $t9 := borrow_field<0x42::TestBorrow::R>.x($t8) 8: $t2 := $t9 9: $t10 := copy($t0) 10: if ($t10) goto 11 else goto 19 @@ -91,12 +91,12 @@ fun TestBorrow::test2($t0|x_ref: &mut u64, $t1|v: u64) { [variant baseline] -public fun TestBorrow::test3($t0|r_ref: &mut TestBorrow::R, $t1|v: u64) { - var $t2: &mut TestBorrow::R +public fun TestBorrow::test3($t0|r_ref: &mut 0x42::TestBorrow::R, $t1|v: u64) { + var $t2: &mut 0x42::TestBorrow::R var $t3: &mut u64 var $t4: u64 0: $t2 := move($t0) - 1: $t3 := borrow_field.x($t2) + 1: $t3 := borrow_field<0x42::TestBorrow::R>.x($t2) 2: $t4 := move($t1) 3: TestBorrow::test2($t3, $t4) 4: return () @@ -104,17 +104,17 @@ public fun TestBorrow::test3($t0|r_ref: &mut TestBorrow::R, $t1|v: u64) { [variant baseline] -fun TestBorrow::test4(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test4(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1: u64 var $t2: u64 - var $t3: TestBorrow::R - var $t4: &mut TestBorrow::R + var $t3: 0x42::TestBorrow::R + var $t4: &mut 0x42::TestBorrow::R var $t5: u64 - var $t6: TestBorrow::R + var $t6: 0x42::TestBorrow::R 0: $t1 := 3 1: $t2 := 4 - 2: $t3 := pack TestBorrow::R($t1, $t2) + 2: $t3 := pack 0x42::TestBorrow::R($t1, $t2) 3: $t0 := $t3 4: $t4 := borrow_local($t0) 5: $t5 := 0 @@ -125,28 +125,28 @@ fun TestBorrow::test4(): TestBorrow::R { [variant baseline] -public fun TestBorrow::test5($t0|r_ref: &mut TestBorrow::R): &mut u64 { - var $t1: &mut TestBorrow::R +public fun TestBorrow::test5($t0|r_ref: &mut 0x42::TestBorrow::R): &mut u64 { + var $t1: &mut 0x42::TestBorrow::R var $t2: &mut u64 0: $t1 := move($t0) - 1: $t2 := borrow_field.x($t1) + 1: $t2 := borrow_field<0x42::TestBorrow::R>.x($t1) 2: return $t2 } [variant baseline] -fun TestBorrow::test6(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test6(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1: u64 var $t2: u64 - var $t3: TestBorrow::R - var $t4: &mut TestBorrow::R + var $t3: 0x42::TestBorrow::R + var $t4: &mut 0x42::TestBorrow::R var $t5: &mut u64 var $t6: u64 - var $t7: TestBorrow::R + var $t7: 0x42::TestBorrow::R 0: $t1 := 3 1: $t2 := 4 - 2: $t3 := pack TestBorrow::R($t1, $t2) + 2: $t3 := pack 0x42::TestBorrow::R($t1, $t2) 3: $t0 := $t3 4: $t4 := borrow_local($t0) 5: $t5 := TestBorrow::test5($t4) @@ -159,28 +159,28 @@ fun TestBorrow::test6(): TestBorrow::R { [variant baseline] fun TestBorrow::test7($t0|b: bool) { - var $t1|r1: TestBorrow::R - var $t2|r2: TestBorrow::R - var $t3|r_ref: &mut TestBorrow::R + var $t1|r1: 0x42::TestBorrow::R + var $t2|r2: 0x42::TestBorrow::R + var $t3|r_ref: &mut 0x42::TestBorrow::R var $t4: u64 var $t5: u64 - var $t6: TestBorrow::R + var $t6: 0x42::TestBorrow::R var $t7: u64 var $t8: u64 - var $t9: TestBorrow::R - var $t10: &mut TestBorrow::R + var $t9: 0x42::TestBorrow::R + var $t10: &mut 0x42::TestBorrow::R var $t11: bool - var $t12: &mut TestBorrow::R - var $t13: &mut TestBorrow::R - var $t14: &mut TestBorrow::R + var $t12: &mut 0x42::TestBorrow::R + var $t13: &mut 0x42::TestBorrow::R + var $t14: &mut 0x42::TestBorrow::R var $t15: u64 0: $t4 := 3 1: $t5 := 4 - 2: $t6 := pack TestBorrow::R($t4, $t5) + 2: $t6 := pack 0x42::TestBorrow::R($t4, $t5) 3: $t1 := $t6 4: $t7 := 4 5: $t8 := 5 - 6: $t9 := pack TestBorrow::R($t7, $t8) + 6: $t9 := pack 0x42::TestBorrow::R($t7, $t8) 7: $t2 := $t9 8: $t10 := borrow_local($t1) 9: $t3 := $t10 @@ -201,45 +201,45 @@ fun TestBorrow::test7($t0|b: bool) { [variant baseline] -fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestBorrow::R) { - var $t3|r1: TestBorrow::R - var $t4|r2: TestBorrow::R - var $t5|t_ref: &mut TestBorrow::R +fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut 0x42::TestBorrow::R) { + var $t3|r1: 0x42::TestBorrow::R + var $t4|r2: 0x42::TestBorrow::R + var $t5|t_ref: &mut 0x42::TestBorrow::R var $t6: u64 var $t7: u64 - var $t8: TestBorrow::R + var $t8: 0x42::TestBorrow::R var $t9: u64 var $t10: u64 - var $t11: TestBorrow::R - var $t12: &mut TestBorrow::R + var $t11: 0x42::TestBorrow::R + var $t12: &mut 0x42::TestBorrow::R var $t13: u64 var $t14: u64 var $t15: bool - var $t16: &mut TestBorrow::R + var $t16: &mut 0x42::TestBorrow::R var $t17: u64 var $t18: u64 var $t19: u64 var $t20: u64 var $t21: bool - var $t22: &mut TestBorrow::R - var $t23: &mut TestBorrow::R + var $t22: &mut 0x42::TestBorrow::R + var $t23: &mut 0x42::TestBorrow::R var $t24: u64 var $t25: u64 var $t26: u64 var $t27: bool - var $t28: &mut TestBorrow::R - var $t29: &mut TestBorrow::R + var $t28: &mut 0x42::TestBorrow::R + var $t29: &mut 0x42::TestBorrow::R var $t30: u64 - var $t31: &mut TestBorrow::R - var $t32: &mut TestBorrow::R + var $t31: &mut 0x42::TestBorrow::R + var $t32: &mut 0x42::TestBorrow::R var $t33: u64 0: $t6 := 3 1: $t7 := 4 - 2: $t8 := pack TestBorrow::R($t6, $t7) + 2: $t8 := pack 0x42::TestBorrow::R($t6, $t7) 3: $t3 := $t8 4: $t9 := 4 5: $t10 := 5 - 6: $t11 := pack TestBorrow::R($t9, $t10) + 6: $t11 := pack 0x42::TestBorrow::R($t9, $t10) 7: $t4 := $t11 8: $t12 := borrow_local($t4) 9: $t5 := $t12 @@ -297,20 +297,20 @@ fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestBorrow::R) { [variant baseline] -fun TestBorrow::test9($t0|b: bool, $t1|r_ref: &mut TestBorrow::R): &mut u64 { +fun TestBorrow::test9($t0|b: bool, $t1|r_ref: &mut 0x42::TestBorrow::R): &mut u64 { var $t2|r_field: &mut u64 - var $t3: &mut TestBorrow::R + var $t3: &mut 0x42::TestBorrow::R var $t4: &mut u64 var $t5: bool var $t6: &mut u64 - var $t7: &mut TestBorrow::R + var $t7: &mut 0x42::TestBorrow::R var $t8: &mut u64 - var $t9: &mut TestBorrow::R + var $t9: &mut 0x42::TestBorrow::R var $t10: u64 var $t11: &mut u64 var $t12: &mut u64 0: $t3 := copy($t1) - 1: $t4 := borrow_field.x($t3) + 1: $t4 := borrow_field<0x42::TestBorrow::R>.x($t3) 2: $t2 := $t4 3: $t5 := move($t0) 4: if ($t5) goto 5 else goto 12 @@ -318,7 +318,7 @@ fun TestBorrow::test9($t0|b: bool, $t1|r_ref: &mut TestBorrow::R): &mut u64 { 6: $t6 := move($t2) 7: drop($t6) 8: $t7 := move($t1) - 9: $t8 := borrow_field.y($t7) + 9: $t8 := borrow_field<0x42::TestBorrow::R>.y($t7) 10: $t2 := $t8 11: goto 16 12: label L0 @@ -336,23 +336,23 @@ fun TestBorrow::test9($t0|b: bool, $t1|r_ref: &mut TestBorrow::R): &mut u64 { ============ after pipeline `borrow_strong` ================ [variant baseline] -fun TestBorrow::test1(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test1(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1|x_ref: &mut u64 [unused] var $t2: u64 var $t3: u64 - var $t4: &mut TestBorrow::R + var $t4: &mut 0x42::TestBorrow::R var $t5: &mut u64 var $t6: u64 - var $t7: TestBorrow::R + var $t7: 0x42::TestBorrow::R 0: $t2 := 3 1: $t3 := 4 - 2: $t0 := pack TestBorrow::R($t2, $t3) + 2: $t0 := pack 0x42::TestBorrow::R($t2, $t3) 3: $t4 := borrow_local($t0) # live_nodes: Reference($t4) # borrowed_by: LocalRoot($t0) -> {(@, Reference($t4))} # borrows_from: Reference($t4) -> {(@, LocalRoot($t0))} - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::TestBorrow::R>.x($t4) # live_nodes: Reference($t5) # borrowed_by: LocalRoot($t0) -> {(@, Reference($t4))}, Reference($t4) -> {(.x (u64), Reference($t5))} # borrows_from: Reference($t4) -> {(@, LocalRoot($t0))}, Reference($t5) -> {(.x (u64), Reference($t4))} @@ -372,28 +372,28 @@ fun TestBorrow::test1(): TestBorrow::R { [variant baseline] -fun TestBorrow::test10($t0|b: bool): TestBorrow::R { - var $t1|r: TestBorrow::R +fun TestBorrow::test10($t0|b: bool): 0x42::TestBorrow::R { + var $t1|r: 0x42::TestBorrow::R var $t2|r_field: &mut u64 - var $t3|r_ref: &mut TestBorrow::R [unused] + var $t3|r_ref: &mut 0x42::TestBorrow::R [unused] var $t4: u64 var $t5: u64 - var $t6: &mut TestBorrow::R + var $t6: &mut 0x42::TestBorrow::R var $t7: &mut u64 var $t8: u64 - var $t9: TestBorrow::R + var $t9: 0x42::TestBorrow::R # live_nodes: LocalRoot($t0) 0: $t4 := 3 # live_nodes: LocalRoot($t0) 1: $t5 := 4 # live_nodes: LocalRoot($t0) - 2: $t1 := pack TestBorrow::R($t4, $t5) + 2: $t1 := pack 0x42::TestBorrow::R($t4, $t5) # live_nodes: LocalRoot($t0) 3: $t6 := borrow_local($t1) # live_nodes: LocalRoot($t0), Reference($t6) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t6))} # borrows_from: Reference($t6) -> {(@, LocalRoot($t1))} - 4: $t7 := borrow_field.x($t6) + 4: $t7 := borrow_field<0x42::TestBorrow::R>.x($t6) # live_nodes: LocalRoot($t0), Reference($t6), Reference($t7) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t6))}, Reference($t6) -> {(.x (u64), Reference($t7))} # borrows_from: Reference($t6) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(.x (u64), Reference($t6))} @@ -487,10 +487,10 @@ fun TestBorrow::test2($t0|x_ref: &mut u64, $t1|v: u64) { [variant baseline] -public fun TestBorrow::test3($t0|r_ref: &mut TestBorrow::R, $t1|v: u64) { +public fun TestBorrow::test3($t0|r_ref: &mut 0x42::TestBorrow::R, $t1|v: u64) { var $t2: &mut u64 # live_nodes: LocalRoot($t1), Reference($t0) - 0: $t2 := borrow_field.x($t0) + 0: $t2 := borrow_field<0x42::TestBorrow::R>.x($t0) # live_nodes: LocalRoot($t1), Reference($t2) # borrowed_by: Reference($t0) -> {(.x (u64), Reference($t2))} # borrows_from: Reference($t2) -> {(.x (u64), Reference($t0))} @@ -503,16 +503,16 @@ public fun TestBorrow::test3($t0|r_ref: &mut TestBorrow::R, $t1|v: u64) { [variant baseline] -fun TestBorrow::test4(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test4(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1: u64 var $t2: u64 - var $t3: &mut TestBorrow::R + var $t3: &mut 0x42::TestBorrow::R var $t4: u64 - var $t5: TestBorrow::R + var $t5: 0x42::TestBorrow::R 0: $t1 := 3 1: $t2 := 4 - 2: $t0 := pack TestBorrow::R($t1, $t2) + 2: $t0 := pack 0x42::TestBorrow::R($t1, $t2) 3: $t3 := borrow_local($t0) # live_nodes: Reference($t3) # borrowed_by: LocalRoot($t0) -> {(@, Reference($t3))} @@ -533,10 +533,10 @@ fun TestBorrow::test4(): TestBorrow::R { [variant baseline] -public fun TestBorrow::test5($t0|r_ref: &mut TestBorrow::R): &mut u64 { +public fun TestBorrow::test5($t0|r_ref: &mut 0x42::TestBorrow::R): &mut u64 { var $t1: &mut u64 # live_nodes: Reference($t0) - 0: $t1 := borrow_field.x($t0) + 0: $t1 := borrow_field<0x42::TestBorrow::R>.x($t0) # live_nodes: Reference($t1) # borrowed_by: Reference($t0) -> {(.x (u64), Reference($t1))} # borrows_from: Reference($t1) -> {(.x (u64), Reference($t0))} @@ -545,17 +545,17 @@ public fun TestBorrow::test5($t0|r_ref: &mut TestBorrow::R): &mut u64 { [variant baseline] -fun TestBorrow::test6(): TestBorrow::R { - var $t0|r: TestBorrow::R +fun TestBorrow::test6(): 0x42::TestBorrow::R { + var $t0|r: 0x42::TestBorrow::R var $t1: u64 var $t2: u64 - var $t3: &mut TestBorrow::R + var $t3: &mut 0x42::TestBorrow::R var $t4: &mut u64 var $t5: u64 - var $t6: TestBorrow::R + var $t6: 0x42::TestBorrow::R 0: $t1 := 3 1: $t2 := 4 - 2: $t0 := pack TestBorrow::R($t1, $t2) + 2: $t0 := pack 0x42::TestBorrow::R($t1, $t2) 3: $t3 := borrow_local($t0) # live_nodes: Reference($t3) # borrowed_by: LocalRoot($t0) -> {(@, Reference($t3))} @@ -581,28 +581,28 @@ fun TestBorrow::test6(): TestBorrow::R { [variant baseline] fun TestBorrow::test7($t0|b: bool) { - var $t1|r1: TestBorrow::R - var $t2|r2: TestBorrow::R - var $t3|r_ref: &mut TestBorrow::R + var $t1|r1: 0x42::TestBorrow::R + var $t2|r2: 0x42::TestBorrow::R + var $t3|r_ref: &mut 0x42::TestBorrow::R var $t4: u64 var $t5: u64 var $t6: u64 var $t7: u64 - var $t8: &mut TestBorrow::R - var $t9: &mut TestBorrow::R + var $t8: &mut 0x42::TestBorrow::R + var $t9: &mut 0x42::TestBorrow::R var $t10: u64 # live_nodes: LocalRoot($t0) 0: $t4 := 3 # live_nodes: LocalRoot($t0) 1: $t5 := 4 # live_nodes: LocalRoot($t0) - 2: $t1 := pack TestBorrow::R($t4, $t5) + 2: $t1 := pack 0x42::TestBorrow::R($t4, $t5) # live_nodes: LocalRoot($t0) 3: $t6 := 4 # live_nodes: LocalRoot($t0) 4: $t7 := 5 # live_nodes: LocalRoot($t0) - 5: $t2 := pack TestBorrow::R($t6, $t7) + 5: $t2 := pack 0x42::TestBorrow::R($t6, $t7) # live_nodes: LocalRoot($t0) 6: $t8 := borrow_local($t1) # live_nodes: LocalRoot($t0), Reference($t8) @@ -677,23 +677,23 @@ fun TestBorrow::test7($t0|b: bool) { [variant baseline] -fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestBorrow::R) { - var $t3|r1: TestBorrow::R - var $t4|r2: TestBorrow::R - var $t5|t_ref: &mut TestBorrow::R +fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut 0x42::TestBorrow::R) { + var $t3|r1: 0x42::TestBorrow::R + var $t4|r2: 0x42::TestBorrow::R + var $t5|t_ref: &mut 0x42::TestBorrow::R var $t6: u64 var $t7: u64 var $t8: u64 var $t9: u64 - var $t10: &mut TestBorrow::R + var $t10: &mut 0x42::TestBorrow::R var $t11: u64 var $t12: bool var $t13: u64 var $t14: u64 var $t15: u64 var $t16: bool - var $t17: &mut TestBorrow::R - var $t18: &mut TestBorrow::R + var $t17: &mut 0x42::TestBorrow::R + var $t18: &mut 0x42::TestBorrow::R var $t19: u64 var $t20: u64 var $t21: u64 @@ -702,13 +702,13 @@ fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestBorrow::R) { # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) 1: $t7 := 4 # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) - 2: $t3 := pack TestBorrow::R($t6, $t7) + 2: $t3 := pack 0x42::TestBorrow::R($t6, $t7) # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) 3: $t8 := 4 # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) 4: $t9 := 5 # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) - 5: $t4 := pack TestBorrow::R($t8, $t9) + 5: $t4 := pack 0x42::TestBorrow::R($t8, $t9) # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2) 6: $t10 := borrow_local($t4) # live_nodes: LocalRoot($t0), LocalRoot($t1), Reference($t2), Reference($t10) @@ -879,12 +879,12 @@ fun TestBorrow::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestBorrow::R) { [variant baseline] -fun TestBorrow::test9($t0|b: bool, $t1|r_ref: &mut TestBorrow::R): &mut u64 { +fun TestBorrow::test9($t0|b: bool, $t1|r_ref: &mut 0x42::TestBorrow::R): &mut u64 { var $t2|r_field: &mut u64 var $t3: &mut u64 var $t4: u64 # live_nodes: LocalRoot($t0), Reference($t1) - 0: $t3 := borrow_field.x($t1) + 0: $t3 := borrow_field<0x42::TestBorrow::R>.x($t1) # live_nodes: LocalRoot($t0), Reference($t1), Reference($t3) # borrowed_by: Reference($t1) -> {(.x (u64), Reference($t3))} # borrows_from: Reference($t3) -> {(.x (u64), Reference($t1))} @@ -904,7 +904,7 @@ fun TestBorrow::test9($t0|b: bool, $t1|r_ref: &mut TestBorrow::R): &mut u64 { # live_nodes: LocalRoot($t0), Reference($t1) # borrowed_by: Reference($t1) -> {(.x (u64), Reference($t3))}, Reference($t3) -> {(@, Reference($t2))} # borrows_from: Reference($t2) -> {(@, Reference($t3))}, Reference($t3) -> {(.x (u64), Reference($t1))} - 5: $t2 := borrow_field.y($t1) + 5: $t2 := borrow_field<0x42::TestBorrow::R>.y($t1) # live_nodes: LocalRoot($t0), Reference($t2) # borrowed_by: Reference($t1) -> {(.y (u64), Reference($t2)), (.x (u64), Reference($t3))}, Reference($t3) -> {(@, Reference($t2))} # borrows_from: Reference($t2) -> {(.y (u64), Reference($t1)), (@, Reference($t3))}, Reference($t3) -> {(.x (u64), Reference($t1))} diff --git a/third_party/move/move-model/bytecode/tests/borrow_strong/mut_ref.v2_exp b/third_party/move/move-model/bytecode/tests/borrow_strong/mut_ref.v2_exp index d241c08064816..c101769364277 100644 --- a/third_party/move/move-model/bytecode/tests/borrow_strong/mut_ref.v2_exp +++ b/third_party/move/move-model/bytecode/tests/borrow_strong/mut_ref.v2_exp @@ -78,23 +78,23 @@ public intrinsic fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64) [variant baseline] -fun TestMutRef::call_return_ref_different_path($t0|b: bool): TestMutRef::N { +fun TestMutRef::call_return_ref_different_path($t0|b: bool): 0x1::TestMutRef::N { var $t1|r: &mut u64 - var $t2|x: TestMutRef::N + var $t2|x: 0x1::TestMutRef::N var $t3: u64 var $t4: u64 - var $t5: TestMutRef::T - var $t6: TestMutRef::N + var $t5: 0x1::TestMutRef::T + var $t6: 0x1::TestMutRef::N var $t7: bool - var $t8: &mut TestMutRef::N + var $t8: &mut 0x1::TestMutRef::N var $t9: &mut u64 var $t10: u64 var $t11: &mut u64 - var $t12: TestMutRef::N + var $t12: 0x1::TestMutRef::N 0: $t3 := 1 1: $t4 := 2 - 2: $t5 := pack TestMutRef::T($t4) - 3: $t6 := pack TestMutRef::N($t3, $t5) + 2: $t5 := pack 0x1::TestMutRef::T($t4) + 3: $t6 := pack 0x1::TestMutRef::N($t3, $t5) 4: $t2 := $t6 5: $t7 := move($t0) 6: $t8 := borrow_local($t2) @@ -109,29 +109,29 @@ fun TestMutRef::call_return_ref_different_path($t0|b: bool): TestMutRef::N { [variant baseline] -fun TestMutRef::call_return_ref_different_path_vec($t0|b: bool): TestMutRef::V { +fun TestMutRef::call_return_ref_different_path_vec($t0|b: bool): 0x1::TestMutRef::V { var $t1|is: vector var $t2|r: &mut u64 - var $t3|ts: vector - var $t4|x: TestMutRef::V + var $t3|ts: vector<0x1::TestMutRef::T> + var $t4|x: 0x1::TestMutRef::V var $t5: vector - var $t6: vector + var $t6: vector<0x1::TestMutRef::T> var $t7: &mut vector var $t8: u64 var $t9: &mut vector var $t10: u64 var $t11: vector - var $t12: vector - var $t13: TestMutRef::V + var $t12: vector<0x1::TestMutRef::T> + var $t13: 0x1::TestMutRef::V var $t14: bool - var $t15: &mut TestMutRef::V + var $t15: &mut 0x1::TestMutRef::V var $t16: &mut u64 var $t17: u64 var $t18: &mut u64 - var $t19: TestMutRef::V + var $t19: 0x1::TestMutRef::V 0: $t5 := vector::empty() 1: $t1 := $t5 - 2: $t6 := vector::empty() + 2: $t6 := vector::empty<0x1::TestMutRef::T>() 3: $t3 := $t6 4: $t7 := borrow_local($t1) 5: $t8 := 1 @@ -141,7 +141,7 @@ fun TestMutRef::call_return_ref_different_path_vec($t0|b: bool): TestMutRef::V { 9: vector::push_back($t9, $t10) 10: $t11 := move($t1) 11: $t12 := move($t3) - 12: $t13 := pack TestMutRef::V($t11, $t12) + 12: $t13 := pack 0x1::TestMutRef::V($t11, $t12) 13: $t4 := $t13 14: $t14 := move($t0) 15: $t15 := borrow_local($t4) @@ -156,35 +156,35 @@ fun TestMutRef::call_return_ref_different_path_vec($t0|b: bool): TestMutRef::V { [variant baseline] -fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): TestMutRef::V { +fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): 0x1::TestMutRef::V { var $t1|is: vector var $t2|r: &mut u64 - var $t3|ts: vector - var $t4|x: TestMutRef::V + var $t3|ts: vector<0x1::TestMutRef::T> + var $t4|x: 0x1::TestMutRef::V var $t5: vector - var $t6: vector + var $t6: vector<0x1::TestMutRef::T> var $t7: &mut vector var $t8: u64 var $t9: &mut vector var $t10: u64 - var $t11: &mut vector + var $t11: &mut vector<0x1::TestMutRef::T> var $t12: u64 - var $t13: TestMutRef::T - var $t14: &mut vector + var $t13: 0x1::TestMutRef::T + var $t14: &mut vector<0x1::TestMutRef::T> var $t15: u64 - var $t16: TestMutRef::T + var $t16: 0x1::TestMutRef::T var $t17: vector - var $t18: vector - var $t19: TestMutRef::V + var $t18: vector<0x1::TestMutRef::T> + var $t19: 0x1::TestMutRef::V var $t20: bool - var $t21: &mut TestMutRef::V + var $t21: &mut 0x1::TestMutRef::V var $t22: &mut u64 var $t23: u64 var $t24: &mut u64 - var $t25: TestMutRef::V + var $t25: 0x1::TestMutRef::V 0: $t5 := vector::empty() 1: $t1 := $t5 - 2: $t6 := vector::empty() + 2: $t6 := vector::empty<0x1::TestMutRef::T>() 3: $t3 := $t6 4: $t7 := borrow_local($t1) 5: $t8 := 1 @@ -194,15 +194,15 @@ fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): TestMutRef::V 9: vector::push_back($t9, $t10) 10: $t11 := borrow_local($t3) 11: $t12 := 3 - 12: $t13 := pack TestMutRef::T($t12) - 13: vector::push_back($t11, $t13) + 12: $t13 := pack 0x1::TestMutRef::T($t12) + 13: vector::push_back<0x1::TestMutRef::T>($t11, $t13) 14: $t14 := borrow_local($t3) 15: $t15 := 4 - 16: $t16 := pack TestMutRef::T($t15) - 17: vector::push_back($t14, $t16) + 16: $t16 := pack 0x1::TestMutRef::T($t15) + 17: vector::push_back<0x1::TestMutRef::T>($t14, $t16) 18: $t17 := move($t1) 19: $t18 := move($t3) - 20: $t19 := pack TestMutRef::V($t17, $t18) + 20: $t19 := pack 0x1::TestMutRef::V($t17, $t18) 21: $t4 := $t19 22: $t20 := move($t0) 23: $t21 := borrow_local($t4) @@ -217,35 +217,35 @@ fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): TestMutRef::V [variant baseline] -fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): TestMutRef::V { +fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): 0x1::TestMutRef::V { var $t1|is: vector var $t2|r: &mut u64 - var $t3|ts: vector - var $t4|x: TestMutRef::V + var $t3|ts: vector<0x1::TestMutRef::T> + var $t4|x: 0x1::TestMutRef::V var $t5: vector - var $t6: vector + var $t6: vector<0x1::TestMutRef::T> var $t7: &mut vector var $t8: u64 var $t9: &mut vector var $t10: u64 - var $t11: &mut vector + var $t11: &mut vector<0x1::TestMutRef::T> var $t12: u64 - var $t13: TestMutRef::T - var $t14: &mut vector + var $t13: 0x1::TestMutRef::T + var $t14: &mut vector<0x1::TestMutRef::T> var $t15: u64 - var $t16: TestMutRef::T + var $t16: 0x1::TestMutRef::T var $t17: vector - var $t18: vector - var $t19: TestMutRef::V + var $t18: vector<0x1::TestMutRef::T> + var $t19: 0x1::TestMutRef::V var $t20: bool - var $t21: &mut TestMutRef::V + var $t21: &mut 0x1::TestMutRef::V var $t22: &mut u64 var $t23: u64 var $t24: &mut u64 - var $t25: TestMutRef::V + var $t25: 0x1::TestMutRef::V 0: $t5 := vector::empty() 1: $t1 := $t5 - 2: $t6 := vector::empty() + 2: $t6 := vector::empty<0x1::TestMutRef::T>() 3: $t3 := $t6 4: $t7 := borrow_local($t1) 5: $t8 := 1 @@ -255,15 +255,15 @@ fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): Test 9: vector::push_back($t9, $t10) 10: $t11 := borrow_local($t3) 11: $t12 := 3 - 12: $t13 := pack TestMutRef::T($t12) - 13: vector::push_back($t11, $t13) + 12: $t13 := pack 0x1::TestMutRef::T($t12) + 13: vector::push_back<0x1::TestMutRef::T>($t11, $t13) 14: $t14 := borrow_local($t3) 15: $t15 := 4 - 16: $t16 := pack TestMutRef::T($t15) - 17: vector::push_back($t14, $t16) + 16: $t16 := pack 0x1::TestMutRef::T($t15) + 17: vector::push_back<0x1::TestMutRef::T>($t14, $t16) 18: $t17 := move($t1) 19: $t18 := move($t3) - 20: $t19 := pack TestMutRef::V($t17, $t18) + 20: $t19 := pack 0x1::TestMutRef::V($t17, $t18) 21: $t4 := $t19 22: $t20 := move($t0) 23: $t21 := borrow_local($t4) @@ -278,27 +278,27 @@ fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): Test [variant baseline] -fun TestMutRef::call_return_ref_different_root($t0|b: bool): (TestMutRef::T, TestMutRef::R) { +fun TestMutRef::call_return_ref_different_root($t0|b: bool): (0x1::TestMutRef::T, 0x1::TestMutRef::R) { var $t1|r: &mut u64 - var $t2|x: TestMutRef::T - var $t3|y: TestMutRef::R + var $t2|x: 0x1::TestMutRef::T + var $t3|y: 0x1::TestMutRef::R var $t4: u64 - var $t5: TestMutRef::T + var $t5: 0x1::TestMutRef::T var $t6: u64 - var $t7: TestMutRef::R + var $t7: 0x1::TestMutRef::R var $t8: bool - var $t9: &mut TestMutRef::T - var $t10: &mut TestMutRef::R + var $t9: &mut 0x1::TestMutRef::T + var $t10: &mut 0x1::TestMutRef::R var $t11: &mut u64 var $t12: u64 var $t13: &mut u64 - var $t14: TestMutRef::T - var $t15: TestMutRef::R + var $t14: 0x1::TestMutRef::T + var $t15: 0x1::TestMutRef::R 0: $t4 := 1 - 1: $t5 := pack TestMutRef::T($t4) + 1: $t5 := pack 0x1::TestMutRef::T($t4) 2: $t2 := $t5 3: $t6 := 10 - 4: $t7 := pack TestMutRef::R($t6) + 4: $t7 := pack 0x1::TestMutRef::R($t6) 5: $t3 := $t7 6: $t8 := move($t0) 7: $t9 := borrow_local($t2) @@ -315,26 +315,26 @@ fun TestMutRef::call_return_ref_different_root($t0|b: bool): (TestMutRef::T, Tes [variant baseline] -fun TestMutRef::return_ref_different_path($t0|b: bool, $t1|x: &mut TestMutRef::N): &mut u64 { +fun TestMutRef::return_ref_different_path($t0|b: bool, $t1|x: &mut 0x1::TestMutRef::N): &mut u64 { var $t2|tmp#$2: &mut u64 var $t3: bool - var $t4: &mut TestMutRef::N + var $t4: &mut 0x1::TestMutRef::N var $t5: &mut u64 - var $t6: &mut TestMutRef::N - var $t7: &mut TestMutRef::T + var $t6: &mut 0x1::TestMutRef::N + var $t7: &mut 0x1::TestMutRef::T var $t8: &mut u64 var $t9: &mut u64 0: $t3 := move($t0) 1: if ($t3) goto 2 else goto 7 2: label L1 3: $t4 := move($t1) - 4: $t5 := borrow_field.value($t4) + 4: $t5 := borrow_field<0x1::TestMutRef::N>.value($t4) 5: $t2 := $t5 6: goto 13 7: label L0 8: $t6 := move($t1) - 9: $t7 := borrow_field.t($t6) - 10: $t8 := borrow_field.value($t7) + 9: $t7 := borrow_field<0x1::TestMutRef::N>.t($t6) + 10: $t8 := borrow_field<0x1::TestMutRef::T>.value($t7) 11: $t2 := $t8 12: goto 13 13: label L2 @@ -344,14 +344,14 @@ fun TestMutRef::return_ref_different_path($t0|b: bool, $t1|x: &mut TestMutRef::N [variant baseline] -fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut TestMutRef::V): &mut u64 { +fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut 0x1::TestMutRef::V): &mut u64 { var $t2|tmp#$2: &mut u64 var $t3: bool - var $t4: &mut TestMutRef::V + var $t4: &mut 0x1::TestMutRef::V var $t5: &mut vector var $t6: u64 var $t7: &mut u64 - var $t8: &mut TestMutRef::V + var $t8: &mut 0x1::TestMutRef::V var $t9: &mut vector var $t10: u64 var $t11: &mut u64 @@ -360,14 +360,14 @@ fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut TestMutRe 1: if ($t3) goto 2 else goto 9 2: label L1 3: $t4 := move($t1) - 4: $t5 := borrow_field.is($t4) + 4: $t5 := borrow_field<0x1::TestMutRef::V>.is($t4) 5: $t6 := 1 6: $t7 := vector::borrow_mut($t5, $t6) 7: $t2 := $t7 8: goto 16 9: label L0 10: $t8 := move($t1) - 11: $t9 := borrow_field.is($t8) + 11: $t9 := borrow_field<0x1::TestMutRef::V>.is($t8) 12: $t10 := 0 13: $t11 := vector::borrow_mut($t9, $t10) 14: $t2 := $t11 @@ -379,34 +379,34 @@ fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut TestMutRe [variant baseline] -fun TestMutRef::return_ref_different_path_vec2($t0|b: bool, $t1|x: &mut TestMutRef::V): &mut u64 { +fun TestMutRef::return_ref_different_path_vec2($t0|b: bool, $t1|x: &mut 0x1::TestMutRef::V): &mut u64 { var $t2|tmp#$2: &mut u64 var $t3: bool - var $t4: &mut TestMutRef::V + var $t4: &mut 0x1::TestMutRef::V var $t5: &mut vector var $t6: u64 var $t7: &mut u64 - var $t8: &mut TestMutRef::V - var $t9: &mut vector + var $t8: &mut 0x1::TestMutRef::V + var $t9: &mut vector<0x1::TestMutRef::T> var $t10: u64 - var $t11: &mut TestMutRef::T + var $t11: &mut 0x1::TestMutRef::T var $t12: &mut u64 var $t13: &mut u64 0: $t3 := move($t0) 1: if ($t3) goto 2 else goto 9 2: label L1 3: $t4 := move($t1) - 4: $t5 := borrow_field.is($t4) + 4: $t5 := borrow_field<0x1::TestMutRef::V>.is($t4) 5: $t6 := 1 6: $t7 := vector::borrow_mut($t5, $t6) 7: $t2 := $t7 8: goto 17 9: label L0 10: $t8 := move($t1) - 11: $t9 := borrow_field.ts($t8) + 11: $t9 := borrow_field<0x1::TestMutRef::V>.ts($t8) 12: $t10 := 0 - 13: $t11 := vector::borrow_mut($t9, $t10) - 14: $t12 := borrow_field.value($t11) + 13: $t11 := vector::borrow_mut<0x1::TestMutRef::T>($t9, $t10) + 14: $t12 := borrow_field<0x1::TestMutRef::T>.value($t11) 15: $t2 := $t12 16: goto 17 17: label L2 @@ -416,14 +416,14 @@ fun TestMutRef::return_ref_different_path_vec2($t0|b: bool, $t1|x: &mut TestMutR [variant baseline] -fun TestMutRef::return_ref_different_root($t0|b: bool, $t1|x: &mut TestMutRef::T, $t2|y: &mut TestMutRef::R): &mut u64 { +fun TestMutRef::return_ref_different_root($t0|b: bool, $t1|x: &mut 0x1::TestMutRef::T, $t2|y: &mut 0x1::TestMutRef::R): &mut u64 { var $t3|tmp#$3: &mut u64 var $t4: bool - var $t5: &mut TestMutRef::R - var $t6: &mut TestMutRef::T + var $t5: &mut 0x1::TestMutRef::R + var $t6: &mut 0x1::TestMutRef::T var $t7: &mut u64 - var $t8: &mut TestMutRef::T - var $t9: &mut TestMutRef::R + var $t8: &mut 0x1::TestMutRef::T + var $t9: &mut 0x1::TestMutRef::R var $t10: &mut u64 var $t11: &mut u64 0: $t4 := move($t0) @@ -432,14 +432,14 @@ fun TestMutRef::return_ref_different_root($t0|b: bool, $t1|x: &mut TestMutRef::T 3: $t5 := move($t2) 4: drop($t5) 5: $t6 := move($t1) - 6: $t7 := borrow_field.value($t6) + 6: $t7 := borrow_field<0x1::TestMutRef::T>.value($t6) 7: $t3 := $t7 8: goto 16 9: label L0 10: $t8 := move($t1) 11: drop($t8) 12: $t9 := move($t2) - 13: $t10 := borrow_field.value($t9) + 13: $t10 := borrow_field<0x1::TestMutRef::R>.value($t9) 14: $t3 := $t10 15: goto 16 16: label L2 @@ -534,24 +534,24 @@ public intrinsic fun vector::swap_remove<#0>($t0|v: &mut vector<#0>, $t1|i: u64) [variant baseline] -fun TestMutRef::call_return_ref_different_path($t0|b: bool): TestMutRef::N { +fun TestMutRef::call_return_ref_different_path($t0|b: bool): 0x1::TestMutRef::N { var $t1|r: &mut u64 [unused] - var $t2|x: TestMutRef::N + var $t2|x: 0x1::TestMutRef::N var $t3: u64 var $t4: u64 - var $t5: TestMutRef::T - var $t6: &mut TestMutRef::N + var $t5: 0x1::TestMutRef::T + var $t6: &mut 0x1::TestMutRef::N var $t7: &mut u64 var $t8: u64 - var $t9: TestMutRef::N + var $t9: 0x1::TestMutRef::N # live_nodes: LocalRoot($t0) 0: $t3 := 1 # live_nodes: LocalRoot($t0) 1: $t4 := 2 # live_nodes: LocalRoot($t0) - 2: $t5 := pack TestMutRef::T($t4) + 2: $t5 := pack 0x1::TestMutRef::T($t4) # live_nodes: LocalRoot($t0) - 3: $t2 := pack TestMutRef::N($t3, $t5) + 3: $t2 := pack 0x1::TestMutRef::N($t3, $t5) # live_nodes: LocalRoot($t0) 4: $t6 := borrow_local($t2) # live_nodes: LocalRoot($t0), Reference($t6) @@ -559,44 +559,44 @@ fun TestMutRef::call_return_ref_different_path($t0|b: bool): TestMutRef::N { # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))} 5: $t7 := TestMutRef::return_ref_different_path($t0, $t6) # live_nodes: LocalRoot($t0), Reference($t7) - # borrowed_by: LocalRoot($t2) -> {(@, Reference($t6))}, Reference($t6) -> {(.value (u64), Reference($t7)), (.t (TestMutRef::T)/.value (u64), Reference($t7))} - # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))}, Reference($t7) -> {(.value (u64), Reference($t6)), (.t (TestMutRef::T)/.value (u64), Reference($t6))} + # borrowed_by: LocalRoot($t2) -> {(@, Reference($t6))}, Reference($t6) -> {(.value (u64), Reference($t7)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t7))} + # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))}, Reference($t7) -> {(.value (u64), Reference($t6)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t6))} 6: $t8 := 5 # live_nodes: LocalRoot($t0), Reference($t7) - # borrowed_by: LocalRoot($t2) -> {(@, Reference($t6))}, Reference($t6) -> {(.value (u64), Reference($t7)), (.t (TestMutRef::T)/.value (u64), Reference($t7))} - # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))}, Reference($t7) -> {(.value (u64), Reference($t6)), (.t (TestMutRef::T)/.value (u64), Reference($t6))} + # borrowed_by: LocalRoot($t2) -> {(@, Reference($t6))}, Reference($t6) -> {(.value (u64), Reference($t7)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t7))} + # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))}, Reference($t7) -> {(.value (u64), Reference($t6)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t6))} 7: write_ref($t7, $t8) # live_nodes: LocalRoot($t0) - # borrowed_by: LocalRoot($t2) -> {(@, Reference($t6))}, Reference($t6) -> {(.value (u64), Reference($t7)), (.t (TestMutRef::T)/.value (u64), Reference($t7))} - # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))}, Reference($t7) -> {(.value (u64), Reference($t6)), (.t (TestMutRef::T)/.value (u64), Reference($t6))} + # borrowed_by: LocalRoot($t2) -> {(@, Reference($t6))}, Reference($t6) -> {(.value (u64), Reference($t7)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t7))} + # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))}, Reference($t7) -> {(.value (u64), Reference($t6)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t6))} 8: $t9 := move($t2) # live_nodes: LocalRoot($t0), LocalRoot($t9) - # borrowed_by: LocalRoot($t2) -> {(@, Reference($t6))}, Reference($t6) -> {(.value (u64), Reference($t7)), (.t (TestMutRef::T)/.value (u64), Reference($t7))} - # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))}, Reference($t7) -> {(.value (u64), Reference($t6)), (.t (TestMutRef::T)/.value (u64), Reference($t6))} + # borrowed_by: LocalRoot($t2) -> {(@, Reference($t6))}, Reference($t6) -> {(.value (u64), Reference($t7)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t7))} + # borrows_from: Reference($t6) -> {(@, LocalRoot($t2))}, Reference($t7) -> {(.value (u64), Reference($t6)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t6))} 9: return $t9 } [variant baseline] -fun TestMutRef::call_return_ref_different_path_vec($t0|b: bool): TestMutRef::V { +fun TestMutRef::call_return_ref_different_path_vec($t0|b: bool): 0x1::TestMutRef::V { var $t1|is: vector var $t2|r: &mut u64 [unused] - var $t3|ts: vector [unused] - var $t4|x: TestMutRef::V - var $t5: vector + var $t3|ts: vector<0x1::TestMutRef::T> [unused] + var $t4|x: 0x1::TestMutRef::V + var $t5: vector<0x1::TestMutRef::T> var $t6: &mut vector var $t7: u64 var $t8: &mut vector var $t9: u64 var $t10: vector - var $t11: &mut TestMutRef::V + var $t11: &mut 0x1::TestMutRef::V var $t12: &mut u64 var $t13: u64 - var $t14: TestMutRef::V + var $t14: 0x1::TestMutRef::V # live_nodes: LocalRoot($t0) 0: $t1 := vector::empty() # live_nodes: LocalRoot($t0) - 1: $t5 := vector::empty() + 1: $t5 := vector::empty<0x1::TestMutRef::T>() # live_nodes: LocalRoot($t0) 2: $t6 := borrow_local($t1) # live_nodes: LocalRoot($t0), Reference($t6) @@ -626,7 +626,7 @@ fun TestMutRef::call_return_ref_different_path_vec($t0|b: bool): TestMutRef::V { # live_nodes: LocalRoot($t0), LocalRoot($t10) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t6)), (@, Reference($t8))} # borrows_from: Reference($t6) -> {(@, LocalRoot($t1))}, Reference($t8) -> {(@, LocalRoot($t1))} - 9: $t4 := pack TestMutRef::V($t10, $t5) + 9: $t4 := pack 0x1::TestMutRef::V($t10, $t5) # live_nodes: LocalRoot($t0), LocalRoot($t10) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t6)), (@, Reference($t8))} # borrows_from: Reference($t6) -> {(@, LocalRoot($t1))}, Reference($t8) -> {(@, LocalRoot($t1))} @@ -655,31 +655,31 @@ fun TestMutRef::call_return_ref_different_path_vec($t0|b: bool): TestMutRef::V { [variant baseline] -fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): TestMutRef::V { +fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): 0x1::TestMutRef::V { var $t1|is: vector var $t2|r: &mut u64 [unused] - var $t3|ts: vector - var $t4|x: TestMutRef::V + var $t3|ts: vector<0x1::TestMutRef::T> + var $t4|x: 0x1::TestMutRef::V var $t5: &mut vector var $t6: u64 var $t7: &mut vector var $t8: u64 - var $t9: &mut vector + var $t9: &mut vector<0x1::TestMutRef::T> var $t10: u64 - var $t11: TestMutRef::T - var $t12: &mut vector + var $t11: 0x1::TestMutRef::T + var $t12: &mut vector<0x1::TestMutRef::T> var $t13: u64 - var $t14: TestMutRef::T + var $t14: 0x1::TestMutRef::T var $t15: vector - var $t16: vector - var $t17: &mut TestMutRef::V + var $t16: vector<0x1::TestMutRef::T> + var $t17: &mut 0x1::TestMutRef::V var $t18: &mut u64 var $t19: u64 - var $t20: TestMutRef::V + var $t20: 0x1::TestMutRef::V # live_nodes: LocalRoot($t0) 0: $t1 := vector::empty() # live_nodes: LocalRoot($t0) - 1: $t3 := vector::empty() + 1: $t3 := vector::empty<0x1::TestMutRef::T>() # live_nodes: LocalRoot($t0) 2: $t5 := borrow_local($t1) # live_nodes: LocalRoot($t0), Reference($t5) @@ -713,11 +713,11 @@ fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): TestMutRef::V # live_nodes: LocalRoot($t0), Reference($t9) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))} - 10: $t11 := pack TestMutRef::T($t10) + 10: $t11 := pack 0x1::TestMutRef::T($t10) # live_nodes: LocalRoot($t0), Reference($t9) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))} - 11: vector::push_back($t9, $t11) + 11: vector::push_back<0x1::TestMutRef::T>($t9, $t11) # live_nodes: LocalRoot($t0) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))} @@ -729,11 +729,11 @@ fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): TestMutRef::V # live_nodes: LocalRoot($t0), Reference($t12) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} - 14: $t14 := pack TestMutRef::T($t13) + 14: $t14 := pack 0x1::TestMutRef::T($t13) # live_nodes: LocalRoot($t0), Reference($t12) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} - 15: vector::push_back($t12, $t14) + 15: vector::push_back<0x1::TestMutRef::T>($t12, $t14) # live_nodes: LocalRoot($t0) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} @@ -745,7 +745,7 @@ fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): TestMutRef::V # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} - 18: $t4 := pack TestMutRef::V($t15, $t16) + 18: $t4 := pack 0x1::TestMutRef::V($t15, $t16) # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} @@ -755,50 +755,50 @@ fun TestMutRef::call_return_ref_different_path_vec2($t0|b: bool): TestMutRef::V # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))} 20: $t18 := TestMutRef::return_ref_different_path_vec2($t0, $t17) # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16), Reference($t18) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector)/[]/.value (u64), Reference($t18))} - # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector)/[]/.value (u64), Reference($t17))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t18))} + # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t17))} 21: $t19 := 5 # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16), Reference($t18) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector)/[]/.value (u64), Reference($t18))} - # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector)/[]/.value (u64), Reference($t17))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t18))} + # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t17))} 22: write_ref($t18, $t19) # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector)/[]/.value (u64), Reference($t18))} - # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector)/[]/.value (u64), Reference($t17))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t18))} + # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t17))} 23: $t20 := move($t4) # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16), LocalRoot($t20) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector)/[]/.value (u64), Reference($t18))} - # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector)/[]/.value (u64), Reference($t17))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t18))} + # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t17))} 24: return $t20 } [variant baseline] -fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): TestMutRef::V { +fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): 0x1::TestMutRef::V { var $t1|is: vector var $t2|r: &mut u64 [unused] - var $t3|ts: vector - var $t4|x: TestMutRef::V + var $t3|ts: vector<0x1::TestMutRef::T> + var $t4|x: 0x1::TestMutRef::V var $t5: &mut vector var $t6: u64 var $t7: &mut vector var $t8: u64 - var $t9: &mut vector + var $t9: &mut vector<0x1::TestMutRef::T> var $t10: u64 - var $t11: TestMutRef::T - var $t12: &mut vector + var $t11: 0x1::TestMutRef::T + var $t12: &mut vector<0x1::TestMutRef::T> var $t13: u64 - var $t14: TestMutRef::T + var $t14: 0x1::TestMutRef::T var $t15: vector - var $t16: vector - var $t17: &mut TestMutRef::V + var $t16: vector<0x1::TestMutRef::T> + var $t17: &mut 0x1::TestMutRef::V var $t18: &mut u64 var $t19: u64 - var $t20: TestMutRef::V + var $t20: 0x1::TestMutRef::V # live_nodes: LocalRoot($t0) 0: $t1 := vector::empty() # live_nodes: LocalRoot($t0) - 1: $t3 := vector::empty() + 1: $t3 := vector::empty<0x1::TestMutRef::T>() # live_nodes: LocalRoot($t0) 2: $t5 := borrow_local($t1) # live_nodes: LocalRoot($t0), Reference($t5) @@ -832,11 +832,11 @@ fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): Test # live_nodes: LocalRoot($t0), Reference($t9) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))} - 10: $t11 := pack TestMutRef::T($t10) + 10: $t11 := pack 0x1::TestMutRef::T($t10) # live_nodes: LocalRoot($t0), Reference($t9) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))} - 11: vector::push_back($t9, $t11) + 11: vector::push_back<0x1::TestMutRef::T>($t9, $t11) # live_nodes: LocalRoot($t0) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))} @@ -848,11 +848,11 @@ fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): Test # live_nodes: LocalRoot($t0), Reference($t12) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} - 14: $t14 := pack TestMutRef::T($t13) + 14: $t14 := pack 0x1::TestMutRef::T($t13) # live_nodes: LocalRoot($t0), Reference($t12) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} - 15: vector::push_back($t12, $t14) + 15: vector::push_back<0x1::TestMutRef::T>($t12, $t14) # live_nodes: LocalRoot($t0) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} @@ -864,7 +864,7 @@ fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): Test # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} - 18: $t4 := pack TestMutRef::V($t15, $t16) + 18: $t4 := pack 0x1::TestMutRef::V($t15, $t16) # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16) # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))} # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))} @@ -874,45 +874,45 @@ fun TestMutRef::call_return_ref_different_path_vec2_incorrect($t0|b: bool): Test # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))} 20: $t18 := TestMutRef::return_ref_different_path_vec2($t0, $t17) # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16), Reference($t18) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector)/[]/.value (u64), Reference($t18))} - # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector)/[]/.value (u64), Reference($t17))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t18))} + # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t17))} 21: $t19 := 0 # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16), Reference($t18) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector)/[]/.value (u64), Reference($t18))} - # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector)/[]/.value (u64), Reference($t17))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t18))} + # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t17))} 22: write_ref($t18, $t19) # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector)/[]/.value (u64), Reference($t18))} - # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector)/[]/.value (u64), Reference($t17))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t18))} + # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t17))} 23: $t20 := move($t4) # live_nodes: LocalRoot($t0), LocalRoot($t15), LocalRoot($t16), LocalRoot($t20) - # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector)/[]/.value (u64), Reference($t18))} - # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector)/[]/.value (u64), Reference($t17))} + # borrowed_by: LocalRoot($t1) -> {(@, Reference($t5)), (@, Reference($t7))}, LocalRoot($t3) -> {(@, Reference($t9)), (@, Reference($t12))}, LocalRoot($t4) -> {(@, Reference($t17))}, Reference($t17) -> {(.is (vector)/[], Reference($t18)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t18))} + # borrows_from: Reference($t5) -> {(@, LocalRoot($t1))}, Reference($t7) -> {(@, LocalRoot($t1))}, Reference($t9) -> {(@, LocalRoot($t3))}, Reference($t12) -> {(@, LocalRoot($t3))}, Reference($t17) -> {(@, LocalRoot($t4))}, Reference($t18) -> {(.is (vector)/[], Reference($t17)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t17))} 24: return $t20 } [variant baseline] -fun TestMutRef::call_return_ref_different_root($t0|b: bool): (TestMutRef::T, TestMutRef::R) { +fun TestMutRef::call_return_ref_different_root($t0|b: bool): (0x1::TestMutRef::T, 0x1::TestMutRef::R) { var $t1|r: &mut u64 [unused] - var $t2|x: TestMutRef::T - var $t3|y: TestMutRef::R + var $t2|x: 0x1::TestMutRef::T + var $t3|y: 0x1::TestMutRef::R var $t4: u64 var $t5: u64 - var $t6: &mut TestMutRef::T - var $t7: &mut TestMutRef::R + var $t6: &mut 0x1::TestMutRef::T + var $t7: &mut 0x1::TestMutRef::R var $t8: &mut u64 var $t9: u64 - var $t10: TestMutRef::T - var $t11: TestMutRef::R + var $t10: 0x1::TestMutRef::T + var $t11: 0x1::TestMutRef::R # live_nodes: LocalRoot($t0) 0: $t4 := 1 # live_nodes: LocalRoot($t0) - 1: $t2 := pack TestMutRef::T($t4) + 1: $t2 := pack 0x1::TestMutRef::T($t4) # live_nodes: LocalRoot($t0) 2: $t5 := 10 # live_nodes: LocalRoot($t0) - 3: $t3 := pack TestMutRef::R($t5) + 3: $t3 := pack 0x1::TestMutRef::R($t5) # live_nodes: LocalRoot($t0) 4: $t6 := borrow_local($t2) # live_nodes: LocalRoot($t0), Reference($t6) @@ -947,15 +947,15 @@ fun TestMutRef::call_return_ref_different_root($t0|b: bool): (TestMutRef::T, Tes [variant baseline] -fun TestMutRef::return_ref_different_path($t0|b: bool, $t1|x: &mut TestMutRef::N): &mut u64 { +fun TestMutRef::return_ref_different_path($t0|b: bool, $t1|x: &mut 0x1::TestMutRef::N): &mut u64 { var $t2|tmp#$2: &mut u64 - var $t3: &mut TestMutRef::T + var $t3: &mut 0x1::TestMutRef::T # live_nodes: LocalRoot($t0), Reference($t1) 0: if ($t0) goto 1 else goto 4 # live_nodes: LocalRoot($t0), Reference($t1) 1: label L1 # live_nodes: LocalRoot($t0), Reference($t1) - 2: $t2 := borrow_field.value($t1) + 2: $t2 := borrow_field<0x1::TestMutRef::N>.value($t1) # live_nodes: LocalRoot($t0), Reference($t2) # borrowed_by: Reference($t1) -> {(.value (u64), Reference($t2))} # borrows_from: Reference($t2) -> {(.value (u64), Reference($t1))} @@ -963,28 +963,28 @@ fun TestMutRef::return_ref_different_path($t0|b: bool, $t1|x: &mut TestMutRef::N # live_nodes: LocalRoot($t0), Reference($t1) 4: label L0 # live_nodes: LocalRoot($t0), Reference($t1) - 5: $t3 := borrow_field.t($t1) + 5: $t3 := borrow_field<0x1::TestMutRef::N>.t($t1) # live_nodes: LocalRoot($t0), Reference($t3) - # borrowed_by: Reference($t1) -> {(.t (TestMutRef::T), Reference($t3))} - # borrows_from: Reference($t3) -> {(.t (TestMutRef::T), Reference($t1))} - 6: $t2 := borrow_field.value($t3) + # borrowed_by: Reference($t1) -> {(.t (0x1::TestMutRef::T), Reference($t3))} + # borrows_from: Reference($t3) -> {(.t (0x1::TestMutRef::T), Reference($t1))} + 6: $t2 := borrow_field<0x1::TestMutRef::T>.value($t3) # live_nodes: LocalRoot($t0), Reference($t2) - # borrowed_by: Reference($t1) -> {(.t (TestMutRef::T), Reference($t3))}, Reference($t3) -> {(.value (u64), Reference($t2))} - # borrows_from: Reference($t2) -> {(.value (u64), Reference($t3))}, Reference($t3) -> {(.t (TestMutRef::T), Reference($t1))} + # borrowed_by: Reference($t1) -> {(.t (0x1::TestMutRef::T), Reference($t3))}, Reference($t3) -> {(.value (u64), Reference($t2))} + # borrows_from: Reference($t2) -> {(.value (u64), Reference($t3))}, Reference($t3) -> {(.t (0x1::TestMutRef::T), Reference($t1))} 7: goto 8 # live_nodes: LocalRoot($t0), Reference($t2) - # borrowed_by: Reference($t1) -> {(.value (u64), Reference($t2)), (.t (TestMutRef::T), Reference($t3))}, Reference($t3) -> {(.value (u64), Reference($t2))} - # borrows_from: Reference($t2) -> {(.value (u64), Reference($t1)), (.value (u64), Reference($t3))}, Reference($t3) -> {(.t (TestMutRef::T), Reference($t1))} + # borrowed_by: Reference($t1) -> {(.value (u64), Reference($t2)), (.t (0x1::TestMutRef::T), Reference($t3))}, Reference($t3) -> {(.value (u64), Reference($t2))} + # borrows_from: Reference($t2) -> {(.value (u64), Reference($t1)), (.value (u64), Reference($t3))}, Reference($t3) -> {(.t (0x1::TestMutRef::T), Reference($t1))} 8: label L2 # live_nodes: LocalRoot($t0), Reference($t2) - # borrowed_by: Reference($t1) -> {(.value (u64), Reference($t2)), (.t (TestMutRef::T), Reference($t3))}, Reference($t3) -> {(.value (u64), Reference($t2))} - # borrows_from: Reference($t2) -> {(.value (u64), Reference($t1)), (.value (u64), Reference($t3))}, Reference($t3) -> {(.t (TestMutRef::T), Reference($t1))} + # borrowed_by: Reference($t1) -> {(.value (u64), Reference($t2)), (.t (0x1::TestMutRef::T), Reference($t3))}, Reference($t3) -> {(.value (u64), Reference($t2))} + # borrows_from: Reference($t2) -> {(.value (u64), Reference($t1)), (.value (u64), Reference($t3))}, Reference($t3) -> {(.t (0x1::TestMutRef::T), Reference($t1))} 9: return $t2 } [variant baseline] -fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut TestMutRef::V): &mut u64 { +fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut 0x1::TestMutRef::V): &mut u64 { var $t2|tmp#$2: &mut u64 var $t3: &mut vector var $t4: u64 @@ -995,7 +995,7 @@ fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut TestMutRe # live_nodes: LocalRoot($t0), Reference($t1) 1: label L1 # live_nodes: LocalRoot($t0), Reference($t1) - 2: $t3 := borrow_field.is($t1) + 2: $t3 := borrow_field<0x1::TestMutRef::V>.is($t1) # live_nodes: LocalRoot($t0), Reference($t3) # borrowed_by: Reference($t1) -> {(.is (vector), Reference($t3))} # borrows_from: Reference($t3) -> {(.is (vector), Reference($t1))} @@ -1011,7 +1011,7 @@ fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut TestMutRe # live_nodes: LocalRoot($t0), Reference($t1) 6: label L0 # live_nodes: LocalRoot($t0), Reference($t1) - 7: $t5 := borrow_field.is($t1) + 7: $t5 := borrow_field<0x1::TestMutRef::V>.is($t1) # live_nodes: LocalRoot($t0), Reference($t5) # borrowed_by: Reference($t1) -> {(.is (vector), Reference($t5))} # borrows_from: Reference($t5) -> {(.is (vector), Reference($t1))} @@ -1036,19 +1036,19 @@ fun TestMutRef::return_ref_different_path_vec($t0|b: bool, $t1|x: &mut TestMutRe [variant baseline] -fun TestMutRef::return_ref_different_path_vec2($t0|b: bool, $t1|x: &mut TestMutRef::V): &mut u64 { +fun TestMutRef::return_ref_different_path_vec2($t0|b: bool, $t1|x: &mut 0x1::TestMutRef::V): &mut u64 { var $t2|tmp#$2: &mut u64 var $t3: &mut vector var $t4: u64 - var $t5: &mut vector + var $t5: &mut vector<0x1::TestMutRef::T> var $t6: u64 - var $t7: &mut TestMutRef::T + var $t7: &mut 0x1::TestMutRef::T # live_nodes: LocalRoot($t0), Reference($t1) 0: if ($t0) goto 1 else goto 6 # live_nodes: LocalRoot($t0), Reference($t1) 1: label L1 # live_nodes: LocalRoot($t0), Reference($t1) - 2: $t3 := borrow_field.is($t1) + 2: $t3 := borrow_field<0x1::TestMutRef::V>.is($t1) # live_nodes: LocalRoot($t0), Reference($t3) # borrowed_by: Reference($t1) -> {(.is (vector), Reference($t3))} # borrows_from: Reference($t3) -> {(.is (vector), Reference($t1))} @@ -1064,36 +1064,36 @@ fun TestMutRef::return_ref_different_path_vec2($t0|b: bool, $t1|x: &mut TestMutR # live_nodes: LocalRoot($t0), Reference($t1) 6: label L0 # live_nodes: LocalRoot($t0), Reference($t1) - 7: $t5 := borrow_field.ts($t1) + 7: $t5 := borrow_field<0x1::TestMutRef::V>.ts($t1) # live_nodes: LocalRoot($t0), Reference($t5) - # borrowed_by: Reference($t1) -> {(.ts (vector), Reference($t5))} - # borrows_from: Reference($t5) -> {(.ts (vector), Reference($t1))} + # borrowed_by: Reference($t1) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t5))} + # borrows_from: Reference($t5) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t1))} 8: $t6 := 0 # live_nodes: LocalRoot($t0), Reference($t5) - # borrowed_by: Reference($t1) -> {(.ts (vector), Reference($t5))} - # borrows_from: Reference($t5) -> {(.ts (vector), Reference($t1))} - 9: $t7 := vector::borrow_mut($t5, $t6) + # borrowed_by: Reference($t1) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t5))} + # borrows_from: Reference($t5) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t1))} + 9: $t7 := vector::borrow_mut<0x1::TestMutRef::T>($t5, $t6) # live_nodes: LocalRoot($t0), Reference($t7) - # borrowed_by: Reference($t1) -> {(.ts (vector), Reference($t5))}, Reference($t5) -> {([], Reference($t7))} - # borrows_from: Reference($t5) -> {(.ts (vector), Reference($t1))}, Reference($t7) -> {([], Reference($t5))} - 10: $t2 := borrow_field.value($t7) + # borrowed_by: Reference($t1) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t5))}, Reference($t5) -> {([], Reference($t7))} + # borrows_from: Reference($t5) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t1))}, Reference($t7) -> {([], Reference($t5))} + 10: $t2 := borrow_field<0x1::TestMutRef::T>.value($t7) # live_nodes: LocalRoot($t0), Reference($t2) - # borrowed_by: Reference($t1) -> {(.ts (vector), Reference($t5))}, Reference($t5) -> {([], Reference($t7))}, Reference($t7) -> {(.value (u64), Reference($t2))} - # borrows_from: Reference($t2) -> {(.value (u64), Reference($t7))}, Reference($t5) -> {(.ts (vector), Reference($t1))}, Reference($t7) -> {([], Reference($t5))} + # borrowed_by: Reference($t1) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t5))}, Reference($t5) -> {([], Reference($t7))}, Reference($t7) -> {(.value (u64), Reference($t2))} + # borrows_from: Reference($t2) -> {(.value (u64), Reference($t7))}, Reference($t5) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t1))}, Reference($t7) -> {([], Reference($t5))} 11: goto 12 # live_nodes: LocalRoot($t0), Reference($t2) - # borrowed_by: Reference($t1) -> {(.is (vector), Reference($t3)), (.ts (vector), Reference($t5))}, Reference($t3) -> {([], Reference($t2))}, Reference($t5) -> {([], Reference($t7))}, Reference($t7) -> {(.value (u64), Reference($t2))} - # borrows_from: Reference($t2) -> {([], Reference($t3)), (.value (u64), Reference($t7))}, Reference($t3) -> {(.is (vector), Reference($t1))}, Reference($t5) -> {(.ts (vector), Reference($t1))}, Reference($t7) -> {([], Reference($t5))} + # borrowed_by: Reference($t1) -> {(.is (vector), Reference($t3)), (.ts (vector<0x1::TestMutRef::T>), Reference($t5))}, Reference($t3) -> {([], Reference($t2))}, Reference($t5) -> {([], Reference($t7))}, Reference($t7) -> {(.value (u64), Reference($t2))} + # borrows_from: Reference($t2) -> {([], Reference($t3)), (.value (u64), Reference($t7))}, Reference($t3) -> {(.is (vector), Reference($t1))}, Reference($t5) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t1))}, Reference($t7) -> {([], Reference($t5))} 12: label L2 # live_nodes: LocalRoot($t0), Reference($t2) - # borrowed_by: Reference($t1) -> {(.is (vector), Reference($t3)), (.ts (vector), Reference($t5))}, Reference($t3) -> {([], Reference($t2))}, Reference($t5) -> {([], Reference($t7))}, Reference($t7) -> {(.value (u64), Reference($t2))} - # borrows_from: Reference($t2) -> {([], Reference($t3)), (.value (u64), Reference($t7))}, Reference($t3) -> {(.is (vector), Reference($t1))}, Reference($t5) -> {(.ts (vector), Reference($t1))}, Reference($t7) -> {([], Reference($t5))} + # borrowed_by: Reference($t1) -> {(.is (vector), Reference($t3)), (.ts (vector<0x1::TestMutRef::T>), Reference($t5))}, Reference($t3) -> {([], Reference($t2))}, Reference($t5) -> {([], Reference($t7))}, Reference($t7) -> {(.value (u64), Reference($t2))} + # borrows_from: Reference($t2) -> {([], Reference($t3)), (.value (u64), Reference($t7))}, Reference($t3) -> {(.is (vector), Reference($t1))}, Reference($t5) -> {(.ts (vector<0x1::TestMutRef::T>), Reference($t1))}, Reference($t7) -> {([], Reference($t5))} 13: return $t2 } [variant baseline] -fun TestMutRef::return_ref_different_root($t0|b: bool, $t1|x: &mut TestMutRef::T, $t2|y: &mut TestMutRef::R): &mut u64 { +fun TestMutRef::return_ref_different_root($t0|b: bool, $t1|x: &mut 0x1::TestMutRef::T, $t2|y: &mut 0x1::TestMutRef::R): &mut u64 { var $t3|tmp#$3: &mut u64 # live_nodes: LocalRoot($t0), Reference($t1), Reference($t2) 0: if ($t0) goto 1 else goto 5 @@ -1102,7 +1102,7 @@ fun TestMutRef::return_ref_different_root($t0|b: bool, $t1|x: &mut TestMutRef::T # live_nodes: LocalRoot($t0), Reference($t1), Reference($t2) 2: drop($t2) # live_nodes: LocalRoot($t0), Reference($t1) - 3: $t3 := borrow_field.value($t1) + 3: $t3 := borrow_field<0x1::TestMutRef::T>.value($t1) # live_nodes: LocalRoot($t0), Reference($t3) # borrowed_by: Reference($t1) -> {(.value (u64), Reference($t3))} # borrows_from: Reference($t3) -> {(.value (u64), Reference($t1))} @@ -1112,7 +1112,7 @@ fun TestMutRef::return_ref_different_root($t0|b: bool, $t1|x: &mut TestMutRef::T # live_nodes: LocalRoot($t0), Reference($t1), Reference($t2) 6: drop($t1) # live_nodes: LocalRoot($t0), Reference($t2) - 7: $t3 := borrow_field.value($t2) + 7: $t3 := borrow_field<0x1::TestMutRef::R>.value($t2) # live_nodes: LocalRoot($t0), Reference($t3) # borrowed_by: Reference($t2) -> {(.value (u64), Reference($t3))} # borrows_from: Reference($t3) -> {(.value (u64), Reference($t2))} @@ -1136,16 +1136,16 @@ borrowed_by: Reference($t0) -> {([], Return(0))} borrows_from: Return(0) -> {([], Reference($t0))} fun TestMutRef::return_ref_different_path[baseline] -borrowed_by: Reference($t1) -> {(.value (u64), Return(0)), (.t (TestMutRef::T)/.value (u64), Return(0))} -borrows_from: Return(0) -> {(.value (u64), Reference($t1)), (.t (TestMutRef::T)/.value (u64), Reference($t1))} +borrowed_by: Reference($t1) -> {(.value (u64), Return(0)), (.t (0x1::TestMutRef::T)/.value (u64), Return(0))} +borrows_from: Return(0) -> {(.value (u64), Reference($t1)), (.t (0x1::TestMutRef::T)/.value (u64), Reference($t1))} fun TestMutRef::return_ref_different_path_vec[baseline] borrowed_by: Reference($t1) -> {(.is (vector)/[], Return(0))} borrows_from: Return(0) -> {(.is (vector)/[], Reference($t1))} fun TestMutRef::return_ref_different_path_vec2[baseline] -borrowed_by: Reference($t1) -> {(.is (vector)/[], Return(0)), (.ts (vector)/[]/.value (u64), Return(0))} -borrows_from: Return(0) -> {(.is (vector)/[], Reference($t1)), (.ts (vector)/[]/.value (u64), Reference($t1))} +borrowed_by: Reference($t1) -> {(.is (vector)/[], Return(0)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Return(0))} +borrows_from: Return(0) -> {(.is (vector)/[], Reference($t1)), (.ts (vector<0x1::TestMutRef::T>)/[]/.value (u64), Reference($t1))} fun TestMutRef::return_ref_different_root[baseline] borrowed_by: Reference($t1) -> {(.value (u64), Return(0))}, Reference($t2) -> {(.value (u64), Return(0))} diff --git a/third_party/move/move-model/bytecode/tests/from_move/regression_generic_and_native_type.v2_exp b/third_party/move/move-model/bytecode/tests/from_move/regression_generic_and_native_type.v2_exp index 3adb0bf62745c..5bb62d0aeccad 100644 --- a/third_party/move/move-model/bytecode/tests/from_move/regression_generic_and_native_type.v2_exp +++ b/third_party/move/move-model/bytecode/tests/from_move/regression_generic_and_native_type.v2_exp @@ -96,66 +96,66 @@ public native fun signer::borrow_address($t0|s: &signer): &address; [variant baseline] public fun Diem::market_cap<#0>(): u128 { var $t0: address - var $t1: &Diem::Info<#0> + var $t1: &0x1::Diem::Info<#0> var $t2: &u128 var $t3: u128 0: $t0 := 0xa550c18 - 1: $t1 := borrow_global>($t0) - 2: $t2 := borrow_field>.total_value($t1) + 1: $t1 := borrow_global<0x1::Diem::Info<#0>>($t0) + 2: $t2 := borrow_field<0x1::Diem::Info<#0>>.total_value($t1) 3: $t3 := read_ref($t2) 4: return $t3 } [variant baseline] -public fun Diem::preburn<#0>($t0|preburn_ref: &mut Diem::Preburn<#0>, $t1|coin: Diem::T<#0>) { +public fun Diem::preburn<#0>($t0|preburn_ref: &mut 0x1::Diem::Preburn<#0>, $t1|coin: 0x1::Diem::T<#0>) { var $t2|coin_value: u64 - var $t3|market_cap: &mut Diem::Info<#0> - var $t4: &Diem::T<#0> + var $t3|market_cap: &mut 0x1::Diem::Info<#0> + var $t4: &0x1::Diem::T<#0> var $t5: u64 - var $t6: &mut Diem::Preburn<#0> - var $t7: &mut vector> - var $t8: Diem::T<#0> + var $t6: &mut 0x1::Diem::Preburn<#0> + var $t7: &mut vector<0x1::Diem::T<#0>> + var $t8: 0x1::Diem::T<#0> var $t9: address - var $t10: &mut Diem::Info<#0> - var $t11: &mut Diem::Info<#0> + var $t10: &mut 0x1::Diem::Info<#0> + var $t11: &mut 0x1::Diem::Info<#0> var $t12: &u64 var $t13: u64 var $t14: u64 var $t15: u64 - var $t16: &mut Diem::Info<#0> + var $t16: &mut 0x1::Diem::Info<#0> var $t17: &mut u64 0: $t4 := borrow_local($t1) 1: $t5 := Diem::value<#0>($t4) 2: $t2 := $t5 3: $t6 := move($t0) - 4: $t7 := borrow_field>.requests($t6) + 4: $t7 := borrow_field<0x1::Diem::Preburn<#0>>.requests($t6) 5: $t8 := move($t1) - 6: vector::push_back>($t7, $t8) + 6: vector::push_back<0x1::Diem::T<#0>>($t7, $t8) 7: $t9 := 0xa550c18 - 8: $t10 := borrow_global>($t9) + 8: $t10 := borrow_global<0x1::Diem::Info<#0>>($t9) 9: $t3 := $t10 10: $t11 := copy($t3) - 11: $t12 := borrow_field>.preburn_value($t11) + 11: $t12 := borrow_field<0x1::Diem::Info<#0>>.preburn_value($t11) 12: $t13 := read_ref($t12) 13: $t14 := move($t2) 14: $t15 := +($t13, $t14) 15: $t16 := move($t3) - 16: $t17 := borrow_field>.preburn_value($t16) + 16: $t17 := borrow_field<0x1::Diem::Info<#0>>.preburn_value($t16) 17: write_ref($t17, $t15) 18: return () } [variant baseline] -public fun Diem::preburn_to<#0>($t0|account: &signer, $t1|coin: Diem::T<#0>) { +public fun Diem::preburn_to<#0>($t0|account: &signer, $t1|coin: 0x1::Diem::T<#0>) { var $t2: &signer var $t3: address - var $t4: &mut Diem::Preburn<#0> - var $t5: Diem::T<#0> + var $t4: &mut 0x1::Diem::Preburn<#0> + var $t5: 0x1::Diem::T<#0> 0: $t2 := move($t0) 1: $t3 := signer::address_of($t2) - 2: $t4 := borrow_global>($t3) + 2: $t4 := borrow_global<0x1::Diem::Preburn<#0>>($t3) 3: $t5 := move($t1) 4: Diem::preburn<#0>($t4, $t5) 5: return () @@ -165,24 +165,24 @@ public fun Diem::preburn_to<#0>($t0|account: &signer, $t1|coin: Diem::T<#0>) { [variant baseline] public fun Diem::preburn_value<#0>(): u64 { var $t0: address - var $t1: &Diem::Info<#0> + var $t1: &0x1::Diem::Info<#0> var $t2: &u64 var $t3: u64 0: $t0 := 0xa550c18 - 1: $t1 := borrow_global>($t0) - 2: $t2 := borrow_field>.preburn_value($t1) + 1: $t1 := borrow_global<0x1::Diem::Info<#0>>($t0) + 2: $t2 := borrow_field<0x1::Diem::Info<#0>>.preburn_value($t1) 3: $t3 := read_ref($t2) 4: return $t3 } [variant baseline] -public fun Diem::value<#0>($t0|coin_ref: &Diem::T<#0>): u64 { - var $t1: &Diem::T<#0> +public fun Diem::value<#0>($t0|coin_ref: &0x1::Diem::T<#0>): u64 { + var $t1: &0x1::Diem::T<#0> var $t2: &u64 var $t3: u64 0: $t1 := move($t0) - 1: $t2 := borrow_field>.value($t1) + 1: $t2 := borrow_field<0x1::Diem::T<#0>>.value($t1) 2: $t3 := read_ref($t2) 3: return $t3 } diff --git a/third_party/move/move-model/bytecode/tests/from_move/smoke_test.v2_exp b/third_party/move/move-model/bytecode/tests/from_move/smoke_test.v2_exp index ba97b2cb44214..f2d331aa38554 100644 --- a/third_party/move/move-model/bytecode/tests/from_move/smoke_test.v2_exp +++ b/third_party/move/move-model/bytecode/tests/from_move/smoke_test.v2_exp @@ -123,14 +123,14 @@ fun SmokeTest::bool_ops($t0|a: u64, $t1|b: u64): (bool, bool) { [variant baseline] fun SmokeTest::borrow_global_mut_test($t0|a: address) { var $t1: address - var $t2: &mut SmokeTest::R + var $t2: &mut 0x42::SmokeTest::R var $t3: address - var $t4: &mut SmokeTest::R + var $t4: &mut 0x42::SmokeTest::R 0: $t1 := copy($t0) - 1: $t2 := borrow_global($t1) + 1: $t2 := borrow_global<0x42::SmokeTest::R>($t1) 2: drop($t2) 3: $t3 := move($t0) - 4: $t4 := borrow_global($t3) + 4: $t4 := borrow_global<0x42::SmokeTest::R>($t3) 5: drop($t4) 6: return () } @@ -140,11 +140,11 @@ fun SmokeTest::borrow_global_mut_test($t0|a: address) { fun SmokeTest::create_resource($t0|sender: &signer) { var $t1: &signer var $t2: u64 - var $t3: SmokeTest::R + var $t3: 0x42::SmokeTest::R 0: $t1 := move($t0) 1: $t2 := 1 - 2: $t3 := pack SmokeTest::R($t2) - 3: move_to($t3, $t1) + 2: $t3 := pack 0x42::SmokeTest::R($t2) + 3: move_to<0x42::SmokeTest::R>($t3, $t1) 4: return () } @@ -153,11 +153,11 @@ fun SmokeTest::create_resource($t0|sender: &signer) { fun SmokeTest::create_resoure_generic($t0|sender: &signer) { var $t1: &signer var $t2: u64 - var $t3: SmokeTest::G + var $t3: 0x42::SmokeTest::G 0: $t1 := move($t0) 1: $t2 := 1 - 2: $t3 := pack SmokeTest::G($t2) - 3: move_to>($t3, $t1) + 2: $t3 := pack 0x42::SmokeTest::G($t2) + 3: move_to<0x42::SmokeTest::G>($t3, $t1) 4: return () } @@ -169,16 +169,16 @@ fun SmokeTest::exists_resource($t0|sender: &signer): bool { var $t3: bool 0: $t1 := move($t0) 1: $t2 := signer::address_of($t1) - 2: $t3 := exists($t2) + 2: $t3 := exists<0x42::SmokeTest::R>($t2) 3: return $t3 } [variant baseline] -fun SmokeTest::identity($t0|a: SmokeTest::A, $t1|b: SmokeTest::B, $t2|c: SmokeTest::C): (SmokeTest::A, SmokeTest::B, SmokeTest::C) { - var $t3: SmokeTest::A - var $t4: SmokeTest::B - var $t5: SmokeTest::C +fun SmokeTest::identity($t0|a: 0x42::SmokeTest::A, $t1|b: 0x42::SmokeTest::B, $t2|c: 0x42::SmokeTest::C): (0x42::SmokeTest::A, 0x42::SmokeTest::B, 0x42::SmokeTest::C) { + var $t3: 0x42::SmokeTest::A + var $t4: 0x42::SmokeTest::B + var $t5: 0x42::SmokeTest::C 0: $t3 := move($t0) 1: $t4 := move($t1) 2: $t5 := move($t2) @@ -189,11 +189,11 @@ fun SmokeTest::identity($t0|a: SmokeTest::A, $t1|b: SmokeTest::B, $t2|c: SmokeTe [variant baseline] fun SmokeTest::move_from_addr($t0|a: address) { var $t1: address - var $t2: SmokeTest::R + var $t2: 0x42::SmokeTest::R var $t3: u64 0: $t1 := move($t0) - 1: $t2 := move_from($t1) - 2: $t3 := unpack SmokeTest::R($t2) + 1: $t2 := move_from<0x42::SmokeTest::R>($t1) + 2: $t3 := unpack 0x42::SmokeTest::R($t2) 3: drop($t3) 4: return () } @@ -203,121 +203,121 @@ fun SmokeTest::move_from_addr($t0|a: address) { fun SmokeTest::move_from_addr_to_sender($t0|sender: &signer, $t1|a: address) { var $t2|x: u64 var $t3: address - var $t4: SmokeTest::R + var $t4: 0x42::SmokeTest::R var $t5: u64 var $t6: &signer var $t7: u64 - var $t8: SmokeTest::R + var $t8: 0x42::SmokeTest::R 0: $t3 := move($t1) - 1: $t4 := move_from($t3) - 2: $t5 := unpack SmokeTest::R($t4) + 1: $t4 := move_from<0x42::SmokeTest::R>($t3) + 2: $t5 := unpack 0x42::SmokeTest::R($t4) 3: $t2 := $t5 4: $t6 := move($t0) 5: $t7 := move($t2) - 6: $t8 := pack SmokeTest::R($t7) - 7: move_to($t8, $t6) + 6: $t8 := pack 0x42::SmokeTest::R($t7) + 7: move_to<0x42::SmokeTest::R>($t8, $t6) 8: return () } [variant baseline] -fun SmokeTest::pack_A($t0|a: address, $t1|va: u64): SmokeTest::A { +fun SmokeTest::pack_A($t0|a: address, $t1|va: u64): 0x42::SmokeTest::A { var $t2: address var $t3: u64 - var $t4: SmokeTest::A + var $t4: 0x42::SmokeTest::A 0: $t2 := move($t0) 1: $t3 := move($t1) - 2: $t4 := pack SmokeTest::A($t2, $t3) + 2: $t4 := pack 0x42::SmokeTest::A($t2, $t3) 3: return $t4 } [variant baseline] -fun SmokeTest::pack_B($t0|a: address, $t1|va: u64, $t2|vb: u64): SmokeTest::B { - var $t3|var_a: SmokeTest::A +fun SmokeTest::pack_B($t0|a: address, $t1|va: u64, $t2|vb: u64): 0x42::SmokeTest::B { + var $t3|var_a: 0x42::SmokeTest::A var $t4: address var $t5: u64 - var $t6: SmokeTest::A + var $t6: 0x42::SmokeTest::A var $t7: u64 - var $t8: SmokeTest::A - var $t9: SmokeTest::B + var $t8: 0x42::SmokeTest::A + var $t9: 0x42::SmokeTest::B 0: $t4 := move($t0) 1: $t5 := move($t1) - 2: $t6 := pack SmokeTest::A($t4, $t5) + 2: $t6 := pack 0x42::SmokeTest::A($t4, $t5) 3: $t3 := $t6 4: $t7 := move($t2) 5: $t8 := move($t3) - 6: $t9 := pack SmokeTest::B($t7, $t8) + 6: $t9 := pack 0x42::SmokeTest::B($t7, $t8) 7: return $t9 } [variant baseline] -fun SmokeTest::pack_C($t0|a: address, $t1|va: u64, $t2|vb: u64, $t3|vc: u64): SmokeTest::C { - var $t4|var_a: SmokeTest::A - var $t5|var_b: SmokeTest::B +fun SmokeTest::pack_C($t0|a: address, $t1|va: u64, $t2|vb: u64, $t3|vc: u64): 0x42::SmokeTest::C { + var $t4|var_a: 0x42::SmokeTest::A + var $t5|var_b: 0x42::SmokeTest::B var $t6: address var $t7: u64 - var $t8: SmokeTest::A + var $t8: 0x42::SmokeTest::A var $t9: u64 - var $t10: SmokeTest::A - var $t11: SmokeTest::B + var $t10: 0x42::SmokeTest::A + var $t11: 0x42::SmokeTest::B var $t12: u64 - var $t13: SmokeTest::B - var $t14: SmokeTest::C + var $t13: 0x42::SmokeTest::B + var $t14: 0x42::SmokeTest::C 0: $t6 := move($t0) 1: $t7 := move($t1) - 2: $t8 := pack SmokeTest::A($t6, $t7) + 2: $t8 := pack 0x42::SmokeTest::A($t6, $t7) 3: $t4 := $t8 4: $t9 := move($t2) 5: $t10 := move($t4) - 6: $t11 := pack SmokeTest::B($t9, $t10) + 6: $t11 := pack 0x42::SmokeTest::B($t9, $t10) 7: $t5 := $t11 8: $t12 := move($t3) 9: $t13 := move($t5) - 10: $t14 := pack SmokeTest::C($t12, $t13) + 10: $t14 := pack 0x42::SmokeTest::C($t12, $t13) 11: return $t14 } [variant baseline] -fun SmokeTest::ref_A($t0|a: address, $t1|b: bool): SmokeTest::A { - var $t2|tmp#$2: SmokeTest::A - var $t3|var_a: SmokeTest::A +fun SmokeTest::ref_A($t0|a: address, $t1|b: bool): 0x42::SmokeTest::A { + var $t2|tmp#$2: 0x42::SmokeTest::A + var $t3|var_a: 0x42::SmokeTest::A var $t4: bool var $t5: address var $t6: u64 - var $t7: SmokeTest::A + var $t7: 0x42::SmokeTest::A var $t8: address var $t9: u64 - var $t10: SmokeTest::A - var $t11: SmokeTest::A - var $t12: &SmokeTest::A + var $t10: 0x42::SmokeTest::A + var $t11: 0x42::SmokeTest::A + var $t12: &0x42::SmokeTest::A var $t13: &u64 var $t14: u64 var $t15: u64 var $t16: bool var $t17: u64 - var $t18: SmokeTest::A + var $t18: 0x42::SmokeTest::A 0: $t4 := move($t1) 1: if ($t4) goto 2 else goto 8 2: label L1 3: $t5 := move($t0) 4: $t6 := 1 - 5: $t7 := pack SmokeTest::A($t5, $t6) + 5: $t7 := pack 0x42::SmokeTest::A($t5, $t6) 6: $t2 := $t7 7: goto 14 8: label L0 9: $t8 := move($t0) 10: $t9 := 42 - 11: $t10 := pack SmokeTest::A($t8, $t9) + 11: $t10 := pack 0x42::SmokeTest::A($t8, $t9) 12: $t2 := $t10 13: goto 14 14: label L2 15: $t11 := move($t2) 16: $t3 := $t11 17: $t12 := borrow_local($t3) - 18: $t13 := borrow_field.val($t12) + 18: $t13 := borrow_field<0x42::SmokeTest::A>.val($t12) 19: $t14 := read_ref($t13) 20: $t15 := 42 21: $t16 := !=($t14, $t15) @@ -335,13 +335,13 @@ fun SmokeTest::ref_A($t0|a: address, $t1|b: bool): SmokeTest::A { fun SmokeTest::unpack_A($t0|a: address, $t1|va: u64): (address, u64) { var $t2: address var $t3: u64 - var $t4: SmokeTest::A + var $t4: 0x42::SmokeTest::A var $t5: address var $t6: u64 0: $t2 := move($t0) 1: $t3 := move($t1) - 2: $t4 := pack SmokeTest::A($t2, $t3) - 3: ($t5, $t6) := unpack SmokeTest::A($t4) + 2: $t4 := pack 0x42::SmokeTest::A($t2, $t3) + 3: ($t5, $t6) := unpack 0x42::SmokeTest::A($t4) 4: return ($t5, $t6) } @@ -351,15 +351,15 @@ fun SmokeTest::unpack_B($t0|a: address, $t1|va: u64, $t2|vb: u64): (address, u64 var $t3|aa: address var $t4|v1: u64 var $t5|v2: u64 - var $t6|var_a: SmokeTest::A + var $t6|var_a: 0x42::SmokeTest::A var $t7: address var $t8: u64 - var $t9: SmokeTest::A + var $t9: 0x42::SmokeTest::A var $t10: u64 - var $t11: SmokeTest::A - var $t12: SmokeTest::B + var $t11: 0x42::SmokeTest::A + var $t12: 0x42::SmokeTest::B var $t13: u64 - var $t14: SmokeTest::A + var $t14: 0x42::SmokeTest::A var $t15: address var $t16: u64 var $t17: address @@ -367,13 +367,13 @@ fun SmokeTest::unpack_B($t0|a: address, $t1|va: u64, $t2|vb: u64): (address, u64 var $t19: u64 0: $t7 := move($t0) 1: $t8 := move($t1) - 2: $t9 := pack SmokeTest::A($t7, $t8) + 2: $t9 := pack 0x42::SmokeTest::A($t7, $t8) 3: $t6 := $t9 4: $t10 := move($t2) 5: $t11 := move($t6) - 6: $t12 := pack SmokeTest::B($t10, $t11) - 7: ($t13, $t14) := unpack SmokeTest::B($t12) - 8: ($t15, $t16) := unpack SmokeTest::A($t14) + 6: $t12 := pack 0x42::SmokeTest::B($t10, $t11) + 7: ($t13, $t14) := unpack 0x42::SmokeTest::B($t12) + 8: ($t15, $t16) := unpack 0x42::SmokeTest::A($t14) 9: $t4 := $t16 10: $t3 := $t15 11: $t5 := $t13 @@ -390,21 +390,21 @@ fun SmokeTest::unpack_C($t0|a: address, $t1|va: u64, $t2|vb: u64, $t3|vc: u64): var $t5|v1: u64 var $t6|v2: u64 var $t7|v3: u64 - var $t8|var_a: SmokeTest::A - var $t9|var_b: SmokeTest::B + var $t8|var_a: 0x42::SmokeTest::A + var $t9|var_b: 0x42::SmokeTest::B var $t10: address var $t11: u64 - var $t12: SmokeTest::A + var $t12: 0x42::SmokeTest::A var $t13: u64 - var $t14: SmokeTest::A - var $t15: SmokeTest::B + var $t14: 0x42::SmokeTest::A + var $t15: 0x42::SmokeTest::B var $t16: u64 - var $t17: SmokeTest::B - var $t18: SmokeTest::C + var $t17: 0x42::SmokeTest::B + var $t18: 0x42::SmokeTest::C var $t19: u64 - var $t20: SmokeTest::B + var $t20: 0x42::SmokeTest::B var $t21: u64 - var $t22: SmokeTest::A + var $t22: 0x42::SmokeTest::A var $t23: address var $t24: u64 var $t25: address @@ -413,18 +413,18 @@ fun SmokeTest::unpack_C($t0|a: address, $t1|va: u64, $t2|vb: u64, $t3|vc: u64): var $t28: u64 0: $t10 := move($t0) 1: $t11 := move($t1) - 2: $t12 := pack SmokeTest::A($t10, $t11) + 2: $t12 := pack 0x42::SmokeTest::A($t10, $t11) 3: $t8 := $t12 4: $t13 := move($t2) 5: $t14 := move($t8) - 6: $t15 := pack SmokeTest::B($t13, $t14) + 6: $t15 := pack 0x42::SmokeTest::B($t13, $t14) 7: $t9 := $t15 8: $t16 := move($t3) 9: $t17 := move($t9) - 10: $t18 := pack SmokeTest::C($t16, $t17) - 11: ($t19, $t20) := unpack SmokeTest::C($t18) - 12: ($t21, $t22) := unpack SmokeTest::B($t20) - 13: ($t23, $t24) := unpack SmokeTest::A($t22) + 10: $t18 := pack 0x42::SmokeTest::C($t16, $t17) + 11: ($t19, $t20) := unpack 0x42::SmokeTest::C($t18) + 12: ($t21, $t22) := unpack 0x42::SmokeTest::B($t20) + 13: ($t23, $t24) := unpack 0x42::SmokeTest::A($t22) 14: $t5 := $t24 15: $t4 := $t23 16: $t6 := $t21 diff --git a/third_party/move/move-model/bytecode/tests/livevar/basic_test.v2_exp b/third_party/move/move-model/bytecode/tests/livevar/basic_test.v2_exp index b86f412b221d5..d5f62b2d210b4 100644 --- a/third_party/move/move-model/bytecode/tests/livevar/basic_test.v2_exp +++ b/third_party/move/move-model/bytecode/tests/livevar/basic_test.v2_exp @@ -1,12 +1,12 @@ ============ initial translation from Move ================ [variant baseline] -fun TestLiveVars::test1($t0|r_ref: &TestLiveVars::R): u64 { - var $t1: &TestLiveVars::R +fun TestLiveVars::test1($t0|r_ref: &0x42::TestLiveVars::R): u64 { + var $t1: &0x42::TestLiveVars::R var $t2: &u64 var $t3: u64 0: $t1 := move($t0) - 1: $t2 := borrow_field.x($t1) + 1: $t2 := borrow_field<0x42::TestLiveVars::R>.x($t1) 2: $t3 := read_ref($t2) 3: return $t3 } @@ -14,24 +14,24 @@ fun TestLiveVars::test1($t0|r_ref: &TestLiveVars::R): u64 { [variant baseline] fun TestLiveVars::test2($t0|b: bool): u64 { - var $t1|r1: TestLiveVars::R - var $t2|r2: TestLiveVars::R - var $t3|r_ref: &TestLiveVars::R + var $t1|r1: 0x42::TestLiveVars::R + var $t2|r2: 0x42::TestLiveVars::R + var $t3|r_ref: &0x42::TestLiveVars::R var $t4: u64 - var $t5: TestLiveVars::R + var $t5: 0x42::TestLiveVars::R var $t6: u64 - var $t7: TestLiveVars::R - var $t8: &TestLiveVars::R + var $t7: 0x42::TestLiveVars::R + var $t8: &0x42::TestLiveVars::R var $t9: bool - var $t10: &TestLiveVars::R - var $t11: &TestLiveVars::R - var $t12: &TestLiveVars::R + var $t10: &0x42::TestLiveVars::R + var $t11: &0x42::TestLiveVars::R + var $t12: &0x42::TestLiveVars::R var $t13: u64 0: $t4 := 3 - 1: $t5 := pack TestLiveVars::R($t4) + 1: $t5 := pack 0x42::TestLiveVars::R($t4) 2: $t1 := $t5 3: $t6 := 4 - 4: $t7 := pack TestLiveVars::R($t6) + 4: $t7 := pack 0x42::TestLiveVars::R($t6) 5: $t2 := $t7 6: $t8 := borrow_local($t1) 7: $t3 := $t8 @@ -51,34 +51,34 @@ fun TestLiveVars::test2($t0|b: bool): u64 { [variant baseline] -fun TestLiveVars::test3($t0|n: u64, $t1|r_ref: &TestLiveVars::R): u64 { - var $t2|r1: TestLiveVars::R - var $t3|r2: TestLiveVars::R +fun TestLiveVars::test3($t0|n: u64, $t1|r_ref: &0x42::TestLiveVars::R): u64 { + var $t2|r1: 0x42::TestLiveVars::R + var $t3|r2: 0x42::TestLiveVars::R var $t4: u64 - var $t5: TestLiveVars::R + var $t5: 0x42::TestLiveVars::R var $t6: u64 - var $t7: TestLiveVars::R + var $t7: 0x42::TestLiveVars::R var $t8: u64 var $t9: u64 var $t10: bool - var $t11: &TestLiveVars::R + var $t11: &0x42::TestLiveVars::R var $t12: u64 var $t13: u64 var $t14: u64 var $t15: u64 var $t16: bool - var $t17: &TestLiveVars::R - var $t18: &TestLiveVars::R + var $t17: &0x42::TestLiveVars::R + var $t18: &0x42::TestLiveVars::R var $t19: u64 var $t20: u64 var $t21: u64 - var $t22: &TestLiveVars::R + var $t22: &0x42::TestLiveVars::R var $t23: u64 0: $t4 := 3 - 1: $t5 := pack TestLiveVars::R($t4) + 1: $t5 := pack 0x42::TestLiveVars::R($t4) 2: $t2 := $t5 3: $t6 := 4 - 4: $t7 := pack TestLiveVars::R($t6) + 4: $t7 := pack 0x42::TestLiveVars::R($t6) 5: $t3 := $t7 6: goto 7 7: label L6 @@ -120,11 +120,11 @@ fun TestLiveVars::test3($t0|n: u64, $t1|r_ref: &TestLiveVars::R): u64 { ============ after pipeline `livevar` ================ [variant baseline] -fun TestLiveVars::test1($t0|r_ref: &TestLiveVars::R): u64 { +fun TestLiveVars::test1($t0|r_ref: &0x42::TestLiveVars::R): u64 { var $t1: &u64 var $t2: u64 # live vars: r_ref - 0: $t1 := borrow_field.x($t0) + 0: $t1 := borrow_field<0x42::TestLiveVars::R>.x($t0) # live vars: $t1 1: $t2 := read_ref($t1) # live vars: $t2 @@ -134,22 +134,22 @@ fun TestLiveVars::test1($t0|r_ref: &TestLiveVars::R): u64 { [variant baseline] fun TestLiveVars::test2($t0|b: bool): u64 { - var $t1|r1: TestLiveVars::R - var $t2|r2: TestLiveVars::R - var $t3|r_ref: &TestLiveVars::R + var $t1|r1: 0x42::TestLiveVars::R + var $t2|r2: 0x42::TestLiveVars::R + var $t3|r_ref: &0x42::TestLiveVars::R var $t4: u64 var $t5: u64 - var $t6: &TestLiveVars::R - var $t7: &TestLiveVars::R + var $t6: &0x42::TestLiveVars::R + var $t7: &0x42::TestLiveVars::R var $t8: u64 # live vars: b 0: $t4 := 3 # live vars: b, $t4 - 1: $t1 := pack TestLiveVars::R($t4) + 1: $t1 := pack 0x42::TestLiveVars::R($t4) # live vars: b, r1 2: $t5 := 4 # live vars: b, r1, $t5 - 3: $t2 := pack TestLiveVars::R($t5) + 3: $t2 := pack 0x42::TestLiveVars::R($t5) # live vars: b, r1, r2 4: $t6 := borrow_local($t1) # live vars: b, r2, $t6 @@ -188,9 +188,9 @@ fun TestLiveVars::test2($t0|b: bool): u64 { [variant baseline] -fun TestLiveVars::test3($t0|n: u64, $t1|r_ref: &TestLiveVars::R): u64 { - var $t2|r1: TestLiveVars::R - var $t3|r2: TestLiveVars::R +fun TestLiveVars::test3($t0|n: u64, $t1|r_ref: &0x42::TestLiveVars::R): u64 { + var $t2|r1: 0x42::TestLiveVars::R + var $t3|r2: 0x42::TestLiveVars::R var $t4: u64 var $t5: u64 var $t6: u64 @@ -199,18 +199,18 @@ fun TestLiveVars::test3($t0|n: u64, $t1|r_ref: &TestLiveVars::R): u64 { var $t9: u64 var $t10: u64 var $t11: bool - var $t12: &TestLiveVars::R - var $t13: &TestLiveVars::R + var $t12: &0x42::TestLiveVars::R + var $t13: &0x42::TestLiveVars::R var $t14: u64 var $t15: u64 # live vars: n, r_ref 0: $t4 := 3 # live vars: n, r_ref, $t4 - 1: $t2 := pack TestLiveVars::R($t4) + 1: $t2 := pack 0x42::TestLiveVars::R($t4) # live vars: n, r_ref, r1 2: $t5 := 4 # live vars: n, r_ref, r1, $t5 - 3: $t3 := pack TestLiveVars::R($t5) + 3: $t3 := pack 0x42::TestLiveVars::R($t5) # live vars: n, r_ref, r1, r2 4: goto 5 # live vars: n, r_ref, r1, r2 diff --git a/third_party/move/move-model/bytecode/tests/reaching_def/basic_test.v2_exp b/third_party/move/move-model/bytecode/tests/reaching_def/basic_test.v2_exp index f6a91b898b558..edb808910e04c 100644 --- a/third_party/move/move-model/bytecode/tests/reaching_def/basic_test.v2_exp +++ b/third_party/move/move-model/bytecode/tests/reaching_def/basic_test.v2_exp @@ -25,12 +25,12 @@ fun ReachingDefTest::create_resource($t0|sender: &signer) { var $t1: &signer var $t2: u64 var $t3: bool - var $t4: ReachingDefTest::R + var $t4: 0x42::ReachingDefTest::R 0: $t1 := move($t0) 1: $t2 := 1 2: $t3 := false - 3: $t4 := pack ReachingDefTest::R($t2, $t3) - 4: move_to($t4, $t1) + 3: $t4 := pack 0x42::ReachingDefTest::R($t2, $t3) + 4: move_to<0x42::ReachingDefTest::R>($t4, $t1) 5: return () } @@ -61,11 +61,11 @@ fun ReachingDefTest::create_resource($t0|sender: &signer) { var $t1: &signer var $t2: u64 var $t3: bool - var $t4: ReachingDefTest::R + var $t4: 0x42::ReachingDefTest::R 0: $t1 := move($t0) 1: $t2 := 1 2: $t3 := false - 3: $t4 := pack ReachingDefTest::R($t2, $t3) - 4: move_to($t4, $t0) + 3: $t4 := pack 0x42::ReachingDefTest::R($t2, $t3) + 4: move_to<0x42::ReachingDefTest::R>($t4, $t0) 5: return () } diff --git a/third_party/move/move-model/bytecode/tests/usage_analysis/test.v2_exp b/third_party/move/move-model/bytecode/tests/usage_analysis/test.v2_exp index 3d955b5512ada..6af0754f00c4a 100644 --- a/third_party/move/move-model/bytecode/tests/usage_analysis/test.v2_exp +++ b/third_party/move/move-model/bytecode/tests/usage_analysis/test.v2_exp @@ -4,12 +4,12 @@ public fun Test::update<#0>($t0|x: #0) { var $t1: #0 var $t2: address - var $t3: &mut Test::A<#0, #0> + var $t3: &mut 0x123::Test::A<#0, #0> var $t4: &mut #0 0: $t1 := move($t0) 1: $t2 := 0x1 - 2: $t3 := borrow_global>($t2) - 3: $t4 := borrow_field>.x1($t3) + 2: $t3 := borrow_global<0x123::Test::A<#0, #0>>($t2) + 3: $t4 := borrow_field<0x123::Test::A<#0, #0>>.x1($t3) 4: write_ref($t4, $t1) 5: return () } @@ -17,8 +17,8 @@ public fun Test::update<#0>($t0|x: #0) { [variant baseline] public fun Test::assert_assume_memory() { - 0: assume exists>(0x1) - 1: assert exists>(0x1) + 0: assume exists<0x123::Test::A>(0x1) + 1: assert exists<0x123::Test::A>(0x1) 2: return () } @@ -31,12 +31,12 @@ public fun Test::call_assert_assume_memory() { [variant baseline] -public fun Test::publish<#0>($t0|signer: &signer, $t1|x: Test::A<#0, u8>) { +public fun Test::publish<#0>($t0|signer: &signer, $t1|x: 0x123::Test::A<#0, u8>) { var $t2: &signer - var $t3: Test::A<#0, u8> + var $t3: 0x123::Test::A<#0, u8> 0: $t2 := move($t0) 1: $t3 := move($t1) - 2: move_to>($t3, $t2) + 2: move_to<0x123::Test::A<#0, u8>>($t3, $t2) 3: return () } @@ -46,7 +46,7 @@ public fun Test::test<#0>(): bool { var $t0: address var $t1: bool 0: $t0 := 0x1 - 1: $t1 := exists>($t0) + 1: $t1 := exists<0x123::Test::A>($t0) 2: return $t1 } @@ -64,12 +64,12 @@ public fun Test::update_caller() { public fun Test::update_ints() { var $t0: u64 var $t1: address - var $t2: &mut Test::A + var $t2: &mut 0x123::Test::A var $t3: &mut u64 0: $t0 := 22 1: $t1 := 0x1 - 2: $t2 := borrow_global>($t1) - 3: $t3 := borrow_field>.x1($t2) + 2: $t2 := borrow_global<0x123::Test::A>($t1) + 3: $t3 := borrow_field<0x123::Test::A>.x1($t2) 4: write_ref($t3, $t0) 5: return () } @@ -80,12 +80,12 @@ public fun Test::update_ints() { public fun Test::update<#0>($t0|x: #0) { var $t1: #0 var $t2: address - var $t3: &mut Test::A<#0, #0> + var $t3: &mut 0x123::Test::A<#0, #0> var $t4: &mut #0 0: $t1 := move($t0) 1: $t2 := 0x1 - 2: $t3 := borrow_global>($t2) - 3: $t4 := borrow_field>.x1($t3) + 2: $t3 := borrow_global<0x123::Test::A<#0, #0>>($t2) + 3: $t4 := borrow_field<0x123::Test::A<#0, #0>>.x1($t3) 4: write_ref($t4, $t1) 5: return () } @@ -93,8 +93,8 @@ public fun Test::update<#0>($t0|x: #0) { [variant baseline] public fun Test::assert_assume_memory() { - 0: assume exists>(0x1) - 1: assert exists>(0x1) + 0: assume exists<0x123::Test::A>(0x1) + 1: assert exists<0x123::Test::A>(0x1) 2: return () } @@ -107,12 +107,12 @@ public fun Test::call_assert_assume_memory() { [variant baseline] -public fun Test::publish<#0>($t0|signer: &signer, $t1|x: Test::A<#0, u8>) { +public fun Test::publish<#0>($t0|signer: &signer, $t1|x: 0x123::Test::A<#0, u8>) { var $t2: &signer - var $t3: Test::A<#0, u8> + var $t3: 0x123::Test::A<#0, u8> 0: $t2 := move($t0) 1: $t3 := move($t1) - 2: move_to>($t3, $t2) + 2: move_to<0x123::Test::A<#0, u8>>($t3, $t2) 3: return () } @@ -122,7 +122,7 @@ public fun Test::test<#0>(): bool { var $t0: address var $t1: bool 0: $t0 := 0x1 - 1: $t1 := exists>($t0) + 1: $t1 := exists<0x123::Test::A>($t0) 2: return $t1 } @@ -140,12 +140,12 @@ public fun Test::update_caller() { public fun Test::update_ints() { var $t0: u64 var $t1: address - var $t2: &mut Test::A + var $t2: &mut 0x123::Test::A var $t3: &mut u64 0: $t0 := 22 1: $t1 := 0x1 - 2: $t2 := borrow_global>($t1) - 3: $t3 := borrow_field>.x1($t2) + 2: $t2 := borrow_global<0x123::Test::A>($t1) + 3: $t3 := borrow_field<0x123::Test::A>.x1($t2) 4: write_ref($t3, $t0) 5: return () } diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/borrow.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/borrow.v2_exp index 544df24772dae..01f5a92eabcd0 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/borrow.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/borrow.v2_exp @@ -3,12 +3,12 @@ [variant baseline] public fun Test::test_borrow_imm<#0>(): u64 { var $t0: address - var $t1: &Test::R<#0> + var $t1: &0x42::Test::R<#0> var $t2: &u64 var $t3: u64 0: $t0 := 0x1 - 1: $t1 := borrow_global>($t0) - 2: $t2 := borrow_field>.x($t1) + 1: $t1 := borrow_global<0x42::Test::R<#0>>($t0) + 2: $t2 := borrow_field<0x42::Test::R<#0>>.x($t1) 3: $t3 := read_ref($t2) 4: return $t3 } @@ -16,72 +16,72 @@ public fun Test::test_borrow_imm<#0>(): u64 { [variant baseline] public fun Test::test_borrow_mut<#0>(): u64 { - var $t0|r: &mut Test::R<#0> + var $t0|r: &mut 0x42::Test::R<#0> var $t1: address - var $t2: &mut Test::R<#0> + var $t2: &mut 0x42::Test::R<#0> var $t3: u64 - var $t4: &mut Test::R<#0> - var $t5: &mut Test::S + var $t4: &mut 0x42::Test::R<#0> + var $t5: &mut 0x42::Test::S var $t6: &mut u64 var $t7: u64 - var $t8: &mut Test::R<#0> + var $t8: &mut 0x42::Test::R<#0> var $t9: &mut u64 - var $t10: &mut Test::R<#0> + var $t10: &mut 0x42::Test::R<#0> var $t11: &u64 var $t12: u64 0: $t1 := 0x1 - 1: $t2 := borrow_global>($t1) + 1: $t2 := borrow_global<0x42::Test::R<#0>>($t1) 2: $t0 := $t2 3: $t3 := 2 4: $t4 := copy($t0) - 5: $t5 := borrow_field>.s($t4) - 6: $t6 := borrow_field.y($t5) + 5: $t5 := borrow_field<0x42::Test::R<#0>>.s($t4) + 6: $t6 := borrow_field<0x42::Test::S>.y($t5) 7: write_ref($t6, $t3) 8: $t7 := 3 9: $t8 := copy($t0) - 10: $t9 := borrow_field>.x($t8) + 10: $t9 := borrow_field<0x42::Test::R<#0>>.x($t8) 11: write_ref($t9, $t7) 12: $t10 := move($t0) - 13: $t11 := borrow_field>.x($t10) + 13: $t11 := borrow_field<0x42::Test::R<#0>>.x($t10) 14: $t12 := read_ref($t11) 15: return $t12 } [variant baseline] -public fun Test::test_borrow_mut_local(): Test::R { - var $t0|d: Test::R - var $t1|r: &mut Test::R +public fun Test::test_borrow_mut_local(): 0x42::Test::R { + var $t0|d: 0x42::Test::R + var $t1|r: &mut 0x42::Test::R var $t2: u64 var $t3: u64 - var $t4: Test::S + var $t4: 0x42::Test::S var $t5: u64 - var $t6: Test::R - var $t7: &mut Test::R + var $t6: 0x42::Test::R + var $t7: &mut 0x42::Test::R var $t8: u64 - var $t9: &mut Test::R - var $t10: &mut Test::S + var $t9: &mut 0x42::Test::R + var $t10: &mut 0x42::Test::S var $t11: &mut u64 var $t12: u64 - var $t13: &mut Test::R + var $t13: &mut 0x42::Test::R var $t14: &mut u64 - var $t15: Test::R + var $t15: 0x42::Test::R 0: $t2 := 2 1: $t3 := 1 - 2: $t4 := pack Test::S($t3) + 2: $t4 := pack 0x42::Test::S($t3) 3: $t5 := 0 - 4: $t6 := pack Test::R($t2, $t4, $t5) + 4: $t6 := pack 0x42::Test::R($t2, $t4, $t5) 5: $t0 := $t6 6: $t7 := borrow_local($t0) 7: $t1 := $t7 8: $t8 := 2 9: $t9 := copy($t1) - 10: $t10 := borrow_field>.s($t9) - 11: $t11 := borrow_field.y($t10) + 10: $t10 := borrow_field<0x42::Test::R>.s($t9) + 11: $t11 := borrow_field<0x42::Test::S>.y($t10) 12: write_ref($t11, $t8) 13: $t12 := 3 14: $t13 := move($t1) - 15: $t14 := borrow_field>.x($t13) + 15: $t14 := borrow_field<0x42::Test::R>.x($t13) 16: write_ref($t14, $t12) 17: $t15 := move($t0) 18: return $t15 @@ -92,13 +92,13 @@ public fun Test::test_borrow_mut_local(): Test::R { [variant verification] public fun Test::test_borrow_imm<#0>(): u64 { var $t0: address - var $t1: Test::R<#0> + var $t1: 0x42::Test::R<#0> var $t2: num var $t3: u64 - 0: assume forall $rsc: Test::R<#0>: ResourceDomain>(): And(WellFormed($rsc), And(Gt(select Test::R.x($rsc), select Test::S.y(select Test::R.s($rsc))), Gt(select Test::S.y(select Test::R.s($rsc)), 0))) + 0: assume forall $rsc: 0x42::Test::R<#0>: ResourceDomain<0x42::Test::R<#0>>(): And(WellFormed($rsc), And(Gt(select Test::R.x($rsc), select Test::S.y<0x42::Test::S>(select Test::R.s($rsc))), Gt(select Test::S.y(select Test::R.s($rsc)), 0))) 1: $t0 := 0x1 - 2: $t1 := get_global>($t0) on_abort goto 6 with $t2 - 3: $t3 := get_field>.x($t1) + 2: $t1 := get_global<0x42::Test::R<#0>>($t0) on_abort goto 6 with $t2 + 3: $t3 := get_field<0x42::Test::R<#0>>.x($t1) 4: label L1 5: return $t3 6: label L2 @@ -108,37 +108,37 @@ public fun Test::test_borrow_imm<#0>(): u64 { [variant verification] public fun Test::test_borrow_mut<#0>(): u64 { - var $t0|r: &mut Test::R<#0> + var $t0|r: &mut 0x42::Test::R<#0> var $t1: address - var $t2: &mut Test::R<#0> + var $t2: &mut 0x42::Test::R<#0> var $t3: num var $t4: u64 - var $t5: &mut Test::S + var $t5: &mut 0x42::Test::S var $t6: &mut u64 var $t7: u64 var $t8: &mut u64 var $t9: u64 - 0: assume forall $rsc: Test::R<#0>: ResourceDomain>(): And(WellFormed($rsc), And(Gt(select Test::R.x($rsc), select Test::S.y(select Test::R.s($rsc))), Gt(select Test::S.y(select Test::R.s($rsc)), 0))) + 0: assume forall $rsc: 0x42::Test::R<#0>: ResourceDomain<0x42::Test::R<#0>>(): And(WellFormed($rsc), And(Gt(select Test::R.x($rsc), select Test::S.y<0x42::Test::S>(select Test::R.s($rsc))), Gt(select Test::S.y(select Test::R.s($rsc)), 0))) 1: $t1 := 0x1 - 2: $t2 := borrow_global>($t1) on_abort goto 19 with $t3 + 2: $t2 := borrow_global<0x42::Test::R<#0>>($t1) on_abort goto 19 with $t3 3: $t4 := 2 - 4: $t5 := borrow_field>.s($t2) - 5: $t6 := borrow_field.y($t5) + 4: $t5 := borrow_field<0x42::Test::R<#0>>.s($t2) + 5: $t6 := borrow_field<0x42::Test::S>.y($t5) 6: write_ref($t6, $t4) 7: write_back[Reference($t5).y (u64)]($t6) - 8: write_back[Reference($t2).s (Test::S)]($t5) + 8: write_back[Reference($t2).s (0x42::Test::S)]($t5) 9: $t7 := 3 - 10: $t8 := borrow_field>.x($t2) + 10: $t8 := borrow_field<0x42::Test::R<#0>>.x($t2) 11: write_ref($t8, $t7) 12: write_back[Reference($t2).x (u64)]($t8) - 13: $t9 := get_field>.x($t2) + 13: $t9 := get_field<0x42::Test::R<#0>>.x($t2) # data invariant at tests/data_invariant_instrumentation/borrow.move:13:9+18 # VC: data invariant does not hold at tests/data_invariant_instrumentation/borrow.move:13:9+18 - 14: assert Gt(select Test::R.x($t2), select Test::S.y(select Test::R.s($t2))) + 14: assert Gt(select Test::R.x($t2), select Test::S.y<0x42::Test::S>(select Test::R.s($t2))) # data invariant at tests/data_invariant_instrumentation/borrow.move:17:9+16 # VC: data invariant does not hold at tests/data_invariant_instrumentation/borrow.move:17:9+16 15: assert Gt(select Test::S.y(select Test::R.s($t2)), 0) - 16: write_back[Test::R<#0>@]($t2) + 16: write_back[0x42::Test::R<#0>@]($t2) 17: label L1 18: return $t9 19: label L2 @@ -147,45 +147,45 @@ public fun Test::test_borrow_mut<#0>(): u64 { [variant verification] -public fun Test::test_borrow_mut_local(): Test::R { - var $t0|d: Test::R - var $t1|r: &mut Test::R +public fun Test::test_borrow_mut_local(): 0x42::Test::R { + var $t0|d: 0x42::Test::R + var $t1|r: &mut 0x42::Test::R var $t2: u64 var $t3: u64 - var $t4: Test::S + var $t4: 0x42::Test::S var $t5: u64 - var $t6: &mut Test::R + var $t6: &mut 0x42::Test::R var $t7: u64 - var $t8: &mut Test::S + var $t8: &mut 0x42::Test::S var $t9: &mut u64 var $t10: u64 var $t11: &mut u64 - var $t12: Test::R + var $t12: 0x42::Test::R 0: $t2 := 2 1: $t3 := 1 - 2: $t4 := pack Test::S($t3) + 2: $t4 := pack 0x42::Test::S($t3) # data invariant at tests/data_invariant_instrumentation/borrow.move:17:9+16 # VC: data invariant does not hold at tests/data_invariant_instrumentation/borrow.move:17:9+16 3: assert Gt(select Test::S.y($t4), 0) 4: $t5 := 0 - 5: $t0 := pack Test::R($t2, $t4, $t5) + 5: $t0 := pack 0x42::Test::R($t2, $t4, $t5) # data invariant at tests/data_invariant_instrumentation/borrow.move:13:9+18 # VC: data invariant does not hold at tests/data_invariant_instrumentation/borrow.move:13:9+18 - 6: assert Gt(select Test::R.x($t0), select Test::S.y(select Test::R.s($t0))) + 6: assert Gt(select Test::R.x($t0), select Test::S.y<0x42::Test::S>(select Test::R.s($t0))) 7: $t6 := borrow_local($t0) 8: $t7 := 2 - 9: $t8 := borrow_field>.s($t6) - 10: $t9 := borrow_field.y($t8) + 9: $t8 := borrow_field<0x42::Test::R>.s($t6) + 10: $t9 := borrow_field<0x42::Test::S>.y($t8) 11: write_ref($t9, $t7) 12: write_back[Reference($t8).y (u64)]($t9) - 13: write_back[Reference($t6).s (Test::S)]($t8) + 13: write_back[Reference($t6).s (0x42::Test::S)]($t8) 14: $t10 := 3 - 15: $t11 := borrow_field>.x($t6) + 15: $t11 := borrow_field<0x42::Test::R>.x($t6) 16: write_ref($t11, $t10) 17: write_back[Reference($t6).x (u64)]($t11) # data invariant at tests/data_invariant_instrumentation/borrow.move:13:9+18 # VC: data invariant does not hold at tests/data_invariant_instrumentation/borrow.move:13:9+18 - 18: assert Gt(select Test::R.x($t6), select Test::S.y(select Test::R.s($t6))) + 18: assert Gt(select Test::R.x($t6), select Test::S.y<0x42::Test::S>(select Test::R.s($t6))) # data invariant at tests/data_invariant_instrumentation/borrow.move:17:9+16 # VC: data invariant does not hold at tests/data_invariant_instrumentation/borrow.move:17:9+16 19: assert Gt(select Test::S.y(select Test::R.s($t6)), 0) diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/pack.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/pack.v2_exp index 572e482b9d868..61ccf20a63df0 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/pack.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/pack.v2_exp @@ -1,36 +1,36 @@ ============ initial translation from Move ================ [variant baseline] -public fun Test::test_pack(): Test::R { +public fun Test::test_pack(): 0x42::Test::R { var $t0: u64 var $t1: u64 - var $t2: Test::S - var $t3: Test::R + var $t2: 0x42::Test::S + var $t3: 0x42::Test::R 0: $t0 := 3 1: $t1 := 1 - 2: $t2 := pack Test::S($t1) - 3: $t3 := pack Test::R($t0, $t2) + 2: $t2 := pack 0x42::Test::S($t1) + 3: $t3 := pack 0x42::Test::R($t0, $t2) 4: return $t3 } ============ after pipeline `data_invariant_instrumentation` ================ [variant verification] -public fun Test::test_pack(): Test::R { +public fun Test::test_pack(): 0x42::Test::R { var $t0: u64 var $t1: u64 - var $t2: Test::S - var $t3: Test::R + var $t2: 0x42::Test::S + var $t3: 0x42::Test::R 0: $t0 := 3 1: $t1 := 1 - 2: $t2 := pack Test::S($t1) + 2: $t2 := pack 0x42::Test::S($t1) # data invariant at tests/data_invariant_instrumentation/pack.move:16:9+16 # VC: data invariant does not hold at tests/data_invariant_instrumentation/pack.move:16:9+16 3: assert Gt(select Test::S.y($t2), 0) - 4: $t3 := pack Test::R($t0, $t2) + 4: $t3 := pack 0x42::Test::R($t0, $t2) # data invariant at tests/data_invariant_instrumentation/pack.move:12:9+18 # VC: data invariant does not hold at tests/data_invariant_instrumentation/pack.move:12:9+18 - 5: assert Gt(select Test::R.x($t3), select Test::S.y(select Test::R.s($t3))) + 5: assert Gt(select Test::R.x($t3), select Test::S.y<0x42::Test::S>(select Test::R.s($t3))) 6: label L1 7: return $t3 } diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/params.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/params.v2_exp index 5d342fe5efece..6082ece7d2ad3 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/params.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/params.v2_exp @@ -1,22 +1,22 @@ ============ initial translation from Move ================ [variant baseline] -public fun Test::test_param($t0|_simple_R: Test::R, $t1|_ref_R: &Test::R, $t2|_simple_S: Test::S, $t3|_mut_R: &mut Test::R) { +public fun Test::test_param($t0|_simple_R: 0x42::Test::R, $t1|_ref_R: &0x42::Test::R, $t2|_simple_S: 0x42::Test::S, $t3|_mut_R: &mut 0x42::Test::R) { 0: return () } ============ after pipeline `data_invariant_instrumentation` ================ [variant verification] -public fun Test::test_param($t0|_simple_R: Test::R, $t1|_ref_R: Test::R, $t2|_simple_S: Test::S, $t3|_mut_R: &mut Test::R) { - 0: assume And(WellFormed($t0), And(Gt(select Test::R.x($t0), select Test::S.y(select Test::R.s($t0))), Gt(select Test::S.y(select Test::R.s($t0)), 0))) - 1: assume And(WellFormed($t1), And(Gt(select Test::R.x($t1), select Test::S.y(select Test::R.s($t1))), Gt(select Test::S.y(select Test::R.s($t1)), 0))) +public fun Test::test_param($t0|_simple_R: 0x42::Test::R, $t1|_ref_R: 0x42::Test::R, $t2|_simple_S: 0x42::Test::S, $t3|_mut_R: &mut 0x42::Test::R) { + 0: assume And(WellFormed($t0), And(Gt(select Test::R.x($t0), select Test::S.y<0x42::Test::S>(select Test::R.s($t0))), Gt(select Test::S.y(select Test::R.s($t0)), 0))) + 1: assume And(WellFormed($t1), And(Gt(select Test::R.x($t1), select Test::S.y<0x42::Test::S>(select Test::R.s($t1))), Gt(select Test::S.y(select Test::R.s($t1)), 0))) 2: assume And(WellFormed($t2), Gt(select Test::S.y($t2), 0)) - 3: assume And(WellFormed($t3), And(Gt(select Test::R.x($t3), select Test::S.y(select Test::R.s($t3))), Gt(select Test::S.y(select Test::R.s($t3)), 0))) + 3: assume And(WellFormed($t3), And(Gt(select Test::R.x($t3), select Test::S.y<0x42::Test::S>(select Test::R.s($t3))), Gt(select Test::S.y(select Test::R.s($t3)), 0))) 4: trace_local[_mut_R]($t3) # data invariant at tests/data_invariant_instrumentation/params.move:12:9+18 # VC: data invariant does not hold at tests/data_invariant_instrumentation/params.move:12:9+18 - 5: assert Gt(select Test::R.x($t3), select Test::S.y(select Test::R.s($t3))) + 5: assert Gt(select Test::R.x($t3), select Test::S.y<0x42::Test::S>(select Test::R.s($t3))) # data invariant at tests/data_invariant_instrumentation/params.move:16:9+16 # VC: data invariant does not hold at tests/data_invariant_instrumentation/params.move:16:9+16 6: assert Gt(select Test::S.y(select Test::R.s($t3)), 0) diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/vector.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/vector.v2_exp index ecfaa9fbfb0cb..ea035bed6ae14 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/vector.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/data_invariant_instrumentation/vector.v2_exp @@ -1,15 +1,15 @@ ============ initial translation from Move ================ [variant baseline] -public fun Test::test($t0|_r: Test::R) { +public fun Test::test($t0|_r: 0x42::Test::R) { 0: return () } ============ after pipeline `data_invariant_instrumentation` ================ [variant verification] -public fun Test::test($t0|_r: Test::R) { - 0: assume And(WellFormed($t0), forall $elem: vector: select Test::R.s($t0): forall $elem: Test::S: $elem: Gt(select Test::S.y($elem), 0)) +public fun Test::test($t0|_r: 0x42::Test::R) { + 0: assume And(WellFormed($t0), forall $elem: vector<0x42::Test::S>: select Test::R.s($t0): forall $elem: 0x42::Test::S: $elem: Gt(select Test::S.y($elem), 0)) 1: label L1 2: return () } diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/eliminate_imm_refs/basic_test.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/eliminate_imm_refs/basic_test.v2_exp index c2090dd93003d..65f119cf04aec 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/eliminate_imm_refs/basic_test.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/eliminate_imm_refs/basic_test.v2_exp @@ -1,21 +1,21 @@ ============ initial translation from Move ================ [variant baseline] -fun TestEliminateImmRefs::test1(): TestEliminateImmRefs::R { - var $t0|r: TestEliminateImmRefs::R +fun TestEliminateImmRefs::test1(): 0x42::TestEliminateImmRefs::R { + var $t0|r: 0x42::TestEliminateImmRefs::R var $t1|x_ref: &mut u64 var $t2: u64 - var $t3: TestEliminateImmRefs::R - var $t4: &mut TestEliminateImmRefs::R + var $t3: 0x42::TestEliminateImmRefs::R + var $t4: &mut 0x42::TestEliminateImmRefs::R var $t5: &mut u64 var $t6: u64 var $t7: &mut u64 - var $t8: TestEliminateImmRefs::R + var $t8: 0x42::TestEliminateImmRefs::R 0: $t2 := 3 - 1: $t3 := pack TestEliminateImmRefs::R($t2) + 1: $t3 := pack 0x42::TestEliminateImmRefs::R($t2) 2: $t0 := $t3 3: $t4 := borrow_local($t0) - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::TestEliminateImmRefs::R>.x($t4) 5: $t1 := $t5 6: $t6 := 0 7: $t7 := move($t1) @@ -27,29 +27,29 @@ fun TestEliminateImmRefs::test1(): TestEliminateImmRefs::R { [variant baseline] fun TestEliminateImmRefs::test2(): u64 { - var $t0|r: TestEliminateImmRefs::R + var $t0|r: 0x42::TestEliminateImmRefs::R var $t1: u64 - var $t2: TestEliminateImmRefs::R - var $t3: &TestEliminateImmRefs::R + var $t2: 0x42::TestEliminateImmRefs::R + var $t3: &0x42::TestEliminateImmRefs::R var $t4: &u64 var $t5: u64 0: $t1 := 3 - 1: $t2 := pack TestEliminateImmRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateImmRefs::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) - 4: $t4 := borrow_field.x($t3) + 4: $t4 := borrow_field<0x42::TestEliminateImmRefs::R>.x($t3) 5: $t5 := read_ref($t4) 6: return $t5 } [variant baseline] -fun TestEliminateImmRefs::test3($t0|r_ref: &TestEliminateImmRefs::R): u64 { - var $t1: &TestEliminateImmRefs::R +fun TestEliminateImmRefs::test3($t0|r_ref: &0x42::TestEliminateImmRefs::R): u64 { + var $t1: &0x42::TestEliminateImmRefs::R var $t2: &u64 var $t3: u64 0: $t1 := move($t0) - 1: $t2 := borrow_field.x($t1) + 1: $t2 := borrow_field<0x42::TestEliminateImmRefs::R>.x($t1) 2: $t3 := read_ref($t2) 3: return $t3 } @@ -57,13 +57,13 @@ fun TestEliminateImmRefs::test3($t0|r_ref: &TestEliminateImmRefs::R): u64 { [variant baseline] fun TestEliminateImmRefs::test4(): u64 { - var $t0|r: TestEliminateImmRefs::R + var $t0|r: 0x42::TestEliminateImmRefs::R var $t1: u64 - var $t2: TestEliminateImmRefs::R - var $t3: &TestEliminateImmRefs::R + var $t2: 0x42::TestEliminateImmRefs::R + var $t3: &0x42::TestEliminateImmRefs::R var $t4: u64 0: $t1 := 3 - 1: $t2 := pack TestEliminateImmRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateImmRefs::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := TestEliminateImmRefs::test3($t3) @@ -72,14 +72,14 @@ fun TestEliminateImmRefs::test4(): u64 { [variant baseline] -fun TestEliminateImmRefs::test5(): TestEliminateImmRefs::R { - var $t0|r: TestEliminateImmRefs::R +fun TestEliminateImmRefs::test5(): 0x42::TestEliminateImmRefs::R { + var $t0|r: 0x42::TestEliminateImmRefs::R var $t1: u64 - var $t2: TestEliminateImmRefs::R - var $t3: &TestEliminateImmRefs::R - var $t4: TestEliminateImmRefs::R + var $t2: 0x42::TestEliminateImmRefs::R + var $t3: &0x42::TestEliminateImmRefs::R + var $t4: 0x42::TestEliminateImmRefs::R 0: $t1 := 3 - 1: $t2 := pack TestEliminateImmRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateImmRefs::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: drop($t3) @@ -90,21 +90,21 @@ fun TestEliminateImmRefs::test5(): TestEliminateImmRefs::R { ============ after pipeline `eliminate_imm_refs` ================ [variant baseline] -fun TestEliminateImmRefs::test1(): TestEliminateImmRefs::R { - var $t0|r: TestEliminateImmRefs::R +fun TestEliminateImmRefs::test1(): 0x42::TestEliminateImmRefs::R { + var $t0|r: 0x42::TestEliminateImmRefs::R var $t1|x_ref: &mut u64 var $t2: u64 - var $t3: TestEliminateImmRefs::R - var $t4: &mut TestEliminateImmRefs::R + var $t3: 0x42::TestEliminateImmRefs::R + var $t4: &mut 0x42::TestEliminateImmRefs::R var $t5: &mut u64 var $t6: u64 var $t7: &mut u64 - var $t8: TestEliminateImmRefs::R + var $t8: 0x42::TestEliminateImmRefs::R 0: $t2 := 3 - 1: $t3 := pack TestEliminateImmRefs::R($t2) + 1: $t3 := pack 0x42::TestEliminateImmRefs::R($t2) 2: $t0 := $t3 3: $t4 := borrow_local($t0) - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::TestEliminateImmRefs::R>.x($t4) 5: $t1 := $t5 6: $t6 := 0 7: $t7 := move($t1) @@ -116,29 +116,29 @@ fun TestEliminateImmRefs::test1(): TestEliminateImmRefs::R { [variant baseline] fun TestEliminateImmRefs::test2(): u64 { - var $t0|r: TestEliminateImmRefs::R + var $t0|r: 0x42::TestEliminateImmRefs::R var $t1: u64 - var $t2: TestEliminateImmRefs::R - var $t3: TestEliminateImmRefs::R + var $t2: 0x42::TestEliminateImmRefs::R + var $t3: 0x42::TestEliminateImmRefs::R var $t4: u64 var $t5: u64 0: $t1 := 3 - 1: $t2 := pack TestEliminateImmRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateImmRefs::R($t1) 2: $t0 := $t2 3: $t3 := copy($t0) - 4: $t4 := get_field.x($t3) + 4: $t4 := get_field<0x42::TestEliminateImmRefs::R>.x($t3) 5: $t5 := move($t4) 6: return $t5 } [variant baseline] -fun TestEliminateImmRefs::test3($t0|r_ref: TestEliminateImmRefs::R): u64 { - var $t1: TestEliminateImmRefs::R +fun TestEliminateImmRefs::test3($t0|r_ref: 0x42::TestEliminateImmRefs::R): u64 { + var $t1: 0x42::TestEliminateImmRefs::R var $t2: u64 var $t3: u64 0: $t1 := move($t0) - 1: $t2 := get_field.x($t1) + 1: $t2 := get_field<0x42::TestEliminateImmRefs::R>.x($t1) 2: $t3 := move($t2) 3: return $t3 } @@ -146,13 +146,13 @@ fun TestEliminateImmRefs::test3($t0|r_ref: TestEliminateImmRefs::R): u64 { [variant baseline] fun TestEliminateImmRefs::test4(): u64 { - var $t0|r: TestEliminateImmRefs::R + var $t0|r: 0x42::TestEliminateImmRefs::R var $t1: u64 - var $t2: TestEliminateImmRefs::R - var $t3: TestEliminateImmRefs::R + var $t2: 0x42::TestEliminateImmRefs::R + var $t3: 0x42::TestEliminateImmRefs::R var $t4: u64 0: $t1 := 3 - 1: $t2 := pack TestEliminateImmRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateImmRefs::R($t1) 2: $t0 := $t2 3: $t3 := copy($t0) 4: $t4 := TestEliminateImmRefs::test3($t3) @@ -161,14 +161,14 @@ fun TestEliminateImmRefs::test4(): u64 { [variant baseline] -fun TestEliminateImmRefs::test5(): TestEliminateImmRefs::R { - var $t0|r: TestEliminateImmRefs::R +fun TestEliminateImmRefs::test5(): 0x42::TestEliminateImmRefs::R { + var $t0|r: 0x42::TestEliminateImmRefs::R var $t1: u64 - var $t2: TestEliminateImmRefs::R - var $t3: TestEliminateImmRefs::R - var $t4: TestEliminateImmRefs::R + var $t2: 0x42::TestEliminateImmRefs::R + var $t3: 0x42::TestEliminateImmRefs::R + var $t4: 0x42::TestEliminateImmRefs::R 0: $t1 := 3 - 1: $t2 := pack TestEliminateImmRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateImmRefs::R($t1) 2: $t0 := $t2 3: $t3 := copy($t0) 4: $t4 := move($t0) diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/disable_in_body.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/disable_in_body.v2_exp index 9c89ce115cb80..4f91e8b19bc34 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/disable_in_body.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/disable_in_body.v2_exp @@ -4,11 +4,11 @@ fun DisableInv::foo($t0|s: &signer) { var $t1: &signer var $t2: bool - var $t3: DisableInv::R2 + var $t3: 0x1::DisableInv::R2 0: $t1 := move($t0) 1: $t2 := false - 2: $t3 := pack DisableInv::R2($t2) - 3: move_to($t3, $t1) + 2: $t3 := pack 0x1::DisableInv::R2($t2) + 3: move_to<0x1::DisableInv::R2>($t3, $t1) 4: return () } @@ -17,11 +17,11 @@ fun DisableInv::foo($t0|s: &signer) { [variant verification] fun DisableInv::foo($t0|s: signer) { var $t1: bool - var $t2: DisableInv::R2 + var $t2: 0x1::DisableInv::R2 var $t3: num 0: $t1 := false - 1: $t2 := pack DisableInv::R2($t1) - 2: move_to($t2, $t0) on_abort goto 5 with $t3 + 1: $t2 := pack 0x1::DisableInv::R2($t1) + 2: move_to<0x1::DisableInv::R2>($t2, $t0) on_abort goto 5 with $t3 3: label L1 4: return () 5: label L2 @@ -39,7 +39,7 @@ DisableInv::foo: [ ] ] } - 2: move_to($t2, $t0) on_abort goto L2 with $t3 {} + 2: move_to<0x1::DisableInv::R2>($t2, $t0) on_abort goto L2 with $t3 {} exitpoint { assert @0 = [ <> -> [ diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/mutual_inst.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/mutual_inst.v2_exp index 4c558e0ef0c59..0dfc46750bb9f 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/mutual_inst.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/mutual_inst.v2_exp @@ -6,13 +6,13 @@ public fun S::publish_u64_bool($t0|account: signer, $t1|x: u64, $t2|y: bool) { var $t4: u64 var $t5: bool var $t6: u8 - var $t7: S::Storage + var $t7: 0x2::S::Storage 0: $t3 := borrow_local($t0) 1: $t4 := move($t1) 2: $t5 := move($t2) 3: $t6 := 0 - 4: $t7 := pack S::Storage($t4, $t5, $t6) - 5: move_to>($t7, $t3) + 4: $t7 := pack 0x2::S::Storage($t4, $t5, $t6) + 5: move_to<0x2::S::Storage>($t7, $t3) 6: return () } @@ -23,13 +23,13 @@ public fun S::publish_u64_y<#0>($t0|account: signer, $t1|x: u64, $t2|y: #0) { var $t4: u64 var $t5: #0 var $t6: u8 - var $t7: S::Storage + var $t7: 0x2::S::Storage 0: $t3 := borrow_local($t0) 1: $t4 := move($t1) 2: $t5 := move($t2) 3: $t6 := 1 - 4: $t7 := pack S::Storage($t4, $t5, $t6) - 5: move_to>($t7, $t3) + 4: $t7 := pack 0x2::S::Storage($t4, $t5, $t6) + 5: move_to<0x2::S::Storage>($t7, $t3) 6: return () } @@ -40,13 +40,13 @@ public fun S::publish_x_bool<#0>($t0|account: signer, $t1|x: #0, $t2|y: bool) { var $t4: #0 var $t5: bool var $t6: u8 - var $t7: S::Storage<#0, bool> + var $t7: 0x2::S::Storage<#0, bool> 0: $t3 := borrow_local($t0) 1: $t4 := move($t1) 2: $t5 := move($t2) 3: $t6 := 2 - 4: $t7 := pack S::Storage<#0, bool>($t4, $t5, $t6) - 5: move_to>($t7, $t3) + 4: $t7 := pack 0x2::S::Storage<#0, bool>($t4, $t5, $t6) + 5: move_to<0x2::S::Storage<#0, bool>>($t7, $t3) 6: return () } @@ -57,13 +57,13 @@ public fun S::publish_x_y<#0, #1>($t0|account: signer, $t1|x: #0, $t2|y: #1) { var $t4: #0 var $t5: #1 var $t6: u8 - var $t7: S::Storage<#0, #1> + var $t7: 0x2::S::Storage<#0, #1> 0: $t3 := borrow_local($t0) 1: $t4 := move($t1) 2: $t5 := move($t2) 3: $t6 := 3 - 4: $t7 := pack S::Storage<#0, #1>($t4, $t5, $t6) - 5: move_to>($t7, $t3) + 4: $t7 := pack 0x2::S::Storage<#0, #1>($t4, $t5, $t6) + 5: move_to<0x2::S::Storage<#0, #1>>($t7, $t3) 6: return () } @@ -92,11 +92,11 @@ public fun A::good($t0|account1: signer, $t1|account2: signer) { [variant verification] public fun S::publish_u64_bool($t0|account: signer, $t1|x: u64, $t2|y: bool) { var $t3: u8 - var $t4: S::Storage + var $t4: 0x2::S::Storage var $t5: num 0: $t3 := 0 - 1: $t4 := pack S::Storage($t1, $t2, $t3) - 2: move_to>($t4, $t0) on_abort goto 5 with $t5 + 1: $t4 := pack 0x2::S::Storage($t1, $t2, $t3) + 2: move_to<0x2::S::Storage>($t4, $t0) on_abort goto 5 with $t5 3: label L1 4: return () 5: label L2 @@ -107,11 +107,11 @@ public fun S::publish_u64_bool($t0|account: signer, $t1|x: u64, $t2|y: bool) { [variant verification] public fun S::publish_u64_y<#0>($t0|account: signer, $t1|x: u64, $t2|y: #0) { var $t3: u8 - var $t4: S::Storage + var $t4: 0x2::S::Storage var $t5: num 0: $t3 := 1 - 1: $t4 := pack S::Storage($t1, $t2, $t3) - 2: move_to>($t4, $t0) on_abort goto 5 with $t5 + 1: $t4 := pack 0x2::S::Storage($t1, $t2, $t3) + 2: move_to<0x2::S::Storage>($t4, $t0) on_abort goto 5 with $t5 3: label L1 4: return () 5: label L2 @@ -122,11 +122,11 @@ public fun S::publish_u64_y<#0>($t0|account: signer, $t1|x: u64, $t2|y: #0) { [variant verification] public fun S::publish_x_bool<#0>($t0|account: signer, $t1|x: #0, $t2|y: bool) { var $t3: u8 - var $t4: S::Storage<#0, bool> + var $t4: 0x2::S::Storage<#0, bool> var $t5: num 0: $t3 := 2 - 1: $t4 := pack S::Storage<#0, bool>($t1, $t2, $t3) - 2: move_to>($t4, $t0) on_abort goto 5 with $t5 + 1: $t4 := pack 0x2::S::Storage<#0, bool>($t1, $t2, $t3) + 2: move_to<0x2::S::Storage<#0, bool>>($t4, $t0) on_abort goto 5 with $t5 3: label L1 4: return () 5: label L2 @@ -137,11 +137,11 @@ public fun S::publish_x_bool<#0>($t0|account: signer, $t1|x: #0, $t2|y: bool) { [variant baseline] public fun S::publish_x_y<#0, #1>($t0|account: signer, $t1|x: #0, $t2|y: #1) { var $t3: u8 - var $t4: S::Storage<#0, #1> + var $t4: 0x2::S::Storage<#0, #1> var $t5: num 0: $t3 := 3 - 1: $t4 := pack S::Storage<#0, #1>($t1, $t2, $t3) - 2: move_to>($t4, $t0) on_abort goto 5 with $t5 + 1: $t4 := pack 0x2::S::Storage<#0, #1>($t1, $t2, $t3) + 2: move_to<0x2::S::Storage<#0, #1>>($t4, $t0) on_abort goto 5 with $t5 3: label L1 4: return () 5: label L2 @@ -152,11 +152,11 @@ public fun S::publish_x_y<#0, #1>($t0|account: signer, $t1|x: #0, $t2|y: #1) { [variant verification] public fun S::publish_x_y<#0, #1>($t0|account: signer, $t1|x: #0, $t2|y: #1) { var $t3: u8 - var $t4: S::Storage<#0, #1> + var $t4: 0x2::S::Storage<#0, #1> var $t5: num 0: $t3 := 3 - 1: $t4 := pack S::Storage<#0, #1>($t1, $t2, $t3) - 2: move_to>($t4, $t0) on_abort goto 5 with $t5 + 1: $t4 := pack 0x2::S::Storage<#0, #1>($t1, $t2, $t3) + 2: move_to<0x2::S::Storage<#0, #1>>($t4, $t0) on_abort goto 5 with $t5 3: label L1 4: return () 5: label L2 @@ -209,7 +209,7 @@ S::publish_u64_bool: [ ] ] } - 2: move_to>($t4, $t0) on_abort goto L2 with $t5 { + 2: move_to<0x2::S::Storage>($t4, $t0) on_abort goto L2 with $t5 { assert @0 = [ <> -> [ <> @@ -256,7 +256,7 @@ S::publish_u64_y: [ ] ] } - 2: move_to>($t4, $t0) on_abort goto L2 with $t5 { + 2: move_to<0x2::S::Storage>($t4, $t0) on_abort goto L2 with $t5 { assert @0 = [ -> [ <> @@ -303,7 +303,7 @@ S::publish_x_bool: [ ] ] } - 2: move_to>($t4, $t0) on_abort goto L2 with $t5 { + 2: move_to<0x2::S::Storage<#0, bool>>($t4, $t0) on_abort goto L2 with $t5 { assert @0 = [ -> [ <> @@ -350,7 +350,7 @@ S::publish_x_y: [ ] ] } - 2: move_to>($t4, $t0) on_abort goto L2 with $t5 { + 2: move_to<0x2::S::Storage<#0, #1>>($t4, $t0) on_abort goto L2 with $t5 { assert @0 = [ -> [ <> diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/uninst_type_param_in_inv.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/uninst_type_param_in_inv.v2_exp index ef36c8e42fd0d..51b2dcd360f8b 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/uninst_type_param_in_inv.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_analysis/uninst_type_param_in_inv.v2_exp @@ -6,33 +6,33 @@ fun Demo::f1($t0|addr: address) { var $t2: bool var $t3: u8 var $t4: address - var $t5: &mut Demo::S1 + var $t5: &mut 0x42::Demo::S1 var $t6: &mut u8 var $t7: address var $t8: bool var $t9: u8 var $t10: address - var $t11: &mut Demo::S1 + var $t11: &mut 0x42::Demo::S1 var $t12: &mut u8 0: $t1 := copy($t0) - 1: $t2 := exists>($t1) + 1: $t2 := exists<0x42::Demo::S1>($t1) 2: if ($t2) goto 3 else goto 10 3: label L1 4: $t3 := 0 5: $t4 := copy($t0) - 6: $t5 := borrow_global>($t4) - 7: $t6 := borrow_field>.v($t5) + 6: $t5 := borrow_global<0x42::Demo::S1>($t4) + 7: $t6 := borrow_field<0x42::Demo::S1>.v($t5) 8: write_ref($t6, $t3) 9: goto 10 10: label L0 11: $t7 := copy($t0) - 12: $t8 := exists>($t7) + 12: $t8 := exists<0x42::Demo::S1>($t7) 13: if ($t8) goto 14 else goto 21 14: label L3 15: $t9 := 0 16: $t10 := move($t0) - 17: $t11 := borrow_global>($t10) - 18: $t12 := borrow_field>.v($t11) + 17: $t11 := borrow_global<0x42::Demo::S1>($t10) + 18: $t12 := borrow_field<0x42::Demo::S1>.v($t11) 19: write_ref($t12, $t9) 20: goto 21 21: label L2 @@ -45,32 +45,32 @@ fun Demo::f1($t0|addr: address) { fun Demo::f1($t0|addr: address) { var $t1: bool var $t2: u8 - var $t3: &mut Demo::S1 + var $t3: &mut 0x42::Demo::S1 var $t4: num var $t5: &mut u8 var $t6: bool var $t7: u8 - var $t8: &mut Demo::S1 + var $t8: &mut 0x42::Demo::S1 var $t9: &mut u8 - 0: $t1 := exists>($t0) + 0: $t1 := exists<0x42::Demo::S1>($t0) 1: if ($t1) goto 2 else goto 9 2: label L1 3: $t2 := 0 - 4: $t3 := borrow_global>($t0) on_abort goto 22 with $t4 - 5: $t5 := borrow_field>.v($t3) + 4: $t3 := borrow_global<0x42::Demo::S1>($t0) on_abort goto 22 with $t4 + 5: $t5 := borrow_field<0x42::Demo::S1>.v($t3) 6: write_ref($t5, $t2) 7: write_back[Reference($t3).v (u8)]($t5) - 8: write_back[Demo::S1@]($t3) + 8: write_back[0x42::Demo::S1@]($t3) 9: label L0 - 10: $t6 := exists>($t0) + 10: $t6 := exists<0x42::Demo::S1>($t0) 11: if ($t6) goto 12 else goto 19 12: label L3 13: $t7 := 0 - 14: $t8 := borrow_global>($t0) on_abort goto 22 with $t4 - 15: $t9 := borrow_field>.v($t8) + 14: $t8 := borrow_global<0x42::Demo::S1>($t0) on_abort goto 22 with $t4 + 15: $t9 := borrow_field<0x42::Demo::S1>.v($t8) 16: write_ref($t9, $t7) 17: write_back[Reference($t8).v (u8)]($t9) - 18: write_back[Demo::S1@]($t8) + 18: write_back[0x42::Demo::S1@]($t8) 19: label L2 20: label L4 21: return () @@ -90,16 +90,16 @@ Demo::f1: [ ] ] } - 0: $t1 := exists>($t0) {} - 8: write_back[Demo::S1@]($t3) { + 0: $t1 := exists<0x42::Demo::S1>($t0) {} + 8: write_back[0x42::Demo::S1@]($t3) { assert @0 = [ <> -> [ ] ] } - 10: $t6 := exists>($t0) {} - 18: write_back[Demo::S1@]($t8) { + 10: $t6 := exists<0x42::Demo::S1>($t0) {} + 18: write_back[0x42::Demo::S1@]($t8) { assert @0 = [ <> -> [ diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/borrow.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/borrow.v2_exp index 1128c066e463a..c387eb5048fcc 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/borrow.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/borrow.v2_exp @@ -2,26 +2,26 @@ [variant baseline] public fun Test::borrow($t0|a: address) { - var $t1|r: &mut Test::R + var $t1|r: &mut 0x42::Test::R var $t2: address - var $t3: &mut Test::R - var $t4: &mut Test::R + var $t3: &mut 0x42::Test::R + var $t4: &mut 0x42::Test::R var $t5: &u64 var $t6: u64 var $t7: u64 var $t8: u64 - var $t9: &mut Test::R + var $t9: &mut 0x42::Test::R var $t10: &mut u64 0: $t2 := move($t0) - 1: $t3 := borrow_global($t2) + 1: $t3 := borrow_global<0x42::Test::R>($t2) 2: $t1 := $t3 3: $t4 := copy($t1) - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::Test::R>.x($t4) 5: $t6 := read_ref($t5) 6: $t7 := 1 7: $t8 := +($t6, $t7) 8: $t9 := move($t1) - 9: $t10 := borrow_field.x($t9) + 9: $t10 := borrow_field<0x42::Test::R>.x($t9) 10: write_ref($t10, $t8) 11: return () } @@ -30,26 +30,26 @@ public fun Test::borrow($t0|a: address) { [variant verification] public fun Test::borrow($t0|a: address) { - var $t1|r: &mut Test::R - var $t2: &mut Test::R + var $t1|r: &mut 0x42::Test::R + var $t2: &mut 0x42::Test::R var $t3: num var $t4: u64 var $t5: u64 var $t6: u64 var $t7: &mut u64 # global invariant at tests/global_invariant_instrumentation/borrow.move:7:9+57 - 0: assume forall a: address: TypeDomain
(): Gt(select Test::R.x(global(a)), 0) - 1: $t2 := borrow_global($t0) on_abort goto 12 with $t3 - 2: $t4 := get_field.x($t2) + 0: assume forall a: address: TypeDomain
(): Gt(select Test::R.x<0x42::Test::R>(global<0x42::Test::R>(a)), 0) + 1: $t2 := borrow_global<0x42::Test::R>($t0) on_abort goto 12 with $t3 + 2: $t4 := get_field<0x42::Test::R>.x($t2) 3: $t5 := 1 4: $t6 := +($t4, $t5) on_abort goto 12 with $t3 - 5: $t7 := borrow_field.x($t2) + 5: $t7 := borrow_field<0x42::Test::R>.x($t2) 6: write_ref($t7, $t6) 7: write_back[Reference($t2).x (u64)]($t7) - 8: write_back[Test::R@]($t2) + 8: write_back[0x42::Test::R@]($t2) # global invariant at tests/global_invariant_instrumentation/borrow.move:7:9+57 # VC: global memory invariant does not hold at tests/global_invariant_instrumentation/borrow.move:7:9+57 - 9: assert forall a: address: TypeDomain
(): Gt(select Test::R.x(global(a)), 0) + 9: assert forall a: address: TypeDomain
(): Gt(select Test::R.x<0x42::Test::R>(global<0x42::Test::R>(a)), 0) 10: label L1 11: return () 12: label L2 diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/move.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/move.v2_exp index 47e7f43c70a29..b2b8db8a0f545 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/move.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/move.v2_exp @@ -4,21 +4,21 @@ public fun Test::publish($t0|s: &signer) { var $t1: &signer var $t2: u64 - var $t3: Test::R + var $t3: 0x42::Test::R 0: $t1 := move($t0) 1: $t2 := 1 - 2: $t3 := pack Test::R($t2) - 3: move_to($t3, $t1) + 2: $t3 := pack 0x42::Test::R($t2) + 3: move_to<0x42::Test::R>($t3, $t1) 4: return () } [variant baseline] -public fun Test::remove($t0|a: address): Test::R { +public fun Test::remove($t0|a: address): 0x42::Test::R { var $t1: address - var $t2: Test::R + var $t2: 0x42::Test::R 0: $t1 := move($t0) - 1: $t2 := move_from($t1) + 1: $t2 := move_from<0x42::Test::R>($t1) 2: return $t2 } @@ -27,16 +27,16 @@ public fun Test::remove($t0|a: address): Test::R { [variant verification] public fun Test::publish($t0|s: signer) { var $t1: u64 - var $t2: Test::R + var $t2: 0x42::Test::R var $t3: num # global invariant at tests/global_invariant_instrumentation/move.move:7:9+57 - 0: assume forall a: address: TypeDomain
(): Gt(select Test::R.x(global(a)), 0) + 0: assume forall a: address: TypeDomain
(): Gt(select Test::R.x<0x42::Test::R>(global<0x42::Test::R>(a)), 0) 1: $t1 := 1 - 2: $t2 := pack Test::R($t1) - 3: move_to($t2, $t0) on_abort goto 7 with $t3 + 2: $t2 := pack 0x42::Test::R($t1) + 3: move_to<0x42::Test::R>($t2, $t0) on_abort goto 7 with $t3 # global invariant at tests/global_invariant_instrumentation/move.move:7:9+57 # VC: global memory invariant does not hold at tests/global_invariant_instrumentation/move.move:7:9+57 - 4: assert forall a: address: TypeDomain
(): Gt(select Test::R.x(global(a)), 0) + 4: assert forall a: address: TypeDomain
(): Gt(select Test::R.x<0x42::Test::R>(global<0x42::Test::R>(a)), 0) 5: label L1 6: return () 7: label L2 @@ -45,15 +45,15 @@ public fun Test::publish($t0|s: signer) { [variant verification] -public fun Test::remove($t0|a: address): Test::R { - var $t1: Test::R +public fun Test::remove($t0|a: address): 0x42::Test::R { + var $t1: 0x42::Test::R var $t2: num # global invariant at tests/global_invariant_instrumentation/move.move:7:9+57 - 0: assume forall a: address: TypeDomain
(): Gt(select Test::R.x(global(a)), 0) - 1: $t1 := move_from($t0) on_abort goto 5 with $t2 + 0: assume forall a: address: TypeDomain
(): Gt(select Test::R.x<0x42::Test::R>(global<0x42::Test::R>(a)), 0) + 1: $t1 := move_from<0x42::Test::R>($t0) on_abort goto 5 with $t2 # global invariant at tests/global_invariant_instrumentation/move.move:7:9+57 # VC: global memory invariant does not hold at tests/global_invariant_instrumentation/move.move:7:9+57 - 2: assert forall a: address: TypeDomain
(): Gt(select Test::R.x(global(a)), 0) + 2: assert forall a: address: TypeDomain
(): Gt(select Test::R.x<0x42::Test::R>(global<0x42::Test::R>(a)), 0) 3: label L1 4: return $t1 5: label L2 diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/update.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/update.v2_exp index be2dd70798ead..6ffdeb4152723 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/update.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/global_invariant_instrumentation/update.v2_exp @@ -2,26 +2,26 @@ [variant baseline] public fun Test::incr($t0|a: address) { - var $t1|r: &mut Test::R + var $t1|r: &mut 0x42::Test::R var $t2: address - var $t3: &mut Test::R - var $t4: &mut Test::R + var $t3: &mut 0x42::Test::R + var $t4: &mut 0x42::Test::R var $t5: &u64 var $t6: u64 var $t7: u64 var $t8: u64 - var $t9: &mut Test::R + var $t9: &mut 0x42::Test::R var $t10: &mut u64 0: $t2 := move($t0) - 1: $t3 := borrow_global($t2) + 1: $t3 := borrow_global<0x42::Test::R>($t2) 2: $t1 := $t3 3: $t4 := copy($t1) - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::Test::R>.x($t4) 5: $t6 := read_ref($t5) 6: $t7 := 1 7: $t8 := +($t6, $t7) 8: $t9 := move($t1) - 9: $t10 := borrow_field.x($t9) + 9: $t10 := borrow_field<0x42::Test::R>.x($t9) 10: write_ref($t10, $t8) 11: return () } @@ -30,26 +30,26 @@ public fun Test::incr($t0|a: address) { [variant verification] public fun Test::incr($t0|a: address) { - var $t1|r: &mut Test::R - var $t2: &mut Test::R + var $t1|r: &mut 0x42::Test::R + var $t2: &mut 0x42::Test::R var $t3: num var $t4: u64 var $t5: u64 var $t6: u64 var $t7: &mut u64 - 0: $t2 := borrow_global($t0) on_abort goto 12 with $t3 - 1: $t4 := get_field.x($t2) + 0: $t2 := borrow_global<0x42::Test::R>($t0) on_abort goto 12 with $t3 + 1: $t4 := get_field<0x42::Test::R>.x($t2) 2: $t5 := 1 3: $t6 := +($t4, $t5) on_abort goto 12 with $t3 - 4: $t7 := borrow_field.x($t2) + 4: $t7 := borrow_field<0x42::Test::R>.x($t2) 5: write_ref($t7, $t6) 6: write_back[Reference($t2).x (u64)]($t7) # state save for global update invariants 7: @1 := save_mem(Test::R) - 8: write_back[Test::R@]($t2) + 8: write_back[0x42::Test::R@]($t2) # global invariant at tests/global_invariant_instrumentation/update.move:7:9+82 # VC: global memory invariant does not hold at tests/global_invariant_instrumentation/update.move:7:9+82 - 9: assert forall a: address: TypeDomain
(): Lt(select Test::R.x(global[@1](a)), select Test::R.x(global(a))) + 9: assert forall a: address: TypeDomain
(): Lt(select Test::R.x<0x42::Test::R>(global[@1]<0x42::Test::R>(a)), select Test::R.x<0x42::Test::R>(global<0x42::Test::R>(a))) 10: label L1 11: return () 12: label L2 diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/memory_instr/basic_test.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/memory_instr/basic_test.v2_exp index 0ad8278a86014..9e079b1d84995 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/memory_instr/basic_test.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/memory_instr/basic_test.v2_exp @@ -1,21 +1,21 @@ ============ initial translation from Move ================ [variant baseline] -fun TestPackref::test1(): TestPackref::R { - var $t0|r: TestPackref::R +fun TestPackref::test1(): 0x42::TestPackref::R { + var $t0|r: 0x42::TestPackref::R var $t1|x_ref: &mut u64 var $t2: u64 - var $t3: TestPackref::R - var $t4: &mut TestPackref::R + var $t3: 0x42::TestPackref::R + var $t4: &mut 0x42::TestPackref::R var $t5: &mut u64 var $t6: u64 var $t7: &mut u64 - var $t8: TestPackref::R + var $t8: 0x42::TestPackref::R 0: $t2 := 3 - 1: $t3 := pack TestPackref::R($t2) + 1: $t3 := pack 0x42::TestPackref::R($t2) 2: $t0 := $t3 3: $t4 := borrow_local($t0) - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::TestPackref::R>.x($t4) 5: $t1 := $t5 6: $t6 := 0 7: $t7 := move($t1) @@ -37,12 +37,12 @@ fun TestPackref::test2($t0|x_ref: &mut u64, $t1|v: u64) { [variant baseline] -public fun TestPackref::test3($t0|r_ref: &mut TestPackref::R, $t1|v: u64) { - var $t2: &mut TestPackref::R +public fun TestPackref::test3($t0|r_ref: &mut 0x42::TestPackref::R, $t1|v: u64) { + var $t2: &mut 0x42::TestPackref::R var $t3: &mut u64 var $t4: u64 0: $t2 := move($t0) - 1: $t3 := borrow_field.x($t2) + 1: $t3 := borrow_field<0x42::TestPackref::R>.x($t2) 2: $t4 := move($t1) 3: TestPackref::test2($t3, $t4) 4: return () @@ -50,15 +50,15 @@ public fun TestPackref::test3($t0|r_ref: &mut TestPackref::R, $t1|v: u64) { [variant baseline] -fun TestPackref::test4(): TestPackref::R { - var $t0|r: TestPackref::R +fun TestPackref::test4(): 0x42::TestPackref::R { + var $t0|r: 0x42::TestPackref::R var $t1: u64 - var $t2: TestPackref::R - var $t3: &mut TestPackref::R + var $t2: 0x42::TestPackref::R + var $t3: &mut 0x42::TestPackref::R var $t4: u64 - var $t5: TestPackref::R + var $t5: 0x42::TestPackref::R 0: $t1 := 3 - 1: $t2 := pack TestPackref::R($t1) + 1: $t2 := pack 0x42::TestPackref::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := 0 @@ -69,26 +69,26 @@ fun TestPackref::test4(): TestPackref::R { [variant baseline] -public fun TestPackref::test5($t0|r_ref: &mut TestPackref::R): &mut u64 { - var $t1: &mut TestPackref::R +public fun TestPackref::test5($t0|r_ref: &mut 0x42::TestPackref::R): &mut u64 { + var $t1: &mut 0x42::TestPackref::R var $t2: &mut u64 0: $t1 := move($t0) - 1: $t2 := borrow_field.x($t1) + 1: $t2 := borrow_field<0x42::TestPackref::R>.x($t1) 2: return $t2 } [variant baseline] -fun TestPackref::test6(): TestPackref::R { - var $t0|r: TestPackref::R +fun TestPackref::test6(): 0x42::TestPackref::R { + var $t0|r: 0x42::TestPackref::R var $t1: u64 - var $t2: TestPackref::R - var $t3: &mut TestPackref::R + var $t2: 0x42::TestPackref::R + var $t3: &mut 0x42::TestPackref::R var $t4: &mut u64 var $t5: u64 - var $t6: TestPackref::R + var $t6: 0x42::TestPackref::R 0: $t1 := 3 - 1: $t2 := pack TestPackref::R($t1) + 1: $t2 := pack 0x42::TestPackref::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := TestPackref::test5($t3) @@ -101,24 +101,24 @@ fun TestPackref::test6(): TestPackref::R { [variant baseline] fun TestPackref::test7($t0|b: bool) { - var $t1|r1: TestPackref::R - var $t2|r2: TestPackref::R - var $t3|r_ref: &mut TestPackref::R + var $t1|r1: 0x42::TestPackref::R + var $t2|r2: 0x42::TestPackref::R + var $t3|r_ref: &mut 0x42::TestPackref::R var $t4: u64 - var $t5: TestPackref::R + var $t5: 0x42::TestPackref::R var $t6: u64 - var $t7: TestPackref::R - var $t8: &mut TestPackref::R + var $t7: 0x42::TestPackref::R + var $t8: &mut 0x42::TestPackref::R var $t9: bool - var $t10: &mut TestPackref::R - var $t11: &mut TestPackref::R - var $t12: &mut TestPackref::R + var $t10: &mut 0x42::TestPackref::R + var $t11: &mut 0x42::TestPackref::R + var $t12: &mut 0x42::TestPackref::R var $t13: u64 0: $t4 := 3 - 1: $t5 := pack TestPackref::R($t4) + 1: $t5 := pack 0x42::TestPackref::R($t4) 2: $t1 := $t5 3: $t6 := 4 - 4: $t7 := pack TestPackref::R($t6) + 4: $t7 := pack 0x42::TestPackref::R($t6) 5: $t2 := $t7 6: $t8 := borrow_local($t1) 7: $t3 := $t8 @@ -139,41 +139,41 @@ fun TestPackref::test7($t0|b: bool) { [variant baseline] -fun TestPackref::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestPackref::R) { - var $t3|r1: TestPackref::R - var $t4|r2: TestPackref::R - var $t5|t_ref: &mut TestPackref::R +fun TestPackref::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut 0x42::TestPackref::R) { + var $t3|r1: 0x42::TestPackref::R + var $t4|r2: 0x42::TestPackref::R + var $t5|t_ref: &mut 0x42::TestPackref::R var $t6: u64 - var $t7: TestPackref::R + var $t7: 0x42::TestPackref::R var $t8: u64 - var $t9: TestPackref::R - var $t10: &mut TestPackref::R + var $t9: 0x42::TestPackref::R + var $t10: &mut 0x42::TestPackref::R var $t11: u64 var $t12: u64 var $t13: bool - var $t14: &mut TestPackref::R + var $t14: &mut 0x42::TestPackref::R var $t15: u64 var $t16: u64 var $t17: u64 var $t18: u64 var $t19: bool - var $t20: &mut TestPackref::R - var $t21: &mut TestPackref::R + var $t20: &mut 0x42::TestPackref::R + var $t21: &mut 0x42::TestPackref::R var $t22: u64 var $t23: u64 var $t24: u64 var $t25: bool - var $t26: &mut TestPackref::R - var $t27: &mut TestPackref::R + var $t26: &mut 0x42::TestPackref::R + var $t27: &mut 0x42::TestPackref::R var $t28: u64 - var $t29: &mut TestPackref::R - var $t30: &mut TestPackref::R + var $t29: &mut 0x42::TestPackref::R + var $t30: &mut 0x42::TestPackref::R var $t31: u64 0: $t6 := 3 - 1: $t7 := pack TestPackref::R($t6) + 1: $t7 := pack 0x42::TestPackref::R($t6) 2: $t3 := $t7 3: $t8 := 4 - 4: $t9 := pack TestPackref::R($t8) + 4: $t9 := pack 0x42::TestPackref::R($t8) 5: $t4 := $t9 6: $t10 := borrow_local($t4) 7: $t5 := $t10 @@ -232,18 +232,18 @@ fun TestPackref::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestPackref::R) ============ after pipeline `memory_instr` ================ [variant baseline] -fun TestPackref::test1(): TestPackref::R { - var $t0|r: TestPackref::R +fun TestPackref::test1(): 0x42::TestPackref::R { + var $t0|r: 0x42::TestPackref::R var $t1|x_ref: &mut u64 [unused] var $t2: u64 - var $t3: &mut TestPackref::R + var $t3: &mut 0x42::TestPackref::R var $t4: &mut u64 var $t5: u64 - var $t6: TestPackref::R + var $t6: 0x42::TestPackref::R 0: $t2 := 3 - 1: $t0 := pack TestPackref::R($t2) + 1: $t0 := pack 0x42::TestPackref::R($t2) 2: $t3 := borrow_local($t0) - 3: $t4 := borrow_field.x($t3) + 3: $t4 := borrow_field<0x42::TestPackref::R>.x($t3) 4: $t5 := 0 5: write_ref($t4, $t5) 6: write_back[Reference($t3).x (u64)]($t4) @@ -263,9 +263,9 @@ fun TestPackref::test2($t0|x_ref: &mut u64, $t1|v: u64) { [variant baseline] -public fun TestPackref::test3($t0|r_ref: &mut TestPackref::R, $t1|v: u64) { +public fun TestPackref::test3($t0|r_ref: &mut 0x42::TestPackref::R, $t1|v: u64) { var $t2: &mut u64 - 0: $t2 := borrow_field.x($t0) + 0: $t2 := borrow_field<0x42::TestPackref::R>.x($t0) 1: TestPackref::test2($t2, $t1) 2: write_back[Reference($t0).x (u64)]($t2) 3: trace_local[r_ref]($t0) @@ -275,14 +275,14 @@ public fun TestPackref::test3($t0|r_ref: &mut TestPackref::R, $t1|v: u64) { [variant baseline] -fun TestPackref::test4(): TestPackref::R { - var $t0|r: TestPackref::R +fun TestPackref::test4(): 0x42::TestPackref::R { + var $t0|r: 0x42::TestPackref::R var $t1: u64 - var $t2: &mut TestPackref::R + var $t2: &mut 0x42::TestPackref::R var $t3: u64 - var $t4: TestPackref::R + var $t4: 0x42::TestPackref::R 0: $t1 := 3 - 1: $t0 := pack TestPackref::R($t1) + 1: $t0 := pack 0x42::TestPackref::R($t1) 2: $t2 := borrow_local($t0) 3: $t3 := 0 4: TestPackref::test3($t2, $t3) @@ -294,9 +294,9 @@ fun TestPackref::test4(): TestPackref::R { [variant baseline] -public fun TestPackref::test5($t0|r_ref: &mut TestPackref::R): &mut u64 { +public fun TestPackref::test5($t0|r_ref: &mut 0x42::TestPackref::R): &mut u64 { var $t1: &mut u64 - 0: $t1 := borrow_field.x($t0) + 0: $t1 := borrow_field<0x42::TestPackref::R>.x($t0) 1: trace_local[r_ref]($t0) 2: write_back[Reference($t0).x (u64)]($t1) 3: trace_local[r_ref]($t0) @@ -305,15 +305,15 @@ public fun TestPackref::test5($t0|r_ref: &mut TestPackref::R): &mut u64 { [variant baseline] -fun TestPackref::test6(): TestPackref::R { - var $t0|r: TestPackref::R +fun TestPackref::test6(): 0x42::TestPackref::R { + var $t0|r: 0x42::TestPackref::R var $t1: u64 - var $t2: &mut TestPackref::R + var $t2: &mut 0x42::TestPackref::R var $t3: &mut u64 var $t4: u64 - var $t5: TestPackref::R + var $t5: 0x42::TestPackref::R 0: $t1 := 3 - 1: $t0 := pack TestPackref::R($t1) + 1: $t0 := pack 0x42::TestPackref::R($t1) 2: $t2 := borrow_local($t0) 3: $t3 := TestPackref::test5($t2) 4: $t4 := 0 @@ -328,20 +328,20 @@ fun TestPackref::test6(): TestPackref::R { [variant baseline] fun TestPackref::test7($t0|b: bool) { - var $t1|r1: TestPackref::R - var $t2|r2: TestPackref::R - var $t3|r_ref: &mut TestPackref::R + var $t1|r1: 0x42::TestPackref::R + var $t2|r2: 0x42::TestPackref::R + var $t3|r_ref: &mut 0x42::TestPackref::R var $t4: u64 var $t5: u64 - var $t6: &mut TestPackref::R - var $t7: &mut TestPackref::R + var $t6: &mut 0x42::TestPackref::R + var $t7: &mut 0x42::TestPackref::R var $t8: u64 var $t9: bool var $t10: bool 0: $t4 := 3 - 1: $t1 := pack TestPackref::R($t4) + 1: $t1 := pack 0x42::TestPackref::R($t4) 2: $t5 := 4 - 3: $t2 := pack TestPackref::R($t5) + 3: $t2 := pack 0x42::TestPackref::R($t5) 4: $t6 := borrow_local($t1) 5: $t3 := $t6 6: if ($t0) goto 31 else goto 35 @@ -380,21 +380,21 @@ fun TestPackref::test7($t0|b: bool) { [variant baseline] -fun TestPackref::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestPackref::R) { - var $t3|r1: TestPackref::R - var $t4|r2: TestPackref::R - var $t5|t_ref: &mut TestPackref::R +fun TestPackref::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut 0x42::TestPackref::R) { + var $t3|r1: 0x42::TestPackref::R + var $t4|r2: 0x42::TestPackref::R + var $t5|t_ref: &mut 0x42::TestPackref::R var $t6: u64 var $t7: u64 - var $t8: &mut TestPackref::R + var $t8: &mut 0x42::TestPackref::R var $t9: u64 var $t10: bool var $t11: u64 var $t12: u64 var $t13: u64 var $t14: bool - var $t15: &mut TestPackref::R - var $t16: &mut TestPackref::R + var $t15: &mut 0x42::TestPackref::R + var $t16: &mut 0x42::TestPackref::R var $t17: u64 var $t18: u64 var $t19: u64 @@ -408,9 +408,9 @@ fun TestPackref::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestPackref::R) var $t27: bool var $t28: bool 0: $t6 := 3 - 1: $t3 := pack TestPackref::R($t6) + 1: $t3 := pack 0x42::TestPackref::R($t6) 2: $t7 := 4 - 3: $t4 := pack TestPackref::R($t7) + 3: $t4 := pack 0x42::TestPackref::R($t7) 4: $t8 := borrow_local($t4) 5: $t5 := $t8 6: label L6 diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/memory_instr/mut_ref.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/memory_instr/mut_ref.v2_exp index 89d52775106cb..1381a02e33a5f 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/memory_instr/mut_ref.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/memory_instr/mut_ref.v2_exp @@ -1,231 +1,231 @@ ============ initial translation from Move ================ [variant baseline] -public fun TestMutRefs::data_invariant($t0|_x: &mut TestMutRefs::T) { +public fun TestMutRefs::data_invariant($t0|_x: &mut 0x1::TestMutRefs::T) { 0: return () } [variant baseline] -public fun TestMutRefs::decrement_invalid($t0|x: &mut TestMutRefs::T) { - var $t1|r: &mut TestMutRefs::TSum - var $t2: &mut TestMutRefs::T +public fun TestMutRefs::decrement_invalid($t0|x: &mut 0x1::TestMutRefs::T) { + var $t1|r: &mut 0x1::TestMutRefs::TSum + var $t2: &mut 0x1::TestMutRefs::T var $t3: &u64 var $t4: u64 var $t5: u64 var $t6: u64 - var $t7: &mut TestMutRefs::T + var $t7: &mut 0x1::TestMutRefs::T var $t8: &mut u64 var $t9: address - var $t10: &mut TestMutRefs::TSum - var $t11: &mut TestMutRefs::TSum + var $t10: &mut 0x1::TestMutRefs::TSum + var $t11: &mut 0x1::TestMutRefs::TSum var $t12: &u64 var $t13: u64 var $t14: u64 var $t15: u64 - var $t16: &mut TestMutRefs::TSum + var $t16: &mut 0x1::TestMutRefs::TSum var $t17: &mut u64 0: $t2 := copy($t0) - 1: $t3 := borrow_field.value($t2) + 1: $t3 := borrow_field<0x1::TestMutRefs::T>.value($t2) 2: $t4 := read_ref($t3) 3: $t5 := 1 4: $t6 := -($t4, $t5) 5: $t7 := move($t0) - 6: $t8 := borrow_field.value($t7) + 6: $t8 := borrow_field<0x1::TestMutRefs::T>.value($t7) 7: write_ref($t8, $t6) 8: $t9 := 0x0 - 9: $t10 := borrow_global($t9) + 9: $t10 := borrow_global<0x1::TestMutRefs::TSum>($t9) 10: $t1 := $t10 11: $t11 := copy($t1) - 12: $t12 := borrow_field.sum($t11) + 12: $t12 := borrow_field<0x1::TestMutRefs::TSum>.sum($t11) 13: $t13 := read_ref($t12) 14: $t14 := 1 15: $t15 := -($t13, $t14) 16: $t16 := move($t1) - 17: $t17 := borrow_field.sum($t16) + 17: $t17 := borrow_field<0x1::TestMutRefs::TSum>.sum($t16) 18: write_ref($t17, $t15) 19: return () } [variant baseline] -public fun TestMutRefs::delete($t0|x: TestMutRefs::T) { - var $t1|r: &mut TestMutRefs::TSum +public fun TestMutRefs::delete($t0|x: 0x1::TestMutRefs::T) { + var $t1|r: &mut 0x1::TestMutRefs::TSum var $t2|v: u64 var $t3: address - var $t4: &mut TestMutRefs::TSum - var $t5: TestMutRefs::T + var $t4: &mut 0x1::TestMutRefs::TSum + var $t5: 0x1::TestMutRefs::T var $t6: u64 - var $t7: &mut TestMutRefs::TSum + var $t7: &mut 0x1::TestMutRefs::TSum var $t8: &u64 var $t9: u64 var $t10: u64 var $t11: u64 - var $t12: &mut TestMutRefs::TSum + var $t12: &mut 0x1::TestMutRefs::TSum var $t13: &mut u64 0: $t3 := 0x0 - 1: $t4 := borrow_global($t3) + 1: $t4 := borrow_global<0x1::TestMutRefs::TSum>($t3) 2: $t1 := $t4 3: $t5 := move($t0) - 4: $t6 := unpack TestMutRefs::T($t5) + 4: $t6 := unpack 0x1::TestMutRefs::T($t5) 5: $t2 := $t6 6: $t7 := copy($t1) - 7: $t8 := borrow_field.sum($t7) + 7: $t8 := borrow_field<0x1::TestMutRefs::TSum>.sum($t7) 8: $t9 := read_ref($t8) 9: $t10 := move($t2) 10: $t11 := -($t9, $t10) 11: $t12 := move($t1) - 12: $t13 := borrow_field.sum($t12) + 12: $t13 := borrow_field<0x1::TestMutRefs::TSum>.sum($t12) 13: write_ref($t13, $t11) 14: return () } [variant baseline] -public fun TestMutRefs::increment($t0|x: &mut TestMutRefs::T) { - var $t1|r: &mut TestMutRefs::TSum - var $t2: &mut TestMutRefs::T +public fun TestMutRefs::increment($t0|x: &mut 0x1::TestMutRefs::T) { + var $t1|r: &mut 0x1::TestMutRefs::TSum + var $t2: &mut 0x1::TestMutRefs::T var $t3: &u64 var $t4: u64 var $t5: u64 var $t6: u64 - var $t7: &mut TestMutRefs::T + var $t7: &mut 0x1::TestMutRefs::T var $t8: &mut u64 var $t9: address - var $t10: &mut TestMutRefs::TSum - var $t11: &mut TestMutRefs::TSum + var $t10: &mut 0x1::TestMutRefs::TSum + var $t11: &mut 0x1::TestMutRefs::TSum var $t12: &u64 var $t13: u64 var $t14: u64 var $t15: u64 - var $t16: &mut TestMutRefs::TSum + var $t16: &mut 0x1::TestMutRefs::TSum var $t17: &mut u64 0: $t2 := copy($t0) - 1: $t3 := borrow_field.value($t2) + 1: $t3 := borrow_field<0x1::TestMutRefs::T>.value($t2) 2: $t4 := read_ref($t3) 3: $t5 := 1 4: $t6 := +($t4, $t5) 5: $t7 := move($t0) - 6: $t8 := borrow_field.value($t7) + 6: $t8 := borrow_field<0x1::TestMutRefs::T>.value($t7) 7: write_ref($t8, $t6) 8: $t9 := 0x0 - 9: $t10 := borrow_global($t9) + 9: $t10 := borrow_global<0x1::TestMutRefs::TSum>($t9) 10: $t1 := $t10 11: $t11 := copy($t1) - 12: $t12 := borrow_field.sum($t11) + 12: $t12 := borrow_field<0x1::TestMutRefs::TSum>.sum($t11) 13: $t13 := read_ref($t12) 14: $t14 := 1 15: $t15 := +($t13, $t14) 16: $t16 := move($t1) - 17: $t17 := borrow_field.sum($t16) + 17: $t17 := borrow_field<0x1::TestMutRefs::TSum>.sum($t16) 18: write_ref($t17, $t15) 19: return () } [variant baseline] -public fun TestMutRefs::increment_invalid($t0|x: &mut TestMutRefs::T) { - var $t1: &mut TestMutRefs::T +public fun TestMutRefs::increment_invalid($t0|x: &mut 0x1::TestMutRefs::T) { + var $t1: &mut 0x1::TestMutRefs::T var $t2: &u64 var $t3: u64 var $t4: u64 var $t5: u64 - var $t6: &mut TestMutRefs::T + var $t6: &mut 0x1::TestMutRefs::T var $t7: &mut u64 0: $t1 := copy($t0) - 1: $t2 := borrow_field.value($t1) + 1: $t2 := borrow_field<0x1::TestMutRefs::T>.value($t1) 2: $t3 := read_ref($t2) 3: $t4 := 1 4: $t5 := +($t3, $t4) 5: $t6 := move($t0) - 6: $t7 := borrow_field.value($t6) + 6: $t7 := borrow_field<0x1::TestMutRefs::T>.value($t6) 7: write_ref($t7, $t5) 8: return () } [variant baseline] -public fun TestMutRefs::new($t0|x: u64): TestMutRefs::T { - var $t1|r: &mut TestMutRefs::TSum +public fun TestMutRefs::new($t0|x: u64): 0x1::TestMutRefs::T { + var $t1|r: &mut 0x1::TestMutRefs::TSum var $t2: address - var $t3: &mut TestMutRefs::TSum - var $t4: &mut TestMutRefs::TSum + var $t3: &mut 0x1::TestMutRefs::TSum + var $t4: &mut 0x1::TestMutRefs::TSum var $t5: &u64 var $t6: u64 var $t7: u64 var $t8: u64 - var $t9: &mut TestMutRefs::TSum + var $t9: &mut 0x1::TestMutRefs::TSum var $t10: &mut u64 var $t11: u64 - var $t12: TestMutRefs::T + var $t12: 0x1::TestMutRefs::T 0: $t2 := 0x0 - 1: $t3 := borrow_global($t2) + 1: $t3 := borrow_global<0x1::TestMutRefs::TSum>($t2) 2: $t1 := $t3 3: $t4 := copy($t1) - 4: $t5 := borrow_field.sum($t4) + 4: $t5 := borrow_field<0x1::TestMutRefs::TSum>.sum($t4) 5: $t6 := read_ref($t5) 6: $t7 := copy($t0) 7: $t8 := +($t6, $t7) 8: $t9 := move($t1) - 9: $t10 := borrow_field.sum($t9) + 9: $t10 := borrow_field<0x1::TestMutRefs::TSum>.sum($t9) 10: write_ref($t10, $t8) 11: $t11 := move($t0) - 12: $t12 := pack TestMutRefs::T($t11) + 12: $t12 := pack 0x1::TestMutRefs::T($t11) 13: return $t12 } [variant baseline] -fun TestMutRefs::private_data_invariant_invalid($t0|_x: &mut TestMutRefs::T) { +fun TestMutRefs::private_data_invariant_invalid($t0|_x: &mut 0x1::TestMutRefs::T) { 0: return () } [variant baseline] -fun TestMutRefs::private_decrement($t0|x: &mut TestMutRefs::T) { - var $t1|r: &mut TestMutRefs::TSum - var $t2: &mut TestMutRefs::T +fun TestMutRefs::private_decrement($t0|x: &mut 0x1::TestMutRefs::T) { + var $t1|r: &mut 0x1::TestMutRefs::TSum + var $t2: &mut 0x1::TestMutRefs::T var $t3: &u64 var $t4: u64 var $t5: u64 var $t6: u64 - var $t7: &mut TestMutRefs::T + var $t7: &mut 0x1::TestMutRefs::T var $t8: &mut u64 var $t9: address - var $t10: &mut TestMutRefs::TSum - var $t11: &mut TestMutRefs::TSum + var $t10: &mut 0x1::TestMutRefs::TSum + var $t11: &mut 0x1::TestMutRefs::TSum var $t12: &u64 var $t13: u64 var $t14: u64 var $t15: u64 - var $t16: &mut TestMutRefs::TSum + var $t16: &mut 0x1::TestMutRefs::TSum var $t17: &mut u64 0: $t2 := copy($t0) - 1: $t3 := borrow_field.value($t2) + 1: $t3 := borrow_field<0x1::TestMutRefs::T>.value($t2) 2: $t4 := read_ref($t3) 3: $t5 := 1 4: $t6 := -($t4, $t5) 5: $t7 := move($t0) - 6: $t8 := borrow_field.value($t7) + 6: $t8 := borrow_field<0x1::TestMutRefs::T>.value($t7) 7: write_ref($t8, $t6) 8: $t9 := 0x0 - 9: $t10 := borrow_global($t9) + 9: $t10 := borrow_global<0x1::TestMutRefs::TSum>($t9) 10: $t1 := $t10 11: $t11 := copy($t1) - 12: $t12 := borrow_field.sum($t11) + 12: $t12 := borrow_field<0x1::TestMutRefs::TSum>.sum($t11) 13: $t13 := read_ref($t12) 14: $t14 := 1 15: $t15 := -($t13, $t14) 16: $t16 := move($t1) - 17: $t17 := borrow_field.sum($t16) + 17: $t17 := borrow_field<0x1::TestMutRefs::TSum>.sum($t16) 18: write_ref($t17, $t15) 19: return () } [variant baseline] -fun TestMutRefs::private_to_public_caller($t0|r: &mut TestMutRefs::T) { - var $t1: &mut TestMutRefs::T +fun TestMutRefs::private_to_public_caller($t0|r: &mut 0x1::TestMutRefs::T) { + var $t1: &mut 0x1::TestMutRefs::T 0: $t1 := move($t0) 1: TestMutRefs::increment($t1) 2: return () @@ -234,13 +234,13 @@ fun TestMutRefs::private_to_public_caller($t0|r: &mut TestMutRefs::T) { [variant baseline] fun TestMutRefs::private_to_public_caller_invalid_data_invariant() { - var $t0|r: &mut TestMutRefs::T - var $t1|x: TestMutRefs::T + var $t0|r: &mut 0x1::TestMutRefs::T + var $t1|x: 0x1::TestMutRefs::T var $t2: u64 - var $t3: TestMutRefs::T - var $t4: &mut TestMutRefs::T - var $t5: &mut TestMutRefs::T - var $t6: &mut TestMutRefs::T + var $t3: 0x1::TestMutRefs::T + var $t4: &mut 0x1::TestMutRefs::T + var $t5: &mut 0x1::TestMutRefs::T + var $t6: &mut 0x1::TestMutRefs::T 0: $t2 := 1 1: $t3 := TestMutRefs::new($t2) 2: $t1 := $t3 @@ -256,11 +256,11 @@ fun TestMutRefs::private_to_public_caller_invalid_data_invariant() { [variant baseline] public fun TestMutRefsUser::valid() { - var $t0|x: TestMutRefs::T + var $t0|x: 0x1::TestMutRefs::T var $t1: u64 - var $t2: TestMutRefs::T - var $t3: &mut TestMutRefs::T - var $t4: TestMutRefs::T + var $t2: 0x1::TestMutRefs::T + var $t3: &mut 0x1::TestMutRefs::T + var $t4: 0x1::TestMutRefs::T 0: $t1 := 4 1: $t2 := TestMutRefs::new($t1) 2: $t0 := $t2 @@ -274,113 +274,113 @@ public fun TestMutRefsUser::valid() { ============ after pipeline `memory_instr` ================ [variant baseline] -public fun TestMutRefs::data_invariant($t0|_x: &mut TestMutRefs::T) { +public fun TestMutRefs::data_invariant($t0|_x: &mut 0x1::TestMutRefs::T) { 0: trace_local[_x]($t0) 1: return () } [variant baseline] -public fun TestMutRefs::decrement_invalid($t0|x: &mut TestMutRefs::T) { - var $t1|r: &mut TestMutRefs::TSum [unused] +public fun TestMutRefs::decrement_invalid($t0|x: &mut 0x1::TestMutRefs::T) { + var $t1|r: &mut 0x1::TestMutRefs::TSum [unused] var $t2: u64 var $t3: u64 var $t4: u64 var $t5: &mut u64 var $t6: address - var $t7: &mut TestMutRefs::TSum + var $t7: &mut 0x1::TestMutRefs::TSum var $t8: u64 var $t9: u64 var $t10: u64 var $t11: &mut u64 - 0: $t2 := get_field.value($t0) + 0: $t2 := get_field<0x1::TestMutRefs::T>.value($t0) 1: $t3 := 1 2: $t4 := -($t2, $t3) - 3: $t5 := borrow_field.value($t0) + 3: $t5 := borrow_field<0x1::TestMutRefs::T>.value($t0) 4: write_ref($t5, $t4) 5: write_back[Reference($t0).value (u64)]($t5) 6: trace_local[x]($t0) 7: $t6 := 0x0 - 8: $t7 := borrow_global($t6) - 9: $t8 := get_field.sum($t7) + 8: $t7 := borrow_global<0x1::TestMutRefs::TSum>($t6) + 9: $t8 := get_field<0x1::TestMutRefs::TSum>.sum($t7) 10: $t9 := 1 11: $t10 := -($t8, $t9) - 12: $t11 := borrow_field.sum($t7) + 12: $t11 := borrow_field<0x1::TestMutRefs::TSum>.sum($t7) 13: write_ref($t11, $t10) 14: write_back[Reference($t7).sum (u64)]($t11) - 15: write_back[TestMutRefs::TSum@]($t7) + 15: write_back[0x1::TestMutRefs::TSum@]($t7) 16: trace_local[x]($t0) 17: return () } [variant baseline] -public fun TestMutRefs::delete($t0|x: TestMutRefs::T) { - var $t1|r: &mut TestMutRefs::TSum [unused] +public fun TestMutRefs::delete($t0|x: 0x1::TestMutRefs::T) { + var $t1|r: &mut 0x1::TestMutRefs::TSum [unused] var $t2|v: u64 [unused] var $t3: address - var $t4: &mut TestMutRefs::TSum + var $t4: &mut 0x1::TestMutRefs::TSum var $t5: u64 var $t6: u64 var $t7: u64 var $t8: &mut u64 0: $t3 := 0x0 - 1: $t4 := borrow_global($t3) - 2: $t5 := unpack TestMutRefs::T($t0) - 3: $t6 := get_field.sum($t4) + 1: $t4 := borrow_global<0x1::TestMutRefs::TSum>($t3) + 2: $t5 := unpack 0x1::TestMutRefs::T($t0) + 3: $t6 := get_field<0x1::TestMutRefs::TSum>.sum($t4) 4: $t7 := -($t6, $t5) - 5: $t8 := borrow_field.sum($t4) + 5: $t8 := borrow_field<0x1::TestMutRefs::TSum>.sum($t4) 6: write_ref($t8, $t7) 7: write_back[Reference($t4).sum (u64)]($t8) - 8: write_back[TestMutRefs::TSum@]($t4) + 8: write_back[0x1::TestMutRefs::TSum@]($t4) 9: return () } [variant baseline] -public fun TestMutRefs::increment($t0|x: &mut TestMutRefs::T) { - var $t1|r: &mut TestMutRefs::TSum [unused] +public fun TestMutRefs::increment($t0|x: &mut 0x1::TestMutRefs::T) { + var $t1|r: &mut 0x1::TestMutRefs::TSum [unused] var $t2: u64 var $t3: u64 var $t4: u64 var $t5: &mut u64 var $t6: address - var $t7: &mut TestMutRefs::TSum + var $t7: &mut 0x1::TestMutRefs::TSum var $t8: u64 var $t9: u64 var $t10: u64 var $t11: &mut u64 - 0: $t2 := get_field.value($t0) + 0: $t2 := get_field<0x1::TestMutRefs::T>.value($t0) 1: $t3 := 1 2: $t4 := +($t2, $t3) - 3: $t5 := borrow_field.value($t0) + 3: $t5 := borrow_field<0x1::TestMutRefs::T>.value($t0) 4: write_ref($t5, $t4) 5: write_back[Reference($t0).value (u64)]($t5) 6: trace_local[x]($t0) 7: $t6 := 0x0 - 8: $t7 := borrow_global($t6) - 9: $t8 := get_field.sum($t7) + 8: $t7 := borrow_global<0x1::TestMutRefs::TSum>($t6) + 9: $t8 := get_field<0x1::TestMutRefs::TSum>.sum($t7) 10: $t9 := 1 11: $t10 := +($t8, $t9) - 12: $t11 := borrow_field.sum($t7) + 12: $t11 := borrow_field<0x1::TestMutRefs::TSum>.sum($t7) 13: write_ref($t11, $t10) 14: write_back[Reference($t7).sum (u64)]($t11) - 15: write_back[TestMutRefs::TSum@]($t7) + 15: write_back[0x1::TestMutRefs::TSum@]($t7) 16: trace_local[x]($t0) 17: return () } [variant baseline] -public fun TestMutRefs::increment_invalid($t0|x: &mut TestMutRefs::T) { +public fun TestMutRefs::increment_invalid($t0|x: &mut 0x1::TestMutRefs::T) { var $t1: u64 var $t2: u64 var $t3: u64 var $t4: &mut u64 - 0: $t1 := get_field.value($t0) + 0: $t1 := get_field<0x1::TestMutRefs::T>.value($t0) 1: $t2 := 1 2: $t3 := +($t1, $t2) - 3: $t4 := borrow_field.value($t0) + 3: $t4 := borrow_field<0x1::TestMutRefs::T>.value($t0) 4: write_ref($t4, $t3) 5: write_back[Reference($t0).value (u64)]($t4) 6: trace_local[x]($t0) @@ -390,70 +390,70 @@ public fun TestMutRefs::increment_invalid($t0|x: &mut TestMutRefs::T) { [variant baseline] -public fun TestMutRefs::new($t0|x: u64): TestMutRefs::T { - var $t1|r: &mut TestMutRefs::TSum [unused] +public fun TestMutRefs::new($t0|x: u64): 0x1::TestMutRefs::T { + var $t1|r: &mut 0x1::TestMutRefs::TSum [unused] var $t2: address - var $t3: &mut TestMutRefs::TSum + var $t3: &mut 0x1::TestMutRefs::TSum var $t4: u64 var $t5: u64 var $t6: &mut u64 - var $t7: TestMutRefs::T + var $t7: 0x1::TestMutRefs::T 0: $t2 := 0x0 - 1: $t3 := borrow_global($t2) - 2: $t4 := get_field.sum($t3) + 1: $t3 := borrow_global<0x1::TestMutRefs::TSum>($t2) + 2: $t4 := get_field<0x1::TestMutRefs::TSum>.sum($t3) 3: $t5 := +($t4, $t0) - 4: $t6 := borrow_field.sum($t3) + 4: $t6 := borrow_field<0x1::TestMutRefs::TSum>.sum($t3) 5: write_ref($t6, $t5) 6: write_back[Reference($t3).sum (u64)]($t6) - 7: write_back[TestMutRefs::TSum@]($t3) - 8: $t7 := pack TestMutRefs::T($t0) + 7: write_back[0x1::TestMutRefs::TSum@]($t3) + 8: $t7 := pack 0x1::TestMutRefs::T($t0) 9: return $t7 } [variant baseline] -fun TestMutRefs::private_data_invariant_invalid($t0|_x: &mut TestMutRefs::T) { +fun TestMutRefs::private_data_invariant_invalid($t0|_x: &mut 0x1::TestMutRefs::T) { 0: trace_local[_x]($t0) 1: return () } [variant baseline] -fun TestMutRefs::private_decrement($t0|x: &mut TestMutRefs::T) { - var $t1|r: &mut TestMutRefs::TSum [unused] +fun TestMutRefs::private_decrement($t0|x: &mut 0x1::TestMutRefs::T) { + var $t1|r: &mut 0x1::TestMutRefs::TSum [unused] var $t2: u64 var $t3: u64 var $t4: u64 var $t5: &mut u64 var $t6: address - var $t7: &mut TestMutRefs::TSum + var $t7: &mut 0x1::TestMutRefs::TSum var $t8: u64 var $t9: u64 var $t10: u64 var $t11: &mut u64 - 0: $t2 := get_field.value($t0) + 0: $t2 := get_field<0x1::TestMutRefs::T>.value($t0) 1: $t3 := 1 2: $t4 := -($t2, $t3) - 3: $t5 := borrow_field.value($t0) + 3: $t5 := borrow_field<0x1::TestMutRefs::T>.value($t0) 4: write_ref($t5, $t4) 5: write_back[Reference($t0).value (u64)]($t5) 6: trace_local[x]($t0) 7: $t6 := 0x0 - 8: $t7 := borrow_global($t6) - 9: $t8 := get_field.sum($t7) + 8: $t7 := borrow_global<0x1::TestMutRefs::TSum>($t6) + 9: $t8 := get_field<0x1::TestMutRefs::TSum>.sum($t7) 10: $t9 := 1 11: $t10 := -($t8, $t9) - 12: $t11 := borrow_field.sum($t7) + 12: $t11 := borrow_field<0x1::TestMutRefs::TSum>.sum($t7) 13: write_ref($t11, $t10) 14: write_back[Reference($t7).sum (u64)]($t11) - 15: write_back[TestMutRefs::TSum@]($t7) + 15: write_back[0x1::TestMutRefs::TSum@]($t7) 16: trace_local[x]($t0) 17: return () } [variant baseline] -fun TestMutRefs::private_to_public_caller($t0|r: &mut TestMutRefs::T) { +fun TestMutRefs::private_to_public_caller($t0|r: &mut 0x1::TestMutRefs::T) { 0: TestMutRefs::increment($t0) 1: trace_local[r]($t0) 2: return () @@ -462,10 +462,10 @@ fun TestMutRefs::private_to_public_caller($t0|r: &mut TestMutRefs::T) { [variant baseline] fun TestMutRefs::private_to_public_caller_invalid_data_invariant() { - var $t0|r: &mut TestMutRefs::T [unused] - var $t1|x: TestMutRefs::T + var $t0|r: &mut 0x1::TestMutRefs::T [unused] + var $t1|x: 0x1::TestMutRefs::T var $t2: u64 - var $t3: &mut TestMutRefs::T + var $t3: &mut 0x1::TestMutRefs::T 0: $t2 := 1 1: $t1 := TestMutRefs::new($t2) 2: $t3 := borrow_local($t1) @@ -479,10 +479,10 @@ fun TestMutRefs::private_to_public_caller_invalid_data_invariant() { [variant baseline] public fun TestMutRefsUser::valid() { - var $t0|x: TestMutRefs::T + var $t0|x: 0x1::TestMutRefs::T var $t1: u64 - var $t2: &mut TestMutRefs::T - var $t3: TestMutRefs::T + var $t2: &mut 0x1::TestMutRefs::T + var $t3: 0x1::TestMutRefs::T 0: $t1 := 4 1: $t0 := TestMutRefs::new($t1) 2: $t2 := borrow_local($t0) diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/mono_analysis/test.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/mono_analysis/test.v2_exp index c6e5fe4a87486..80f164e8b3d09 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/mono_analysis/test.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/mono_analysis/test.v2_exp @@ -1,57 +1,57 @@ ============ initial translation from Move ================ [variant baseline] -public fun Test::f1<#0>($t0|x1: #0): Test::A<#0, u64> { +public fun Test::f1<#0>($t0|x1: #0): 0x123::Test::A<#0, u64> { var $t1: #0 var $t2: u64 - var $t3: Test::A<#0, u64> + var $t3: 0x123::Test::A<#0, u64> 0: $t1 := move($t0) 1: $t2 := 10 - 2: $t3 := pack Test::A<#0, u64>($t1, $t2) + 2: $t3 := pack 0x123::Test::A<#0, u64>($t1, $t2) 3: return $t3 } [variant baseline] -public fun Test::f2($t0|x: u8): Test::B { +public fun Test::f2($t0|x: u8): 0x123::Test::B { var $t1: u8 - var $t2: Test::A - var $t3: Test::B + var $t2: 0x123::Test::A + var $t3: 0x123::Test::B 0: $t1 := move($t0) 1: $t2 := Test::f1($t1) - 2: $t3 := pack Test::B($t2) + 2: $t3 := pack 0x123::Test::B($t2) 3: return $t3 } [variant baseline] -public fun Test::f3<#0>($t0|x1: #0): Test::A<#0, u64> { +public fun Test::f3<#0>($t0|x1: #0): 0x123::Test::A<#0, u64> { var $t1: #0 var $t2: u64 - var $t3: Test::A<#0, u64> + var $t3: 0x123::Test::A<#0, u64> 0: $t1 := move($t0) 1: $t2 := 1 - 2: $t3 := pack Test::A<#0, u64>($t1, $t2) + 2: $t3 := pack 0x123::Test::A<#0, u64>($t1, $t2) 3: return $t3 } [variant baseline] -public fun Test::f4<#0>($t0|x1: #0): Test::B<#0> { +public fun Test::f4<#0>($t0|x1: #0): 0x123::Test::B<#0> { var $t1: #0 - var $t2: Test::A<#0, u64> - var $t3: Test::B<#0> + var $t2: 0x123::Test::A<#0, u64> + var $t3: 0x123::Test::B<#0> 0: $t1 := move($t0) 1: $t2 := Test::f3<#0>($t1) - 2: $t3 := pack Test::B<#0>($t2) + 2: $t3 := pack 0x123::Test::B<#0>($t2) 3: return $t3 } [variant baseline] -public fun Test::f5(): Test::B { +public fun Test::f5(): 0x123::Test::B { var $t0: u128 - var $t1: Test::B + var $t1: 0x123::Test::B 0: $t0 := 1 1: $t1 := Test::f4($t0) 2: return $t1 diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/mut_ref_instrumentation/basic_test.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/mut_ref_instrumentation/basic_test.v2_exp index c3fe0790bd1c3..c94dd4a087943 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/mut_ref_instrumentation/basic_test.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/mut_ref_instrumentation/basic_test.v2_exp @@ -1,21 +1,21 @@ ============ initial translation from Move ================ [variant baseline] -fun TestEliminateMutRefs::test1(): TestEliminateMutRefs::R { - var $t0|r: TestEliminateMutRefs::R +fun TestEliminateMutRefs::test1(): 0x42::TestEliminateMutRefs::R { + var $t0|r: 0x42::TestEliminateMutRefs::R var $t1|x_ref: &mut u64 var $t2: u64 - var $t3: TestEliminateMutRefs::R - var $t4: &mut TestEliminateMutRefs::R + var $t3: 0x42::TestEliminateMutRefs::R + var $t4: &mut 0x42::TestEliminateMutRefs::R var $t5: &mut u64 var $t6: u64 var $t7: &mut u64 - var $t8: TestEliminateMutRefs::R + var $t8: 0x42::TestEliminateMutRefs::R 0: $t2 := 3 - 1: $t3 := pack TestEliminateMutRefs::R($t2) + 1: $t3 := pack 0x42::TestEliminateMutRefs::R($t2) 2: $t0 := $t3 3: $t4 := borrow_local($t0) - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::TestEliminateMutRefs::R>.x($t4) 5: $t1 := $t5 6: $t6 := 0 7: $t7 := move($t1) @@ -37,12 +37,12 @@ fun TestEliminateMutRefs::test2($t0|x_ref: &mut u64, $t1|v: u64) { [variant baseline] -public fun TestEliminateMutRefs::test3($t0|r_ref: &mut TestEliminateMutRefs::R, $t1|v: u64) { - var $t2: &mut TestEliminateMutRefs::R +public fun TestEliminateMutRefs::test3($t0|r_ref: &mut 0x42::TestEliminateMutRefs::R, $t1|v: u64) { + var $t2: &mut 0x42::TestEliminateMutRefs::R var $t3: &mut u64 var $t4: u64 0: $t2 := move($t0) - 1: $t3 := borrow_field.x($t2) + 1: $t3 := borrow_field<0x42::TestEliminateMutRefs::R>.x($t2) 2: $t4 := move($t1) 3: TestEliminateMutRefs::test2($t3, $t4) 4: return () @@ -50,15 +50,15 @@ public fun TestEliminateMutRefs::test3($t0|r_ref: &mut TestEliminateMutRefs::R, [variant baseline] -fun TestEliminateMutRefs::test4(): TestEliminateMutRefs::R { - var $t0|r: TestEliminateMutRefs::R +fun TestEliminateMutRefs::test4(): 0x42::TestEliminateMutRefs::R { + var $t0|r: 0x42::TestEliminateMutRefs::R var $t1: u64 - var $t2: TestEliminateMutRefs::R - var $t3: &mut TestEliminateMutRefs::R + var $t2: 0x42::TestEliminateMutRefs::R + var $t3: &mut 0x42::TestEliminateMutRefs::R var $t4: u64 - var $t5: TestEliminateMutRefs::R + var $t5: 0x42::TestEliminateMutRefs::R 0: $t1 := 3 - 1: $t2 := pack TestEliminateMutRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateMutRefs::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := 0 @@ -69,26 +69,26 @@ fun TestEliminateMutRefs::test4(): TestEliminateMutRefs::R { [variant baseline] -public fun TestEliminateMutRefs::test5($t0|r_ref: &mut TestEliminateMutRefs::R): &mut u64 { - var $t1: &mut TestEliminateMutRefs::R +public fun TestEliminateMutRefs::test5($t0|r_ref: &mut 0x42::TestEliminateMutRefs::R): &mut u64 { + var $t1: &mut 0x42::TestEliminateMutRefs::R var $t2: &mut u64 0: $t1 := move($t0) - 1: $t2 := borrow_field.x($t1) + 1: $t2 := borrow_field<0x42::TestEliminateMutRefs::R>.x($t1) 2: return $t2 } [variant baseline] -fun TestEliminateMutRefs::test6(): TestEliminateMutRefs::R { - var $t0|r: TestEliminateMutRefs::R +fun TestEliminateMutRefs::test6(): 0x42::TestEliminateMutRefs::R { + var $t0|r: 0x42::TestEliminateMutRefs::R var $t1: u64 - var $t2: TestEliminateMutRefs::R - var $t3: &mut TestEliminateMutRefs::R + var $t2: 0x42::TestEliminateMutRefs::R + var $t3: &mut 0x42::TestEliminateMutRefs::R var $t4: &mut u64 var $t5: u64 - var $t6: TestEliminateMutRefs::R + var $t6: 0x42::TestEliminateMutRefs::R 0: $t1 := 3 - 1: $t2 := pack TestEliminateMutRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateMutRefs::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := TestEliminateMutRefs::test5($t3) @@ -101,24 +101,24 @@ fun TestEliminateMutRefs::test6(): TestEliminateMutRefs::R { [variant baseline] fun TestEliminateMutRefs::test7($t0|b: bool) { - var $t1|r1: TestEliminateMutRefs::R - var $t2|r2: TestEliminateMutRefs::R - var $t3|r_ref: &mut TestEliminateMutRefs::R + var $t1|r1: 0x42::TestEliminateMutRefs::R + var $t2|r2: 0x42::TestEliminateMutRefs::R + var $t3|r_ref: &mut 0x42::TestEliminateMutRefs::R var $t4: u64 - var $t5: TestEliminateMutRefs::R + var $t5: 0x42::TestEliminateMutRefs::R var $t6: u64 - var $t7: TestEliminateMutRefs::R - var $t8: &mut TestEliminateMutRefs::R + var $t7: 0x42::TestEliminateMutRefs::R + var $t8: &mut 0x42::TestEliminateMutRefs::R var $t9: bool - var $t10: &mut TestEliminateMutRefs::R - var $t11: &mut TestEliminateMutRefs::R - var $t12: &mut TestEliminateMutRefs::R + var $t10: &mut 0x42::TestEliminateMutRefs::R + var $t11: &mut 0x42::TestEliminateMutRefs::R + var $t12: &mut 0x42::TestEliminateMutRefs::R var $t13: u64 0: $t4 := 3 - 1: $t5 := pack TestEliminateMutRefs::R($t4) + 1: $t5 := pack 0x42::TestEliminateMutRefs::R($t4) 2: $t1 := $t5 3: $t6 := 4 - 4: $t7 := pack TestEliminateMutRefs::R($t6) + 4: $t7 := pack 0x42::TestEliminateMutRefs::R($t6) 5: $t2 := $t7 6: $t8 := borrow_local($t1) 7: $t3 := $t8 @@ -139,41 +139,41 @@ fun TestEliminateMutRefs::test7($t0|b: bool) { [variant baseline] -fun TestEliminateMutRefs::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestEliminateMutRefs::R) { - var $t3|r1: TestEliminateMutRefs::R - var $t4|r2: TestEliminateMutRefs::R - var $t5|t_ref: &mut TestEliminateMutRefs::R +fun TestEliminateMutRefs::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut 0x42::TestEliminateMutRefs::R) { + var $t3|r1: 0x42::TestEliminateMutRefs::R + var $t4|r2: 0x42::TestEliminateMutRefs::R + var $t5|t_ref: &mut 0x42::TestEliminateMutRefs::R var $t6: u64 - var $t7: TestEliminateMutRefs::R + var $t7: 0x42::TestEliminateMutRefs::R var $t8: u64 - var $t9: TestEliminateMutRefs::R - var $t10: &mut TestEliminateMutRefs::R + var $t9: 0x42::TestEliminateMutRefs::R + var $t10: &mut 0x42::TestEliminateMutRefs::R var $t11: u64 var $t12: u64 var $t13: bool - var $t14: &mut TestEliminateMutRefs::R + var $t14: &mut 0x42::TestEliminateMutRefs::R var $t15: u64 var $t16: u64 var $t17: u64 var $t18: u64 var $t19: bool - var $t20: &mut TestEliminateMutRefs::R - var $t21: &mut TestEliminateMutRefs::R + var $t20: &mut 0x42::TestEliminateMutRefs::R + var $t21: &mut 0x42::TestEliminateMutRefs::R var $t22: u64 var $t23: u64 var $t24: u64 var $t25: bool - var $t26: &mut TestEliminateMutRefs::R - var $t27: &mut TestEliminateMutRefs::R + var $t26: &mut 0x42::TestEliminateMutRefs::R + var $t27: &mut 0x42::TestEliminateMutRefs::R var $t28: u64 - var $t29: &mut TestEliminateMutRefs::R - var $t30: &mut TestEliminateMutRefs::R + var $t29: &mut 0x42::TestEliminateMutRefs::R + var $t30: &mut 0x42::TestEliminateMutRefs::R var $t31: u64 0: $t6 := 3 - 1: $t7 := pack TestEliminateMutRefs::R($t6) + 1: $t7 := pack 0x42::TestEliminateMutRefs::R($t6) 2: $t3 := $t7 3: $t8 := 4 - 4: $t9 := pack TestEliminateMutRefs::R($t8) + 4: $t9 := pack 0x42::TestEliminateMutRefs::R($t8) 5: $t4 := $t9 6: $t10 := borrow_local($t4) 7: $t5 := $t10 @@ -232,21 +232,21 @@ fun TestEliminateMutRefs::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestEli ============ after pipeline `mut_ref_instrumentation` ================ [variant baseline] -fun TestEliminateMutRefs::test1(): TestEliminateMutRefs::R { - var $t0|r: TestEliminateMutRefs::R +fun TestEliminateMutRefs::test1(): 0x42::TestEliminateMutRefs::R { + var $t0|r: 0x42::TestEliminateMutRefs::R var $t1|x_ref: &mut u64 var $t2: u64 - var $t3: TestEliminateMutRefs::R - var $t4: &mut TestEliminateMutRefs::R + var $t3: 0x42::TestEliminateMutRefs::R + var $t4: &mut 0x42::TestEliminateMutRefs::R var $t5: &mut u64 var $t6: u64 var $t7: &mut u64 - var $t8: TestEliminateMutRefs::R + var $t8: 0x42::TestEliminateMutRefs::R 0: $t2 := 3 - 1: $t3 := pack TestEliminateMutRefs::R($t2) + 1: $t3 := pack 0x42::TestEliminateMutRefs::R($t2) 2: $t0 := $t3 3: $t4 := borrow_local($t0) - 4: $t5 := borrow_field.x($t4) + 4: $t5 := borrow_field<0x42::TestEliminateMutRefs::R>.x($t4) 5: $t1 := $t5 6: $t6 := 0 7: $t7 := move($t1) @@ -269,12 +269,12 @@ fun TestEliminateMutRefs::test2($t0|x_ref: &mut u64, $t1|v: u64) { [variant baseline] -public fun TestEliminateMutRefs::test3($t0|r_ref: &mut TestEliminateMutRefs::R, $t1|v: u64) { - var $t2: &mut TestEliminateMutRefs::R +public fun TestEliminateMutRefs::test3($t0|r_ref: &mut 0x42::TestEliminateMutRefs::R, $t1|v: u64) { + var $t2: &mut 0x42::TestEliminateMutRefs::R var $t3: &mut u64 var $t4: u64 0: $t2 := copy($t0) - 1: $t3 := borrow_field.x($t2) + 1: $t3 := borrow_field<0x42::TestEliminateMutRefs::R>.x($t2) 2: $t4 := move($t1) 3: TestEliminateMutRefs::test2($t3, $t4) 4: trace_local[r_ref]($t0) @@ -283,15 +283,15 @@ public fun TestEliminateMutRefs::test3($t0|r_ref: &mut TestEliminateMutRefs::R, [variant baseline] -fun TestEliminateMutRefs::test4(): TestEliminateMutRefs::R { - var $t0|r: TestEliminateMutRefs::R +fun TestEliminateMutRefs::test4(): 0x42::TestEliminateMutRefs::R { + var $t0|r: 0x42::TestEliminateMutRefs::R var $t1: u64 - var $t2: TestEliminateMutRefs::R - var $t3: &mut TestEliminateMutRefs::R + var $t2: 0x42::TestEliminateMutRefs::R + var $t3: &mut 0x42::TestEliminateMutRefs::R var $t4: u64 - var $t5: TestEliminateMutRefs::R + var $t5: 0x42::TestEliminateMutRefs::R 0: $t1 := 3 - 1: $t2 := pack TestEliminateMutRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateMutRefs::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := 0 @@ -302,27 +302,27 @@ fun TestEliminateMutRefs::test4(): TestEliminateMutRefs::R { [variant baseline] -public fun TestEliminateMutRefs::test5($t0|r_ref: &mut TestEliminateMutRefs::R): &mut u64 { - var $t1: &mut TestEliminateMutRefs::R +public fun TestEliminateMutRefs::test5($t0|r_ref: &mut 0x42::TestEliminateMutRefs::R): &mut u64 { + var $t1: &mut 0x42::TestEliminateMutRefs::R var $t2: &mut u64 0: $t1 := copy($t0) - 1: $t2 := borrow_field.x($t1) + 1: $t2 := borrow_field<0x42::TestEliminateMutRefs::R>.x($t1) 2: trace_local[r_ref]($t0) 3: return $t2 } [variant baseline] -fun TestEliminateMutRefs::test6(): TestEliminateMutRefs::R { - var $t0|r: TestEliminateMutRefs::R +fun TestEliminateMutRefs::test6(): 0x42::TestEliminateMutRefs::R { + var $t0|r: 0x42::TestEliminateMutRefs::R var $t1: u64 - var $t2: TestEliminateMutRefs::R - var $t3: &mut TestEliminateMutRefs::R + var $t2: 0x42::TestEliminateMutRefs::R + var $t3: &mut 0x42::TestEliminateMutRefs::R var $t4: &mut u64 var $t5: u64 - var $t6: TestEliminateMutRefs::R + var $t6: 0x42::TestEliminateMutRefs::R 0: $t1 := 3 - 1: $t2 := pack TestEliminateMutRefs::R($t1) + 1: $t2 := pack 0x42::TestEliminateMutRefs::R($t1) 2: $t0 := $t2 3: $t3 := borrow_local($t0) 4: $t4 := TestEliminateMutRefs::test5($t3) @@ -335,24 +335,24 @@ fun TestEliminateMutRefs::test6(): TestEliminateMutRefs::R { [variant baseline] fun TestEliminateMutRefs::test7($t0|b: bool) { - var $t1|r1: TestEliminateMutRefs::R - var $t2|r2: TestEliminateMutRefs::R - var $t3|r_ref: &mut TestEliminateMutRefs::R + var $t1|r1: 0x42::TestEliminateMutRefs::R + var $t2|r2: 0x42::TestEliminateMutRefs::R + var $t3|r_ref: &mut 0x42::TestEliminateMutRefs::R var $t4: u64 - var $t5: TestEliminateMutRefs::R + var $t5: 0x42::TestEliminateMutRefs::R var $t6: u64 - var $t7: TestEliminateMutRefs::R - var $t8: &mut TestEliminateMutRefs::R + var $t7: 0x42::TestEliminateMutRefs::R + var $t8: &mut 0x42::TestEliminateMutRefs::R var $t9: bool - var $t10: &mut TestEliminateMutRefs::R - var $t11: &mut TestEliminateMutRefs::R - var $t12: &mut TestEliminateMutRefs::R + var $t10: &mut 0x42::TestEliminateMutRefs::R + var $t11: &mut 0x42::TestEliminateMutRefs::R + var $t12: &mut 0x42::TestEliminateMutRefs::R var $t13: u64 0: $t4 := 3 - 1: $t5 := pack TestEliminateMutRefs::R($t4) + 1: $t5 := pack 0x42::TestEliminateMutRefs::R($t4) 2: $t1 := $t5 3: $t6 := 4 - 4: $t7 := pack TestEliminateMutRefs::R($t6) + 4: $t7 := pack 0x42::TestEliminateMutRefs::R($t6) 5: $t2 := $t7 6: $t8 := borrow_local($t1) 7: $t3 := $t8 @@ -372,41 +372,41 @@ fun TestEliminateMutRefs::test7($t0|b: bool) { [variant baseline] -fun TestEliminateMutRefs::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut TestEliminateMutRefs::R) { - var $t3|r1: TestEliminateMutRefs::R - var $t4|r2: TestEliminateMutRefs::R - var $t5|t_ref: &mut TestEliminateMutRefs::R +fun TestEliminateMutRefs::test8($t0|b: bool, $t1|n: u64, $t2|r_ref: &mut 0x42::TestEliminateMutRefs::R) { + var $t3|r1: 0x42::TestEliminateMutRefs::R + var $t4|r2: 0x42::TestEliminateMutRefs::R + var $t5|t_ref: &mut 0x42::TestEliminateMutRefs::R var $t6: u64 - var $t7: TestEliminateMutRefs::R + var $t7: 0x42::TestEliminateMutRefs::R var $t8: u64 - var $t9: TestEliminateMutRefs::R - var $t10: &mut TestEliminateMutRefs::R + var $t9: 0x42::TestEliminateMutRefs::R + var $t10: &mut 0x42::TestEliminateMutRefs::R var $t11: u64 var $t12: u64 var $t13: bool - var $t14: &mut TestEliminateMutRefs::R + var $t14: &mut 0x42::TestEliminateMutRefs::R var $t15: u64 var $t16: u64 var $t17: u64 var $t18: u64 var $t19: bool - var $t20: &mut TestEliminateMutRefs::R - var $t21: &mut TestEliminateMutRefs::R + var $t20: &mut 0x42::TestEliminateMutRefs::R + var $t21: &mut 0x42::TestEliminateMutRefs::R var $t22: u64 var $t23: u64 var $t24: u64 var $t25: bool - var $t26: &mut TestEliminateMutRefs::R - var $t27: &mut TestEliminateMutRefs::R + var $t26: &mut 0x42::TestEliminateMutRefs::R + var $t27: &mut 0x42::TestEliminateMutRefs::R var $t28: u64 - var $t29: &mut TestEliminateMutRefs::R - var $t30: &mut TestEliminateMutRefs::R + var $t29: &mut 0x42::TestEliminateMutRefs::R + var $t30: &mut 0x42::TestEliminateMutRefs::R var $t31: u64 0: $t6 := 3 - 1: $t7 := pack TestEliminateMutRefs::R($t6) + 1: $t7 := pack 0x42::TestEliminateMutRefs::R($t6) 2: $t3 := $t7 3: $t8 := 4 - 4: $t9 := pack TestEliminateMutRefs::R($t8) + 4: $t9 := pack 0x42::TestEliminateMutRefs::R($t8) 5: $t4 := $t9 6: $t10 := borrow_local($t4) 7: $t5 := $t10 diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/fun_spec.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/fun_spec.v2_exp index 8b471c086cdd7..a7ad467767167 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/fun_spec.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/fun_spec.v2_exp @@ -74,30 +74,30 @@ fun Test::multiple_results($t0|a: u64, $t1|b: u64): (u64, u64) { [variant baseline] -fun Test::mut_ref_param($t0|r: &mut Test::R): u64 { +fun Test::mut_ref_param($t0|r: &mut 0x42::Test::R): u64 { var $t1|x: u64 - var $t2: &mut Test::R + var $t2: &mut 0x42::Test::R var $t3: &u64 var $t4: u64 - var $t5: &mut Test::R + var $t5: &mut 0x42::Test::R var $t6: &u64 var $t7: u64 var $t8: u64 var $t9: u64 - var $t10: &mut Test::R + var $t10: &mut 0x42::Test::R var $t11: &mut u64 var $t12: u64 0: $t2 := copy($t0) - 1: $t3 := borrow_field.v($t2) + 1: $t3 := borrow_field<0x42::Test::R>.v($t2) 2: $t4 := read_ref($t3) 3: $t1 := $t4 4: $t5 := copy($t0) - 5: $t6 := borrow_field.v($t5) + 5: $t6 := borrow_field<0x42::Test::R>.v($t5) 6: $t7 := read_ref($t6) 7: $t8 := 1 8: $t9 := -($t7, $t8) 9: $t10 := move($t0) - 10: $t11 := borrow_field.v($t10) + 10: $t11 := borrow_field<0x42::Test::R>.v($t10) 11: write_ref($t11, $t9) 12: $t12 := move($t1) 13: return $t12 @@ -105,45 +105,45 @@ fun Test::mut_ref_param($t0|r: &mut Test::R): u64 { [variant baseline] -fun Test::ref_param($t0|r: &Test::R): u64 { - var $t1: &Test::R +fun Test::ref_param($t0|r: &0x42::Test::R): u64 { + var $t1: &0x42::Test::R var $t2: &u64 var $t3: u64 0: $t1 := move($t0) - 1: $t2 := borrow_field.v($t1) + 1: $t2 := borrow_field<0x42::Test::R>.v($t1) 2: $t3 := read_ref($t2) 3: return $t3 } [variant baseline] -fun Test::ref_param_return_ref($t0|r: &Test::R): &u64 { - var $t1: &Test::R +fun Test::ref_param_return_ref($t0|r: &0x42::Test::R): &u64 { + var $t1: &0x42::Test::R var $t2: &u64 0: $t1 := move($t0) - 1: $t2 := borrow_field.v($t1) + 1: $t2 := borrow_field<0x42::Test::R>.v($t1) 2: return $t2 } [variant baseline] fun Test::resource_with_old($t0|val: u64) { - var $t1|r: &mut Test::R + var $t1|r: &mut 0x42::Test::R var $t2: address var $t3: bool var $t4: bool var $t5: u64 var $t6: address - var $t7: &mut Test::R - var $t8: &mut Test::R + var $t7: &mut 0x42::Test::R + var $t8: &mut 0x42::Test::R var $t9: &u64 var $t10: u64 var $t11: u64 var $t12: u64 - var $t13: &mut Test::R + var $t13: &mut 0x42::Test::R var $t14: &mut u64 0: $t2 := 0x0 - 1: $t3 := exists($t2) + 1: $t3 := exists<0x42::Test::R>($t2) 2: $t4 := !($t3) 3: if ($t4) goto 4 else goto 7 4: label L1 @@ -151,15 +151,15 @@ fun Test::resource_with_old($t0|val: u64) { 6: abort($t5) 7: label L0 8: $t6 := 0x0 - 9: $t7 := borrow_global($t6) + 9: $t7 := borrow_global<0x42::Test::R>($t6) 10: $t1 := $t7 11: $t8 := copy($t1) - 12: $t9 := borrow_field.v($t8) + 12: $t9 := borrow_field<0x42::Test::R>.v($t8) 13: $t10 := read_ref($t9) 14: $t11 := move($t0) 15: $t12 := +($t10, $t11) 16: $t13 := move($t1) - 17: $t14 := borrow_field.v($t13) + 17: $t14 := borrow_field<0x42::Test::R>.v($t13) 18: write_ref($t14, $t12) 19: return () } @@ -252,9 +252,9 @@ fun Test::multiple_results($t0|a: u64, $t1|b: u64): (u64, u64) { [variant verification] -fun Test::mut_ref_param($t0|r: &mut Test::R): u64 { +fun Test::mut_ref_param($t0|r: &mut 0x42::Test::R): u64 { var $t1|x: u64 - var $t2: Test::R + var $t2: 0x42::Test::R var $t3: u64 var $t4: u64 var $t5: u64 @@ -262,72 +262,72 @@ fun Test::mut_ref_param($t0|r: &mut Test::R): u64 { var $t7: num var $t8: &mut u64 0: $t2 := read_ref($t0) - 1: $t3 := get_field.v($t0) - 2: $t4 := get_field.v($t0) + 1: $t3 := get_field<0x42::Test::R>.v($t0) + 2: $t4 := get_field<0x42::Test::R>.v($t0) 3: $t5 := 1 4: $t6 := -($t4, $t5) on_abort goto 15 with $t7 - 5: $t8 := borrow_field.v($t0) + 5: $t8 := borrow_field<0x42::Test::R>.v($t0) 6: write_ref($t8, $t6) 7: write_back[Reference($t0).v (u64)]($t8) 8: trace_local[r]($t0) 9: trace_local[r]($t0) 10: label L1 # VC: function does not abort under this condition at tests/spec_instrumentation/fun_spec.move:67:6+42 - 11: assert Not(Eq(select Test::R.v($t2), 0)) + 11: assert Not(Eq(select Test::R.v<0x42::Test::R>($t2), 0)) # VC: post-condition does not hold at tests/spec_instrumentation/fun_spec.move:68:6+27 - 12: assert Eq($t3, select Test::R.v($t2)) + 12: assert Eq($t3, select Test::R.v<0x42::Test::R>($t2)) # VC: post-condition does not hold at tests/spec_instrumentation/fun_spec.move:69:6+28 - 13: assert Eq(select Test::R.v($t0), Add(select Test::R.v($t2), 1)) + 13: assert Eq(select Test::R.v<0x42::Test::R>($t0), Add(select Test::R.v<0x42::Test::R>($t2), 1)) 14: return $t3 15: label L2 # VC: abort not covered by any of the `aborts_if` clauses at tests/spec_instrumentation/fun_spec.move:66:2+138 - 16: assert Eq(select Test::R.v($t2), 0) + 16: assert Eq(select Test::R.v<0x42::Test::R>($t2), 0) # VC: abort code not covered by any of the `aborts_if` or `aborts_with` clauses at tests/spec_instrumentation/fun_spec.move:66:2+138 - 17: assert And(Eq(select Test::R.v($t2), 0), Eq(-1, $t7)) + 17: assert And(Eq(select Test::R.v<0x42::Test::R>($t2), 0), Eq(-1, $t7)) 18: abort($t7) } [variant verification] -fun Test::ref_param($t0|r: Test::R): u64 { +fun Test::ref_param($t0|r: 0x42::Test::R): u64 { var $t1: u64 - 0: $t1 := get_field.v($t0) + 0: $t1 := get_field<0x42::Test::R>.v($t0) 1: label L1 # VC: post-condition does not hold at tests/spec_instrumentation/fun_spec.move:51:6+22 - 2: assert Eq($t1, select Test::R.v($t0)) + 2: assert Eq($t1, select Test::R.v<0x42::Test::R>($t0)) 3: return $t1 } [variant verification] -fun Test::ref_param_return_ref($t0|r: Test::R): u64 { +fun Test::ref_param_return_ref($t0|r: 0x42::Test::R): u64 { var $t1: u64 - 0: $t1 := get_field.v($t0) + 0: $t1 := get_field<0x42::Test::R>.v($t0) 1: label L1 # VC: post-condition does not hold at tests/spec_instrumentation/fun_spec.move:58:6+22 - 2: assert Eq($t1, select Test::R.v($t0)) + 2: assert Eq($t1, select Test::R.v<0x42::Test::R>($t0)) 3: return $t1 } [variant verification] fun Test::resource_with_old($t0|val: u64) { - var $t1|r: &mut Test::R + var $t1|r: &mut 0x42::Test::R var $t2: address var $t3: bool var $t4: bool var $t5: u64 var $t6: num var $t7: address - var $t8: &mut Test::R + var $t8: &mut 0x42::Test::R var $t9: u64 var $t10: u64 var $t11: &mut u64 0: assume Gt($t0, 0) - 1: assume CanModify(0x0) + 1: assume CanModify<0x42::Test::R>(0x0) 2: @0 := save_mem(Test::R) 3: $t2 := 0x0 - 4: $t3 := exists($t2) + 4: $t3 := exists<0x42::Test::R>($t2) 5: $t4 := !($t3) 6: if ($t4) goto 7 else goto 11 7: label L1 @@ -337,27 +337,27 @@ fun Test::resource_with_old($t0|val: u64) { 11: label L0 12: $t7 := 0x0 # VC: caller does not have permission to modify `Test::R` at given address at tests/spec_instrumentation/fun_spec.move:36:14+17 - 13: assert CanModify($t7) - 14: $t8 := borrow_global($t7) on_abort goto 26 with $t6 - 15: $t9 := get_field.v($t8) + 13: assert CanModify<0x42::Test::R>($t7) + 14: $t8 := borrow_global<0x42::Test::R>($t7) on_abort goto 26 with $t6 + 15: $t9 := get_field<0x42::Test::R>.v($t8) 16: $t10 := +($t9, $t0) on_abort goto 26 with $t6 - 17: $t11 := borrow_field.v($t8) + 17: $t11 := borrow_field<0x42::Test::R>.v($t8) 18: write_ref($t11, $t10) 19: write_back[Reference($t8).v (u64)]($t11) - 20: write_back[Test::R@]($t8) + 20: write_back[0x42::Test::R@]($t8) 21: label L2 # VC: function does not abort under this condition at tests/spec_instrumentation/fun_spec.move:41:6+35 - 22: assert Not(Not(exists[@0](0x0))) + 22: assert Not(Not(exists[@0]<0x42::Test::R>(0x0))) # VC: function does not abort under this condition at tests/spec_instrumentation/fun_spec.move:42:6+58 - 23: assert Not(Ge(Add(select Test::R.v(global[@0](0x0)), $t0), 18446744073709551615)) + 23: assert Not(Ge(Add(select Test::R.v<0x42::Test::R>(global[@0]<0x42::Test::R>(0x0)), $t0), 18446744073709551615)) # VC: post-condition does not hold at tests/spec_instrumentation/fun_spec.move:43:6+58 - 24: assert Eq(select Test::R.v(global(0x0)), Add(select Test::R.v(global[@0](0x0)), $t0)) + 24: assert Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>(0x0)), Add(select Test::R.v<0x42::Test::R>(global[@0]<0x42::Test::R>(0x0)), $t0)) 25: return () 26: label L3 # VC: abort not covered by any of the `aborts_if` clauses at tests/spec_instrumentation/fun_spec.move:39:2+250 - 27: assert Or(Not(exists[@0](0x0)), Ge(Add(select Test::R.v(global[@0](0x0)), $t0), 18446744073709551615)) + 27: assert Or(Not(exists[@0]<0x42::Test::R>(0x0)), Ge(Add(select Test::R.v<0x42::Test::R>(global[@0]<0x42::Test::R>(0x0)), $t0), 18446744073709551615)) # VC: abort code not covered by any of the `aborts_if` or `aborts_with` clauses at tests/spec_instrumentation/fun_spec.move:39:2+250 - 28: assert Or(And(Not(exists[@0](0x0)), Eq(33, $t6)), Ge(Add(select Test::R.v(global[@0](0x0)), $t0), 18446744073709551615)) + 28: assert Or(And(Not(exists[@0]<0x42::Test::R>(0x0)), Eq(33, $t6)), Ge(Add(select Test::R.v<0x42::Test::R>(global[@0]<0x42::Test::R>(0x0)), $t0), 18446744073709551615)) 29: abort($t6) } @@ -409,52 +409,52 @@ spec { fun Test::mut_ref_param[baseline] spec { - aborts_if Eq(select Test::R.v($t0), 0); - ensures Eq(result0(), Old(select Test::R.v($t0))); - ensures Eq(select Test::R.v($t0), Add(Old(select Test::R.v($t0)), 1)); + aborts_if Eq(select Test::R.v<0x42::Test::R>($t0), 0); + ensures Eq(result0(), Old(select Test::R.v<0x42::Test::R>($t0))); + ensures Eq(select Test::R.v<0x42::Test::R>($t0), Add(Old(select Test::R.v<0x42::Test::R>($t0)), 1)); } fun Test::mut_ref_param[verification] spec { - aborts_if Eq(select Test::R.v($t0), 0); - ensures Eq(result0(), Old(select Test::R.v($t0))); - ensures Eq(select Test::R.v($t0), Add(Old(select Test::R.v($t0)), 1)); + aborts_if Eq(select Test::R.v<0x42::Test::R>($t0), 0); + ensures Eq(result0(), Old(select Test::R.v<0x42::Test::R>($t0))); + ensures Eq(select Test::R.v<0x42::Test::R>($t0), Add(Old(select Test::R.v<0x42::Test::R>($t0)), 1)); } fun Test::ref_param[baseline] spec { - ensures Eq(result0(), select Test::R.v($t0)); + ensures Eq(result0(), select Test::R.v<0x42::Test::R>($t0)); } fun Test::ref_param[verification] spec { - ensures Eq(result0(), select Test::R.v($t0)); + ensures Eq(result0(), select Test::R.v<0x42::Test::R>($t0)); } fun Test::ref_param_return_ref[baseline] spec { - ensures Eq(result0(), select Test::R.v($t0)); + ensures Eq(result0(), select Test::R.v<0x42::Test::R>($t0)); } fun Test::ref_param_return_ref[verification] spec { - ensures Eq(result0(), select Test::R.v($t0)); + ensures Eq(result0(), select Test::R.v<0x42::Test::R>($t0)); } fun Test::resource_with_old[baseline] spec { requires Gt($t0, 0); - aborts_if Not(exists(0x0)); - aborts_if Ge(Add(select Test::R.v(global(0x0)), $t0), 18446744073709551615); - ensures Eq(select Test::R.v(global(0x0)), Add(select Test::R.v(Old(global(0x0))), $t0)); - modifies global(0x0); + aborts_if Not(exists<0x42::Test::R>(0x0)); + aborts_if Ge(Add(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>(0x0)), $t0), 18446744073709551615); + ensures Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>(0x0)), Add(select Test::R.v<0x42::Test::R>(Old<0x42::Test::R>(global<0x42::Test::R>(0x0))), $t0)); + modifies global<0x42::Test::R>(0x0); } fun Test::resource_with_old[verification] spec { requires Gt($t0, 0); - aborts_if Not(exists(0x0)); - aborts_if Ge(Add(select Test::R.v(global(0x0)), $t0), 18446744073709551615); - ensures Eq(select Test::R.v(global(0x0)), Add(select Test::R.v(Old(global(0x0))), $t0)); - modifies global(0x0); + aborts_if Not(exists<0x42::Test::R>(0x0)); + aborts_if Ge(Add(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>(0x0)), $t0), 18446744073709551615); + ensures Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>(0x0)), Add(select Test::R.v<0x42::Test::R>(Old<0x42::Test::R>(global<0x42::Test::R>(0x0))), $t0)); + modifies global<0x42::Test::R>(0x0); } diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/generics.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/generics.v2_exp index 82dcdda4e77a4..20d3c90eb528a 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/generics.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/generics.v2_exp @@ -1,19 +1,19 @@ ============ initial translation from Move ================ [variant baseline] -fun Generics::remove<#0>($t0|a: address): Generics::R<#0> { +fun Generics::remove<#0>($t0|a: address): 0x42::Generics::R<#0> { var $t1: address - var $t2: Generics::R<#0> + var $t2: 0x42::Generics::R<#0> 0: $t1 := move($t0) - 1: $t2 := move_from>($t1) + 1: $t2 := move_from<0x42::Generics::R<#0>>($t1) 2: return $t2 } [variant baseline] -fun Generics::remove_u64($t0|a: address): Generics::R { +fun Generics::remove_u64($t0|a: address): 0x42::Generics::R { var $t1: address - var $t2: Generics::R + var $t2: 0x42::Generics::R 0: $t1 := move($t0) 1: $t2 := Generics::remove($t1) 2: return $t2 @@ -22,16 +22,16 @@ fun Generics::remove_u64($t0|a: address): Generics::R { ============ after pipeline `spec_instrumentation` ================ [variant verification] -fun Generics::remove<#0>($t0|a: address): Generics::R<#0> { - var $t1: Generics::R<#0> +fun Generics::remove<#0>($t0|a: address): 0x42::Generics::R<#0> { + var $t1: 0x42::Generics::R<#0> var $t2: num - 0: assume CanModify>($t0) + 0: assume CanModify<0x42::Generics::R<#0>>($t0) # VC: caller does not have permission to modify `Generics::R<#0>` at given address at tests/spec_instrumentation/generics.move:11:9+9 - 1: assert CanModify>($t0) - 2: $t1 := move_from>($t0) on_abort goto 6 with $t2 + 1: assert CanModify<0x42::Generics::R<#0>>($t0) + 2: $t1 := move_from<0x42::Generics::R<#0>>($t0) on_abort goto 6 with $t2 3: label L1 # VC: post-condition does not hold at tests/spec_instrumentation/generics.move:20:9+25 - 4: assert Not(exists>($t0)) + 4: assert Not(exists<0x42::Generics::R<#0>>($t0)) 5: return $t1 6: label L2 7: abort($t2) @@ -39,13 +39,13 @@ fun Generics::remove<#0>($t0|a: address): Generics::R<#0> { [variant verification] -fun Generics::remove_u64($t0|a: address): Generics::R { - var $t1: Generics::R +fun Generics::remove_u64($t0|a: address): 0x42::Generics::R { + var $t1: 0x42::Generics::R var $t2: bool var $t3: num - 0: assume CanModify>($t0) + 0: assume CanModify<0x42::Generics::R>($t0) # VC: caller does not have permission to modify `Generics::R` at given address at tests/spec_instrumentation/generics.move:24:9+14 - 1: assert CanModify>($t0) + 1: assert CanModify<0x42::Generics::R>($t0) 2: $t1 := opaque begin: Generics::remove($t0) 3: $t2 := havoc[val]() 4: if ($t2) goto 5 else goto 8 @@ -53,13 +53,13 @@ fun Generics::remove_u64($t0|a: address): Generics::R { 6: trace_abort($t3) 7: goto 16 8: label L3 - 9: modifies global>($t0) + 9: modifies global<0x42::Generics::R>($t0) 10: assume WellFormed($t1) - 11: assume Not(exists>($t0)) + 11: assume Not(exists<0x42::Generics::R>($t0)) 12: $t1 := opaque end: Generics::remove($t0) 13: label L1 # VC: post-condition does not hold at tests/spec_instrumentation/generics.move:20:9+25 - 14: assert Not(exists>($t0)) + 14: assert Not(exists<0x42::Generics::R>($t0)) 15: return $t1 16: label L2 17: abort($t3) @@ -71,24 +71,24 @@ fun Generics::remove_u64($t0|a: address): Generics::R { fun Generics::remove[baseline] spec { - modifies global>($t0); - ensures Not(exists>($t0)); + modifies global<0x42::Generics::R<#0>>($t0); + ensures Not(exists<0x42::Generics::R<#0>>($t0)); } fun Generics::remove[verification] spec { - modifies global>($t0); - ensures Not(exists>($t0)); + modifies global<0x42::Generics::R<#0>>($t0); + ensures Not(exists<0x42::Generics::R<#0>>($t0)); } fun Generics::remove_u64[baseline] spec { - modifies global>($t0); - ensures Not(exists>($t0)); + modifies global<0x42::Generics::R>($t0); + ensures Not(exists<0x42::Generics::R>($t0)); } fun Generics::remove_u64[verification] spec { - modifies global>($t0); - ensures Not(exists>($t0)); + modifies global<0x42::Generics::R>($t0); + ensures Not(exists<0x42::Generics::R>($t0)); } diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/modifies.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/modifies.v2_exp index a1b6c4102f2f2..f080a52177174 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/modifies.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/modifies.v2_exp @@ -2,18 +2,18 @@ [variant baseline] public fun A::mutate_at($t0|addr: address) { - var $t1|s: &mut A::S + var $t1|s: &mut 0x0::A::S var $t2: address - var $t3: &mut A::S + var $t3: &mut 0x0::A::S var $t4: u64 - var $t5: &mut A::S + var $t5: &mut 0x0::A::S var $t6: &mut u64 0: $t2 := move($t0) - 1: $t3 := borrow_global($t2) + 1: $t3 := borrow_global<0x0::A::S>($t2) 2: $t1 := $t3 3: $t4 := 2 4: $t5 := move($t1) - 5: $t6 := borrow_field.x($t5) + 5: $t6 := borrow_field<0x0::A::S>.x($t5) 6: write_ref($t6, $t4) 7: return () } @@ -22,34 +22,34 @@ public fun A::mutate_at($t0|addr: address) { [variant baseline] public fun A::read_at($t0|addr: address): u64 { var $t1: address - var $t2: &A::S + var $t2: &0x0::A::S var $t3: &u64 var $t4: u64 0: $t1 := move($t0) - 1: $t2 := borrow_global($t1) - 2: $t3 := borrow_field.x($t2) + 1: $t2 := borrow_global<0x0::A::S>($t1) + 2: $t3 := borrow_field<0x0::A::S>.x($t2) 3: $t4 := read_ref($t3) 4: return $t4 } [variant baseline] -public fun B::move_from_test_incorrect($t0|addr1: address, $t1|addr2: address): B::T { - var $t2|v: B::T +public fun B::move_from_test_incorrect($t0|addr1: address, $t1|addr2: address): 0x0::B::T { + var $t2|v: 0x0::B::T var $t3|x0: u64 var $t4|x1: u64 var $t5: address var $t6: u64 var $t7: address - var $t8: B::T + var $t8: 0x0::B::T var $t9: address var $t10: u64 - var $t11: B::T + var $t11: 0x0::B::T 0: $t5 := copy($t1) 1: $t6 := A::read_at($t5) 2: $t3 := $t6 3: $t7 := move($t0) - 4: $t8 := move_from($t7) + 4: $t8 := move_from<0x0::B::T>($t7) 5: $t2 := $t8 6: $t9 := move($t1) 7: $t10 := A::read_at($t9) @@ -68,7 +68,7 @@ public fun B::move_to_test_incorrect($t0|account: &signer, $t1|addr2: address) { var $t5: u64 var $t6: &signer var $t7: u64 - var $t8: B::T + var $t8: 0x0::B::T var $t9: address var $t10: u64 0: $t4 := copy($t1) @@ -76,8 +76,8 @@ public fun B::move_to_test_incorrect($t0|account: &signer, $t1|addr2: address) { 2: $t2 := $t5 3: $t6 := move($t0) 4: $t7 := 2 - 5: $t8 := pack B::T($t7) - 6: move_to($t8, $t6) + 5: $t8 := pack 0x0::B::T($t7) + 6: move_to<0x0::B::T>($t8, $t6) 7: $t9 := move($t1) 8: $t10 := A::read_at($t9) 9: $t3 := $t10 @@ -132,15 +132,15 @@ public fun B::mutate_S_test2_incorrect($t0|addr: address) { [variant baseline] public fun B::mutate_at_test_incorrect($t0|addr1: address, $t1|addr2: address) { - var $t2|t: &mut B::T + var $t2|t: &mut 0x0::B::T var $t3|x0: u64 var $t4|x1: u64 var $t5: address var $t6: u64 var $t7: address - var $t8: &mut B::T + var $t8: &mut 0x0::B::T var $t9: u64 - var $t10: &mut B::T + var $t10: &mut 0x0::B::T var $t11: &mut u64 var $t12: address var $t13: u64 @@ -148,11 +148,11 @@ public fun B::mutate_at_test_incorrect($t0|addr1: address, $t1|addr2: address) { 1: $t6 := A::read_at($t5) 2: $t3 := $t6 3: $t7 := move($t0) - 4: $t8 := borrow_global($t7) + 4: $t8 := borrow_global<0x0::B::T>($t7) 5: $t2 := $t8 6: $t9 := 2 7: $t10 := move($t2) - 8: $t11 := borrow_field.x($t10) + 8: $t11 := borrow_field<0x0::B::T>.x($t10) 9: write_ref($t11, $t9) 10: $t12 := move($t1) 11: $t13 := A::read_at($t12) @@ -165,89 +165,89 @@ public fun B::mutate_at_test_incorrect($t0|addr1: address, $t1|addr2: address) { [variant verification] public fun A::mutate_at($t0|addr: address) { - var $t1|s: &mut A::S - var $t2: &mut A::S + var $t1|s: &mut 0x0::A::S + var $t2: &mut 0x0::A::S var $t3: num var $t4: u64 var $t5: &mut u64 - 0: assume CanModify($t0) + 0: assume CanModify<0x0::A::S>($t0) 1: @0 := save_mem(A::S) # VC: caller does not have permission to modify `A::S` at given address at tests/spec_instrumentation/modifies.move:18:17+17 - 2: assert CanModify($t0) - 3: $t2 := borrow_global($t0) on_abort goto 13 with $t3 + 2: assert CanModify<0x0::A::S>($t0) + 3: $t2 := borrow_global<0x0::A::S>($t0) on_abort goto 13 with $t3 4: $t4 := 2 - 5: $t5 := borrow_field.x($t2) + 5: $t5 := borrow_field<0x0::A::S>.x($t2) 6: write_ref($t5, $t4) 7: write_back[Reference($t2).x (u64)]($t5) - 8: write_back[A::S@]($t2) + 8: write_back[0x0::A::S@]($t2) 9: label L1 # VC: function does not abort under this condition at tests/spec_instrumentation/modifies.move:24:9+27 - 10: assert Not(Not(exists[@0]($t0))) + 10: assert Not(Not(exists[@0]<0x0::A::S>($t0))) # VC: post-condition does not hold at tests/spec_instrumentation/modifies.move:23:9+31 - 11: assert Eq(select A::S.x(global($t0)), 2) + 11: assert Eq(select A::S.x<0x0::A::S>(global<0x0::A::S>($t0)), 2) 12: return () 13: label L2 # VC: abort not covered by any of the `aborts_if` clauses at tests/spec_instrumentation/modifies.move:21:5+162 - 14: assert Not(exists[@0]($t0)) + 14: assert Not(exists[@0]<0x0::A::S>($t0)) 15: abort($t3) } [variant verification] public fun A::read_at($t0|addr: address): u64 { - var $t1: A::S + var $t1: 0x0::A::S var $t2: num var $t3: u64 0: @1 := save_mem(A::S) - 1: $t1 := get_global($t0) on_abort goto 7 with $t2 - 2: $t3 := get_field.x($t1) + 1: $t1 := get_global<0x0::A::S>($t0) on_abort goto 7 with $t2 + 2: $t3 := get_field<0x0::A::S>.x($t1) 3: label L1 # VC: function does not abort under this condition at tests/spec_instrumentation/modifies.move:13:9+27 - 4: assert Not(Not(exists[@1]($t0))) + 4: assert Not(Not(exists[@1]<0x0::A::S>($t0))) # VC: post-condition does not hold at tests/spec_instrumentation/modifies.move:14:9+36 - 5: assert Eq($t3, select A::S.x(global($t0))) + 5: assert Eq($t3, select A::S.x<0x0::A::S>(global<0x0::A::S>($t0))) 6: return $t3 7: label L2 # VC: abort not covered by any of the `aborts_if` clauses at tests/spec_instrumentation/modifies.move:11:5+131 - 8: assert Not(exists[@1]($t0)) + 8: assert Not(exists[@1]<0x0::A::S>($t0)) 9: abort($t2) } [variant verification] -public fun B::move_from_test_incorrect($t0|addr1: address, $t1|addr2: address): B::T { - var $t2|v: B::T +public fun B::move_from_test_incorrect($t0|addr1: address, $t1|addr2: address): 0x0::B::T { + var $t2|v: 0x0::B::T var $t3|x0: u64 var $t4|x1: u64 var $t5: u64 var $t6: bool var $t7: num - var $t8: B::T + var $t8: 0x0::B::T var $t9: u64 var $t10: bool - 0: assume CanModify($t1) + 0: assume CanModify<0x0::B::T>($t1) 1: $t5 := opaque begin: A::read_at($t1) - 2: assume Identical($t6, Not(exists($t1))) + 2: assume Identical($t6, Not(exists<0x0::A::S>($t1))) 3: if ($t6) goto 4 else goto 7 4: label L4 5: trace_abort($t7) 6: goto 26 7: label L3 8: assume WellFormed($t5) - 9: assume Eq($t5, select A::S.x(global($t1))) + 9: assume Eq($t5, select A::S.x<0x0::A::S>(global<0x0::A::S>($t1))) 10: $t5 := opaque end: A::read_at($t1) # VC: caller does not have permission to modify `B::T` at given address at tests/spec_instrumentation/modifies.move:65:17+9 - 11: assert CanModify($t0) - 12: $t8 := move_from($t0) on_abort goto 26 with $t7 + 11: assert CanModify<0x0::B::T>($t0) + 12: $t8 := move_from<0x0::B::T>($t0) on_abort goto 26 with $t7 13: $t9 := opaque begin: A::read_at($t1) - 14: assume Identical($t10, Not(exists($t1))) + 14: assume Identical($t10, Not(exists<0x0::A::S>($t1))) 15: if ($t10) goto 16 else goto 19 16: label L6 17: trace_abort($t7) 18: goto 26 19: label L5 20: assume WellFormed($t9) - 21: assume Eq($t9, select A::S.x(global($t1))) + 21: assume Eq($t9, select A::S.x<0x0::A::S>(global<0x0::A::S>($t1))) 22: $t9 := opaque end: A::read_at($t1) 23: assert Eq($t5, $t9) 24: label L1 @@ -265,34 +265,34 @@ public fun B::move_to_test_incorrect($t0|account: signer, $t1|addr2: address) { var $t5: bool var $t6: num var $t7: u64 - var $t8: B::T + var $t8: 0x0::B::T var $t9: u64 var $t10: bool - 0: assume CanModify($t1) + 0: assume CanModify<0x0::B::T>($t1) 1: $t4 := opaque begin: A::read_at($t1) - 2: assume Identical($t5, Not(exists($t1))) + 2: assume Identical($t5, Not(exists<0x0::A::S>($t1))) 3: if ($t5) goto 4 else goto 7 4: label L4 5: trace_abort($t6) 6: goto 28 7: label L3 8: assume WellFormed($t4) - 9: assume Eq($t4, select A::S.x(global($t1))) + 9: assume Eq($t4, select A::S.x<0x0::A::S>(global<0x0::A::S>($t1))) 10: $t4 := opaque end: A::read_at($t1) 11: $t7 := 2 - 12: $t8 := pack B::T($t7) + 12: $t8 := pack 0x0::B::T($t7) # VC: caller does not have permission to modify `B::T` at given address at tests/spec_instrumentation/modifies.move:52:9+7 - 13: assert CanModify($t0) - 14: move_to($t8, $t0) on_abort goto 28 with $t6 + 13: assert CanModify<0x0::B::T>($t0) + 14: move_to<0x0::B::T>($t8, $t0) on_abort goto 28 with $t6 15: $t9 := opaque begin: A::read_at($t1) - 16: assume Identical($t10, Not(exists($t1))) + 16: assume Identical($t10, Not(exists<0x0::A::S>($t1))) 17: if ($t10) goto 18 else goto 21 18: label L6 19: trace_abort($t6) 20: goto 28 21: label L5 22: assume WellFormed($t9) - 23: assume Eq($t9, select A::S.x(global($t1))) + 23: assume Eq($t9, select A::S.x<0x0::A::S>(global<0x0::A::S>($t1))) 24: $t9 := opaque end: A::read_at($t1) 25: assert Eq($t4, $t9) 26: label L1 @@ -313,38 +313,38 @@ public fun B::mutate_S_test1_incorrect($t0|addr1: address, $t1|addr2: address) { var $t8: u64 var $t9: bool 0: assume Neq
($t0, $t1) - 1: assume CanModify($t1) + 1: assume CanModify<0x0::A::S>($t1) 2: $t4 := opaque begin: A::read_at($t1) - 3: assume Identical($t5, Not(exists($t1))) + 3: assume Identical($t5, Not(exists<0x0::A::S>($t1))) 4: if ($t5) goto 5 else goto 8 5: label L4 6: trace_abort($t6) 7: goto 36 8: label L3 9: assume WellFormed($t4) - 10: assume Eq($t4, select A::S.x(global($t1))) + 10: assume Eq($t4, select A::S.x<0x0::A::S>(global<0x0::A::S>($t1))) 11: $t4 := opaque end: A::read_at($t1) # VC: caller does not have permission to modify `A::S` at given address at tests/spec_instrumentation/modifies.move:79:9+19 - 12: assert CanModify($t0) + 12: assert CanModify<0x0::A::S>($t0) 13: opaque begin: A::mutate_at($t0) - 14: assume Identical($t7, Not(exists($t0))) + 14: assume Identical($t7, Not(exists<0x0::A::S>($t0))) 15: if ($t7) goto 16 else goto 19 16: label L6 17: trace_abort($t6) 18: goto 36 19: label L5 - 20: modifies global($t0) - 21: assume Eq(select A::S.x(global($t0)), 2) + 20: modifies global<0x0::A::S>($t0) + 21: assume Eq(select A::S.x<0x0::A::S>(global<0x0::A::S>($t0)), 2) 22: opaque end: A::mutate_at($t0) 23: $t8 := opaque begin: A::read_at($t1) - 24: assume Identical($t9, Not(exists($t1))) + 24: assume Identical($t9, Not(exists<0x0::A::S>($t1))) 25: if ($t9) goto 26 else goto 29 26: label L8 27: trace_abort($t6) 28: goto 36 29: label L7 30: assume WellFormed($t8) - 31: assume Eq($t8, select A::S.x(global($t1))) + 31: assume Eq($t8, select A::S.x<0x0::A::S>(global<0x0::A::S>($t1))) 32: $t8 := opaque end: A::read_at($t1) 33: assert Eq($t4, $t8) 34: label L1 @@ -364,38 +364,38 @@ public fun B::mutate_S_test2_incorrect($t0|addr: address) { var $t6: bool var $t7: u64 var $t8: bool - 0: assume CanModify($t0) + 0: assume CanModify<0x0::A::S>($t0) 1: $t3 := opaque begin: A::read_at($t0) - 2: assume Identical($t4, Not(exists($t0))) + 2: assume Identical($t4, Not(exists<0x0::A::S>($t0))) 3: if ($t4) goto 4 else goto 7 4: label L4 5: trace_abort($t5) 6: goto 35 7: label L3 8: assume WellFormed($t3) - 9: assume Eq($t3, select A::S.x(global($t0))) + 9: assume Eq($t3, select A::S.x<0x0::A::S>(global<0x0::A::S>($t0))) 10: $t3 := opaque end: A::read_at($t0) # VC: caller does not have permission to modify `A::S` at given address at tests/spec_instrumentation/modifies.move:92:9+18 - 11: assert CanModify($t0) + 11: assert CanModify<0x0::A::S>($t0) 12: opaque begin: A::mutate_at($t0) - 13: assume Identical($t6, Not(exists($t0))) + 13: assume Identical($t6, Not(exists<0x0::A::S>($t0))) 14: if ($t6) goto 15 else goto 18 15: label L6 16: trace_abort($t5) 17: goto 35 18: label L5 - 19: modifies global($t0) - 20: assume Eq(select A::S.x(global($t0)), 2) + 19: modifies global<0x0::A::S>($t0) + 20: assume Eq(select A::S.x<0x0::A::S>(global<0x0::A::S>($t0)), 2) 21: opaque end: A::mutate_at($t0) 22: $t7 := opaque begin: A::read_at($t0) - 23: assume Identical($t8, Not(exists($t0))) + 23: assume Identical($t8, Not(exists<0x0::A::S>($t0))) 24: if ($t8) goto 25 else goto 28 25: label L8 26: trace_abort($t5) 27: goto 35 28: label L7 29: assume WellFormed($t7) - 30: assume Eq($t7, select A::S.x(global($t0))) + 30: assume Eq($t7, select A::S.x<0x0::A::S>(global<0x0::A::S>($t0))) 31: $t7 := opaque end: A::read_at($t0) 32: assert Eq($t3, $t7) 33: label L1 @@ -407,45 +407,45 @@ public fun B::mutate_S_test2_incorrect($t0|addr: address) { [variant verification] public fun B::mutate_at_test_incorrect($t0|addr1: address, $t1|addr2: address) { - var $t2|t: &mut B::T + var $t2|t: &mut 0x0::B::T var $t3|x0: u64 var $t4|x1: u64 var $t5: u64 var $t6: bool var $t7: num - var $t8: &mut B::T + var $t8: &mut 0x0::B::T var $t9: u64 var $t10: &mut u64 var $t11: u64 var $t12: bool - 0: assume CanModify($t1) + 0: assume CanModify<0x0::B::T>($t1) 1: $t5 := opaque begin: A::read_at($t1) - 2: assume Identical($t6, Not(exists($t1))) + 2: assume Identical($t6, Not(exists<0x0::A::S>($t1))) 3: if ($t6) goto 4 else goto 7 4: label L4 5: trace_abort($t7) 6: goto 31 7: label L3 8: assume WellFormed($t5) - 9: assume Eq($t5, select A::S.x(global($t1))) + 9: assume Eq($t5, select A::S.x<0x0::A::S>(global<0x0::A::S>($t1))) 10: $t5 := opaque end: A::read_at($t1) # VC: caller does not have permission to modify `B::T` at given address at tests/spec_instrumentation/modifies.move:38:17+17 - 11: assert CanModify($t0) - 12: $t8 := borrow_global($t0) on_abort goto 31 with $t7 + 11: assert CanModify<0x0::B::T>($t0) + 12: $t8 := borrow_global<0x0::B::T>($t0) on_abort goto 31 with $t7 13: $t9 := 2 - 14: $t10 := borrow_field.x($t8) + 14: $t10 := borrow_field<0x0::B::T>.x($t8) 15: write_ref($t10, $t9) 16: write_back[Reference($t8).x (u64)]($t10) - 17: write_back[B::T@]($t8) + 17: write_back[0x0::B::T@]($t8) 18: $t11 := opaque begin: A::read_at($t1) - 19: assume Identical($t12, Not(exists($t1))) + 19: assume Identical($t12, Not(exists<0x0::A::S>($t1))) 20: if ($t12) goto 21 else goto 24 21: label L6 22: trace_abort($t7) 23: goto 31 24: label L5 25: assume WellFormed($t11) - 26: assume Eq($t11, select A::S.x(global($t1))) + 26: assume Eq($t11, select A::S.x<0x0::A::S>(global<0x0::A::S>($t1))) 27: $t11 := opaque end: A::read_at($t1) 28: assert Eq($t5, $t11) 29: label L1 @@ -460,33 +460,33 @@ public fun B::mutate_at_test_incorrect($t0|addr1: address, $t1|addr2: address) { fun A::mutate_at[baseline] spec { - ensures Eq(select A::S.x(global($t0)), 2); - aborts_if Not(exists($t0)); - modifies global($t0); + ensures Eq(select A::S.x<0x0::A::S>(global<0x0::A::S>($t0)), 2); + aborts_if Not(exists<0x0::A::S>($t0)); + modifies global<0x0::A::S>($t0); } fun A::mutate_at[verification] spec { - ensures Eq(select A::S.x(global($t0)), 2); - aborts_if Not(exists($t0)); - modifies global($t0); + ensures Eq(select A::S.x<0x0::A::S>(global<0x0::A::S>($t0)), 2); + aborts_if Not(exists<0x0::A::S>($t0)); + modifies global<0x0::A::S>($t0); } fun A::read_at[baseline] spec { - aborts_if Not(exists($t0)); - ensures Eq(result0(), select A::S.x(global($t0))); + aborts_if Not(exists<0x0::A::S>($t0)); + ensures Eq(result0(), select A::S.x<0x0::A::S>(global<0x0::A::S>($t0))); } fun A::read_at[verification] spec { - aborts_if Not(exists($t0)); - ensures Eq(result0(), select A::S.x(global($t0))); + aborts_if Not(exists<0x0::A::S>($t0)); + ensures Eq(result0(), select A::S.x<0x0::A::S>(global<0x0::A::S>($t0))); } fun B::move_from_test_incorrect[baseline] spec { - modifies global($t1); + modifies global<0x0::B::T>($t1); } 9 -> spec { assert Eq($t3, $t4); @@ -495,7 +495,7 @@ spec { fun B::move_from_test_incorrect[verification] spec { - modifies global($t1); + modifies global<0x0::B::T>($t1); } 9 -> spec { assert Eq($t3, $t4); @@ -504,7 +504,7 @@ spec { fun B::move_to_test_incorrect[baseline] spec { - modifies global($t1); + modifies global<0x0::B::T>($t1); } 10 -> spec { assert Eq($t2, $t3); @@ -513,7 +513,7 @@ spec { fun B::move_to_test_incorrect[verification] spec { - modifies global($t1); + modifies global<0x0::B::T>($t1); } 10 -> spec { assert Eq($t2, $t3); @@ -523,7 +523,7 @@ spec { fun B::mutate_S_test1_incorrect[baseline] spec { requires Neq
($t0, $t1); - modifies global($t1); + modifies global<0x0::A::S>($t1); } 8 -> spec { assert Eq($t2, $t3); @@ -533,7 +533,7 @@ spec { fun B::mutate_S_test1_incorrect[verification] spec { requires Neq
($t0, $t1); - modifies global($t1); + modifies global<0x0::A::S>($t1); } 8 -> spec { assert Eq($t2, $t3); @@ -542,7 +542,7 @@ spec { fun B::mutate_S_test2_incorrect[baseline] spec { - modifies global($t0); + modifies global<0x0::A::S>($t0); } 8 -> spec { assert Eq($t1, $t2); @@ -551,7 +551,7 @@ spec { fun B::mutate_S_test2_incorrect[verification] spec { - modifies global($t0); + modifies global<0x0::A::S>($t0); } 8 -> spec { assert Eq($t1, $t2); @@ -560,7 +560,7 @@ spec { fun B::mutate_at_test_incorrect[baseline] spec { - modifies global($t1); + modifies global<0x0::B::T>($t1); } 13 -> spec { assert Eq($t3, $t4); @@ -569,7 +569,7 @@ spec { fun B::mutate_at_test_incorrect[verification] spec { - modifies global($t1); + modifies global<0x0::B::T>($t1); } 13 -> spec { assert Eq($t3, $t4); diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/opaque_call.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/opaque_call.v2_exp index 4d54e160f9f67..1ad51d37ed39f 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/opaque_call.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/spec_instrumentation/opaque_call.v2_exp @@ -2,27 +2,27 @@ [variant baseline] fun Test::get_and_incr($t0|addr: address): u64 { - var $t1|r: &mut Test::R + var $t1|r: &mut 0x42::Test::R var $t2|v: u64 var $t3: address var $t4: bool var $t5: bool var $t6: u64 var $t7: address - var $t8: &mut Test::R - var $t9: &mut Test::R + var $t8: &mut 0x42::Test::R + var $t9: &mut 0x42::Test::R var $t10: &u64 var $t11: u64 - var $t12: &mut Test::R + var $t12: &mut 0x42::Test::R var $t13: &u64 var $t14: u64 var $t15: u64 var $t16: u64 - var $t17: &mut Test::R + var $t17: &mut 0x42::Test::R var $t18: &mut u64 var $t19: u64 0: $t3 := copy($t0) - 1: $t4 := exists($t3) + 1: $t4 := exists<0x42::Test::R>($t3) 2: $t5 := !($t4) 3: if ($t5) goto 4 else goto 7 4: label L1 @@ -30,19 +30,19 @@ fun Test::get_and_incr($t0|addr: address): u64 { 6: abort($t6) 7: label L0 8: $t7 := move($t0) - 9: $t8 := borrow_global($t7) + 9: $t8 := borrow_global<0x42::Test::R>($t7) 10: $t1 := $t8 11: $t9 := copy($t1) - 12: $t10 := borrow_field.v($t9) + 12: $t10 := borrow_field<0x42::Test::R>.v($t9) 13: $t11 := read_ref($t10) 14: $t2 := $t11 15: $t12 := copy($t1) - 16: $t13 := borrow_field.v($t12) + 16: $t13 := borrow_field<0x42::Test::R>.v($t12) 17: $t14 := read_ref($t13) 18: $t15 := 1 19: $t16 := +($t14, $t15) 20: $t17 := move($t1) - 21: $t18 := borrow_field.v($t17) + 21: $t18 := borrow_field<0x42::Test::R>.v($t17) 22: write_ref($t18, $t16) 23: $t19 := move($t2) 24: return $t19 @@ -68,22 +68,22 @@ fun Test::incr_twice() { [variant verification] fun Test::get_and_incr($t0|addr: address): u64 { - var $t1|r: &mut Test::R + var $t1|r: &mut 0x42::Test::R var $t2|v: u64 var $t3: bool var $t4: bool var $t5: u64 var $t6: num - var $t7: &mut Test::R + var $t7: &mut 0x42::Test::R var $t8: u64 var $t9: u64 var $t10: u64 var $t11: u64 var $t12: &mut u64 0: assume Neq
($t0, 0x0) - 1: assume CanModify($t0) + 1: assume CanModify<0x42::Test::R>($t0) 2: @0 := save_mem(Test::R) - 3: $t3 := exists($t0) + 3: $t3 := exists<0x42::Test::R>($t0) 4: $t4 := !($t3) 5: if ($t4) goto 6 else goto 10 6: label L1 @@ -92,31 +92,31 @@ fun Test::get_and_incr($t0|addr: address): u64 { 9: goto 27 10: label L0 # VC: caller does not have permission to modify `Test::R` at given address at tests/spec_instrumentation/opaque_call.move:8:14+17 - 11: assert CanModify($t0) - 12: $t7 := borrow_global($t0) on_abort goto 27 with $t6 - 13: $t8 := get_field.v($t7) - 14: $t9 := get_field.v($t7) + 11: assert CanModify<0x42::Test::R>($t0) + 12: $t7 := borrow_global<0x42::Test::R>($t0) on_abort goto 27 with $t6 + 13: $t8 := get_field<0x42::Test::R>.v($t7) + 14: $t9 := get_field<0x42::Test::R>.v($t7) 15: $t10 := 1 16: $t11 := +($t9, $t10) on_abort goto 27 with $t6 - 17: $t12 := borrow_field.v($t7) + 17: $t12 := borrow_field<0x42::Test::R>.v($t7) 18: write_ref($t12, $t11) 19: write_back[Reference($t7).v (u64)]($t12) - 20: write_back[Test::R@]($t7) + 20: write_back[0x42::Test::R@]($t7) 21: label L2 # VC: function does not abort under this condition at tests/spec_instrumentation/opaque_call.move:16:6+35 - 22: assert Not(Not(exists[@0]($t0))) + 22: assert Not(Not(exists[@0]<0x42::Test::R>($t0))) # VC: function does not abort under this condition at tests/spec_instrumentation/opaque_call.move:17:6+56 - 23: assert Not(Ge(Add(select Test::R.v(global[@0]($t0)), 1), 18446744073709551615)) + 23: assert Not(Ge(Add(select Test::R.v<0x42::Test::R>(global[@0]<0x42::Test::R>($t0)), 1), 18446744073709551615)) # VC: post-condition does not hold at tests/spec_instrumentation/opaque_call.move:19:6+56 - 24: assert Eq(select Test::R.v(global($t0)), Add(select Test::R.v(global[@0]($t0)), 1)) + 24: assert Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0)), Add(select Test::R.v<0x42::Test::R>(global[@0]<0x42::Test::R>($t0)), 1)) # VC: post-condition does not hold at tests/spec_instrumentation/opaque_call.move:20:6+36 - 25: assert Eq($t8, select Test::R.v(global($t0))) + 25: assert Eq($t8, select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0))) 26: return $t8 27: label L3 # VC: abort not covered by any of the `aborts_if` clauses at tests/spec_instrumentation/opaque_call.move:13:2+308 - 28: assert Or(Not(exists[@0]($t0)), Ge(Add(select Test::R.v(global[@0]($t0)), 1), 18446744073709551615)) + 28: assert Or(Not(exists[@0]<0x42::Test::R>($t0)), Ge(Add(select Test::R.v<0x42::Test::R>(global[@0]<0x42::Test::R>($t0)), 1), 18446744073709551615)) # VC: abort code not covered by any of the `aborts_if` or `aborts_with` clauses at tests/spec_instrumentation/opaque_call.move:13:2+308 - 29: assert Or(And(Not(exists[@0]($t0)), Eq(33, $t6)), Ge(Add(select Test::R.v(global[@0]($t0)), 1), 18446744073709551615)) + 29: assert Or(And(Not(exists[@0]<0x42::Test::R>($t0)), Eq(33, $t6)), Ge(Add(select Test::R.v<0x42::Test::R>(global[@0]<0x42::Test::R>($t0)), 1), 18446744073709551615)) 30: abort($t6) } @@ -135,49 +135,49 @@ fun Test::incr_twice() { # VC: precondition does not hold at this call at tests/spec_instrumentation/opaque_call.move:15:6+22 2: assert Neq
($t0, 0x0) 3: $t1 := opaque begin: Test::get_and_incr($t0) - 4: assume Identical($t2, Or(Not(exists($t0)), Ge(Add(select Test::R.v(global($t0)), 1), 18446744073709551615))) + 4: assume Identical($t2, Or(Not(exists<0x42::Test::R>($t0)), Ge(Add(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0)), 1), 18446744073709551615))) 5: if ($t2) goto 6 else goto 10 6: label L4 - 7: assume Or(And(Not(exists($t0)), Eq(33, $t3)), Ge(Add(select Test::R.v(global($t0)), 1), 18446744073709551615)) + 7: assume Or(And(Not(exists<0x42::Test::R>($t0)), Eq(33, $t3)), Ge(Add(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0)), 1), 18446744073709551615)) 8: trace_abort($t3) 9: goto 39 10: label L3 11: @2 := save_mem(Test::R) - 12: modifies global($t0) + 12: modifies global<0x42::Test::R>($t0) 13: assume WellFormed($t1) - 14: assume Eq(select Test::R.v(global($t0)), Add(select Test::R.v(global[@2]($t0)), 1)) - 15: assume Eq($t1, select Test::R.v(global($t0))) + 14: assume Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0)), Add(select Test::R.v<0x42::Test::R>(global[@2]<0x42::Test::R>($t0)), 1)) + 15: assume Eq($t1, select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0))) 16: $t1 := opaque end: Test::get_and_incr($t0) 17: drop($t1) 18: $t4 := 0x1 # VC: precondition does not hold at this call at tests/spec_instrumentation/opaque_call.move:15:6+22 19: assert Neq
($t4, 0x0) 20: $t5 := opaque begin: Test::get_and_incr($t4) - 21: assume Identical($t6, Or(Not(exists($t4)), Ge(Add(select Test::R.v(global($t4)), 1), 18446744073709551615))) + 21: assume Identical($t6, Or(Not(exists<0x42::Test::R>($t4)), Ge(Add(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t4)), 1), 18446744073709551615))) 22: if ($t6) goto 23 else goto 27 23: label L6 - 24: assume Or(And(Not(exists($t4)), Eq(33, $t3)), Ge(Add(select Test::R.v(global($t4)), 1), 18446744073709551615)) + 24: assume Or(And(Not(exists<0x42::Test::R>($t4)), Eq(33, $t3)), Ge(Add(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t4)), 1), 18446744073709551615)) 25: trace_abort($t3) 26: goto 39 27: label L5 28: @3 := save_mem(Test::R) - 29: modifies global($t4) + 29: modifies global<0x42::Test::R>($t4) 30: assume WellFormed($t5) - 31: assume Eq(select Test::R.v(global($t4)), Add(select Test::R.v(global[@3]($t4)), 1)) - 32: assume Eq($t5, select Test::R.v(global($t4))) + 31: assume Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t4)), Add(select Test::R.v<0x42::Test::R>(global[@3]<0x42::Test::R>($t4)), 1)) + 32: assume Eq($t5, select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t4))) 33: $t5 := opaque end: Test::get_and_incr($t4) 34: drop($t5) 35: label L1 # VC: function does not abort under this condition at tests/spec_instrumentation/opaque_call.move:28:6+35 - 36: assert Not(Not(exists[@1](0x1))) + 36: assert Not(Not(exists[@1]<0x42::Test::R>(0x1))) # VC: post-condition does not hold at tests/spec_instrumentation/opaque_call.move:29:6+56 - 37: assert Eq(select Test::R.v(global(0x1)), Add(select Test::R.v(global[@1](0x1)), 2)) + 37: assert Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>(0x1)), Add(select Test::R.v<0x42::Test::R>(global[@1]<0x42::Test::R>(0x1)), 2)) 38: return () 39: label L2 # VC: abort not covered by any of the `aborts_if` clauses at tests/spec_instrumentation/opaque_call.move:27:2+123 - 40: assert Not(exists[@1](0x1)) + 40: assert Not(exists[@1]<0x42::Test::R>(0x1)) # VC: abort code not covered by any of the `aborts_if` or `aborts_with` clauses at tests/spec_instrumentation/opaque_call.move:27:2+123 - 41: assert And(Not(exists[@1](0x1)), Eq(33, $t3)) + 41: assert And(Not(exists[@1]<0x42::Test::R>(0x1)), Eq(33, $t3)) 42: abort($t3) } @@ -188,31 +188,31 @@ fun Test::incr_twice() { fun Test::get_and_incr[baseline] spec { requires Neq
($t0, 0x0); - aborts_if Not(exists($t0)); - aborts_if Ge(Add(select Test::R.v(global($t0)), 1), 18446744073709551615); - modifies global($t0); - ensures Eq(select Test::R.v(global($t0)), Add(select Test::R.v(Old(global($t0))), 1)); - ensures Eq(result0(), select Test::R.v(global($t0))); + aborts_if Not(exists<0x42::Test::R>($t0)); + aborts_if Ge(Add(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0)), 1), 18446744073709551615); + modifies global<0x42::Test::R>($t0); + ensures Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0)), Add(select Test::R.v<0x42::Test::R>(Old<0x42::Test::R>(global<0x42::Test::R>($t0))), 1)); + ensures Eq(result0(), select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0))); } fun Test::get_and_incr[verification] spec { requires Neq
($t0, 0x0); - aborts_if Not(exists($t0)); - aborts_if Ge(Add(select Test::R.v(global($t0)), 1), 18446744073709551615); - modifies global($t0); - ensures Eq(select Test::R.v(global($t0)), Add(select Test::R.v(Old(global($t0))), 1)); - ensures Eq(result0(), select Test::R.v(global($t0))); + aborts_if Not(exists<0x42::Test::R>($t0)); + aborts_if Ge(Add(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0)), 1), 18446744073709551615); + modifies global<0x42::Test::R>($t0); + ensures Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0)), Add(select Test::R.v<0x42::Test::R>(Old<0x42::Test::R>(global<0x42::Test::R>($t0))), 1)); + ensures Eq(result0(), select Test::R.v<0x42::Test::R>(global<0x42::Test::R>($t0))); } fun Test::incr_twice[baseline] spec { - aborts_if Not(exists(0x1)); - ensures Eq(select Test::R.v(global(0x1)), Add(select Test::R.v(Old(global(0x1))), 2)); + aborts_if Not(exists<0x42::Test::R>(0x1)); + ensures Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>(0x1)), Add(select Test::R.v<0x42::Test::R>(Old<0x42::Test::R>(global<0x42::Test::R>(0x1))), 2)); } fun Test::incr_twice[verification] spec { - aborts_if Not(exists(0x1)); - ensures Eq(select Test::R.v(global(0x1)), Add(select Test::R.v(Old(global(0x1))), 2)); + aborts_if Not(exists<0x42::Test::R>(0x1)); + ensures Eq(select Test::R.v<0x42::Test::R>(global<0x42::Test::R>(0x1)), Add(select Test::R.v<0x42::Test::R>(Old<0x42::Test::R>(global<0x42::Test::R>(0x1))), 2)); } diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/verification_analysis/inv_relevance.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/verification_analysis/inv_relevance.v2_exp index 91d8e13b2fcfb..f197986ab70d2 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/verification_analysis/inv_relevance.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/verification_analysis/inv_relevance.v2_exp @@ -4,11 +4,11 @@ fun InvRelevance::inner<#0>($t0|s: &signer, $t1|t: #0) { var $t2: &signer var $t3: #0 - var $t4: InvRelevance::R<#0> + var $t4: 0x2::InvRelevance::R<#0> 0: $t2 := move($t0) 1: $t3 := move($t1) - 2: $t4 := pack InvRelevance::R<#0>($t3) - 3: move_to>($t4, $t2) + 2: $t4 := pack 0x2::InvRelevance::R<#0>($t3) + 3: move_to<0x2::InvRelevance::R<#0>>($t4, $t2) 4: return () } @@ -49,9 +49,9 @@ public fun InvRelevance::outer_u64($t0|s: &signer, $t1|t: u64) { [variant baseline] fun InvRelevance::inner<#0>($t0|s: signer, $t1|t: #0) { - var $t2: InvRelevance::R<#0> - 0: $t2 := pack InvRelevance::R<#0>($t1) - 1: move_to>($t2, $t0) + var $t2: 0x2::InvRelevance::R<#0> + 0: $t2 := pack 0x2::InvRelevance::R<#0>($t1) + 1: move_to<0x2::InvRelevance::R<#0>>($t2, $t0) 2: return () } diff --git a/third_party/move/move-prover/bytecode-pipeline/tests/verification_analysis/inv_suspension.v2_exp b/third_party/move/move-prover/bytecode-pipeline/tests/verification_analysis/inv_suspension.v2_exp index 5447894370b34..cdca820b4cb30 100644 --- a/third_party/move/move-prover/bytecode-pipeline/tests/verification_analysis/inv_suspension.v2_exp +++ b/third_party/move/move-prover/bytecode-pipeline/tests/verification_analysis/inv_suspension.v2_exp @@ -4,11 +4,11 @@ fun InvRelevance::inner<#0>($t0|s: &signer, $t1|t: #0) { var $t2: &signer var $t3: #0 - var $t4: InvRelevance::R<#0> + var $t4: 0x2::InvRelevance::R<#0> 0: $t2 := move($t0) 1: $t3 := move($t1) - 2: $t4 := pack InvRelevance::R<#0>($t3) - 3: move_to>($t4, $t2) + 2: $t4 := pack 0x2::InvRelevance::R<#0>($t3) + 3: move_to<0x2::InvRelevance::R<#0>>($t4, $t2) 4: return () } @@ -49,9 +49,9 @@ public fun InvRelevance::outer_u64($t0|s: &signer, $t1|t: u64) { [variant baseline] fun InvRelevance::inner<#0>($t0|s: signer, $t1|t: #0) { - var $t2: InvRelevance::R<#0> - 0: $t2 := pack InvRelevance::R<#0>($t1) - 1: move_to>($t2, $t0) + var $t2: 0x2::InvRelevance::R<#0> + 0: $t2 := pack 0x2::InvRelevance::R<#0>($t1) + 1: move_to<0x2::InvRelevance::R<#0>>($t2, $t0) 2: return () } diff --git a/third_party/move/tools/move-cli/tests/build_tests/disassemble_script/args.v2_exp b/third_party/move/tools/move-cli/tests/build_tests/disassemble_script/args.v2_exp index a9980b8444276..86cf2ad5118a2 100644 --- a/third_party/move/tools/move-cli/tests/build_tests/disassemble_script/args.v2_exp +++ b/third_party/move/tools/move-cli/tests/build_tests/disassemble_script/args.v2_exp @@ -5,11 +5,9 @@ script { main() /* def_idx: 0 */ { B0: - 0: Branch(3) + 0: Ret B1: 1: LdU64(0) 2: Abort -B2: - 3: Ret } }