From 1acf51f0efc7a61d1e8b59fa86e9cd852fbf548c Mon Sep 17 00:00:00 2001 From: "Brian R. Murphy" <132495859+brmataptos@users.noreply.github.com> Date: Fri, 16 Jun 2023 10:53:51 -0700 Subject: [PATCH] Add docgen support for attributes (e.g., #[view]) (Issue #7932) (#8636) * Fix https://github.com/aptos-labs/aptos-core/issues/7932 Docgen should output attributes (#7932). Output attributes (e.g., #[view] or #[resource_group(scope = global)]) from docgen for move code. Currently only handles attibutes on Function, Script/Module, and Struct/Resource. Note that attributes are allowed on some other syntactic objects (address scope, use statement, const definition, spec), but how to format these usefully in docgen is unclear. for these in docgen is unclear. Also fix an unrelated bug discovered when adapting attribute_placement.move as a test of docgen: previously, only a single Module/Script per input file would be output in docgen. * Update move library docs with new docgen. --------- Co-authored-by: Brian R. Murphy GitOrigin-RevId: bea5520c277d8e57982798a36c6b60c5aa8bee00 --- aptos-framework/doc/account.md | 33 +++++--- aptos-framework/doc/aptos_account.md | 6 +- aptos-framework/doc/aptos_governance.md | 24 ++++-- aptos-framework/doc/block.md | 12 ++- aptos-framework/doc/chain_id.md | 6 +- aptos-framework/doc/chain_status.md | 6 +- aptos-framework/doc/coin.md | 51 +++++++---- aptos-framework/doc/delegation_pool.md | 33 +++++--- aptos-framework/doc/fungible_asset.md | 39 ++++++--- aptos-framework/doc/genesis.md | 6 +- aptos-framework/doc/multisig_account.md | 36 +++++--- aptos-framework/doc/object.md | 6 +- aptos-framework/doc/primary_fungible_store.md | 18 ++-- aptos-framework/doc/stake.md | 36 +++++--- aptos-framework/doc/staking_contract.md | 42 ++++++---- aptos-framework/doc/timestamp.md | 6 +- aptos-framework/doc/vesting.md | 84 ++++++++++++------- aptos-framework/doc/voting.md | 66 ++++++++++----- aptos-stdlib/doc/math128.md | 3 +- aptos-stdlib/doc/math64.md | 3 +- aptos-stdlib/doc/math_fixed.md | 3 +- aptos-stdlib/doc/math_fixed64.md | 3 +- aptos-stdlib/doc/string_utils.md | 3 +- aptos-stdlib/doc/type_info.md | 9 +- aptos-token-objects/doc/aptos_token.md | 24 ++++-- aptos-token-objects/doc/collection.md | 24 ++++-- aptos-token-objects/doc/property_map.md | 3 +- aptos-token-objects/doc/royalty.md | 3 +- aptos-token-objects/doc/token.md | 24 ++++-- aptos-token/doc/token.md | 6 +- move-stdlib/doc/vector.md | 24 ++++-- 31 files changed, 428 insertions(+), 214 deletions(-) diff --git a/aptos-framework/doc/account.md b/aptos-framework/doc/account.md index fb6fc9b70..e19645730 100644 --- a/aptos-framework/doc/account.md +++ b/aptos-framework/doc/account.md @@ -936,7 +936,8 @@ is returned. This way, the caller of this function can publish additional resour -
public fun exists_at(addr: address): bool
+
#[view]
+public fun exists_at(addr: address): bool
 
@@ -960,7 +961,8 @@ is returned. This way, the caller of this function can publish additional resour -
public fun get_guid_next_creation_num(addr: address): u64
+
#[view]
+public fun get_guid_next_creation_num(addr: address): u64
 
@@ -984,7 +986,8 @@ is returned. This way, the caller of this function can publish additional resour -
public fun get_sequence_number(addr: address): u64
+
#[view]
+public fun get_sequence_number(addr: address): u64
 
@@ -1039,7 +1042,8 @@ is returned. This way, the caller of this function can publish additional resour -
public fun get_authentication_key(addr: address): vector<u8>
+
#[view]
+public fun get_authentication_key(addr: address): vector<u8>
 
@@ -1425,7 +1429,8 @@ to the account owner's signer capability). Returns true if the account at account_addr has a signer capability offer. -
public fun is_signer_capability_offered(account_addr: address): bool
+
#[view]
+public fun is_signer_capability_offered(account_addr: address): bool
 
@@ -1451,7 +1456,8 @@ Returns true if the account at account_addr has a signer capability Returns the address of the account that has a signer capability offer from the account at account_addr. -
public fun get_signer_capability_offer_for(account_addr: address): address
+
#[view]
+public fun get_signer_capability_offer_for(account_addr: address): address
 
@@ -2076,7 +2082,8 @@ The Account does not exist under the new address before creating the account. ### Function `get_guid_next_creation_num` -
public fun get_guid_next_creation_num(addr: address): u64
+
#[view]
+public fun get_guid_next_creation_num(addr: address): u64
 
@@ -2093,7 +2100,8 @@ The Account does not exist under the new address before creating the account. ### Function `get_sequence_number` -
public fun get_sequence_number(addr: address): u64
+
#[view]
+public fun get_sequence_number(addr: address): u64
 
@@ -2133,7 +2141,8 @@ The sequence_number of the Account is up to MAX_U64. ### Function `get_authentication_key` -
public fun get_authentication_key(addr: address): vector<u8>
+
#[view]
+public fun get_authentication_key(addr: address): vector<u8>
 
@@ -2427,7 +2436,8 @@ The authentication scheme is ED25519_SCHEME and MULTI_ED25519_SCHEME. ### Function `is_signer_capability_offered` -
public fun is_signer_capability_offered(account_addr: address): bool
+
#[view]
+public fun is_signer_capability_offered(account_addr: address): bool
 
@@ -2443,7 +2453,8 @@ The authentication scheme is ED25519_SCHEME and MULTI_ED25519_SCHEME. ### Function `get_signer_capability_offer_for` -
public fun get_signer_capability_offer_for(account_addr: address): address
+
#[view]
+public fun get_signer_capability_offer_for(account_addr: address): address
 
diff --git a/aptos-framework/doc/aptos_account.md b/aptos-framework/doc/aptos_account.md index 80fc8816f..f77fdac11 100644 --- a/aptos-framework/doc/aptos_account.md +++ b/aptos-framework/doc/aptos_account.md @@ -462,7 +462,8 @@ receive. By default, this returns true if an account has not explicitly set whether the can receive direct transfers. -
public fun can_receive_direct_coin_transfers(account: address): bool
+
#[view]
+public fun can_receive_direct_coin_transfers(account: address): bool
 
@@ -813,7 +814,8 @@ Check if the AptosCoin under the address existed. ### Function `can_receive_direct_coin_transfers` -
public fun can_receive_direct_coin_transfers(account: address): bool
+
#[view]
+public fun can_receive_direct_coin_transfers(account: address): bool
 
diff --git a/aptos-framework/doc/aptos_governance.md b/aptos-framework/doc/aptos_governance.md index 94ec6f5ae..c19ff2462 100644 --- a/aptos-framework/doc/aptos_governance.md +++ b/aptos-framework/doc/aptos_governance.md @@ -707,7 +707,8 @@ AptosGovernance. -
public fun get_voting_duration_secs(): u64
+
#[view]
+public fun get_voting_duration_secs(): u64
 
@@ -731,7 +732,8 @@ AptosGovernance. -
public fun get_min_voting_threshold(): u128
+
#[view]
+public fun get_min_voting_threshold(): u128
 
@@ -755,7 +757,8 @@ AptosGovernance. -
public fun get_required_proposer_stake(): u64
+
#[view]
+public fun get_required_proposer_stake(): u64
 
@@ -1289,7 +1292,8 @@ Return a signer for making changes to 0x1 as part of on-chain governance proposa -
public fun initialize_for_verification(aptos_framework: &signer, min_voting_threshold: u128, required_proposer_stake: u64, voting_duration_secs: u64)
+
#[verify_only]
+public fun initialize_for_verification(aptos_framework: &signer, min_voting_threshold: u128, required_proposer_stake: u64, voting_duration_secs: u64)
 
@@ -1432,7 +1436,8 @@ Address @aptos_framework must exist GovernanceConfig and GovernanceEvents. ### Function `get_voting_duration_secs` -
public fun get_voting_duration_secs(): u64
+
#[view]
+public fun get_voting_duration_secs(): u64
 
@@ -1448,7 +1453,8 @@ Address @aptos_framework must exist GovernanceConfig and GovernanceEvents. ### Function `get_min_voting_threshold` -
public fun get_min_voting_threshold(): u128
+
#[view]
+public fun get_min_voting_threshold(): u128
 
@@ -1464,7 +1470,8 @@ Address @aptos_framework must exist GovernanceConfig and GovernanceEvents. ### Function `get_required_proposer_stake` -
public fun get_required_proposer_stake(): u64
+
#[view]
+public fun get_required_proposer_stake(): u64
 
@@ -1993,7 +2000,8 @@ pool_address must exist in StakePool. ### Function `initialize_for_verification` -
public fun initialize_for_verification(aptos_framework: &signer, min_voting_threshold: u128, required_proposer_stake: u64, voting_duration_secs: u64)
+
#[verify_only]
+public fun initialize_for_verification(aptos_framework: &signer, min_voting_threshold: u128, required_proposer_stake: u64, voting_duration_secs: u64)
 
diff --git a/aptos-framework/doc/block.md b/aptos-framework/doc/block.md index fd19a25fc..5ed52b69e 100644 --- a/aptos-framework/doc/block.md +++ b/aptos-framework/doc/block.md @@ -320,7 +320,8 @@ Can only be called as part of the Aptos governance proposal process established Return epoch interval in seconds. -
public fun get_epoch_interval_secs(): u64
+
#[view]
+public fun get_epoch_interval_secs(): u64
 
@@ -425,7 +426,8 @@ The runtime always runs this before executing the transactions in a block. Get the current block height -
public fun get_current_block_height(): u64
+
#[view]
+public fun get_current_block_height(): u64
 
@@ -667,7 +669,8 @@ The BlockResource existed under the @aptos_framework. ### Function `get_epoch_interval_secs` -
public fun get_epoch_interval_secs(): u64
+
#[view]
+public fun get_epoch_interval_secs(): u64
 
@@ -710,7 +713,8 @@ The BlockResource existed under the @aptos_framework. ### Function `get_current_block_height` -
public fun get_current_block_height(): u64
+
#[view]
+public fun get_current_block_height(): u64
 
diff --git a/aptos-framework/doc/chain_id.md b/aptos-framework/doc/chain_id.md index 797c71457..3cd22f09a 100644 --- a/aptos-framework/doc/chain_id.md +++ b/aptos-framework/doc/chain_id.md @@ -82,7 +82,8 @@ Publish the chain ID id of this instance under the SystemAddresses Return the chain ID of this instance. -
public fun get(): u8
+
#[view]
+public fun get(): u8
 
@@ -135,7 +136,8 @@ Return the chain ID of this instance. ### Function `get` -
public fun get(): u8
+
#[view]
+public fun get(): u8
 
diff --git a/aptos-framework/doc/chain_status.md b/aptos-framework/doc/chain_status.md index 46219dbe6..4b91cf10f 100644 --- a/aptos-framework/doc/chain_status.md +++ b/aptos-framework/doc/chain_status.md @@ -114,7 +114,8 @@ Marks that genesis has finished. Helper function to determine if Aptos is in genesis state. -
public fun is_genesis(): bool
+
#[view]
+public fun is_genesis(): bool
 
@@ -141,7 +142,8 @@ the same as !is_gene Testing is_operating() is more frequent than is_genesis(). -
public fun is_operating(): bool
+
#[view]
+public fun is_operating(): bool
 
diff --git a/aptos-framework/doc/coin.md b/aptos-framework/doc/coin.md index 1dc3bd18f..7edc1cf7b 100644 --- a/aptos-framework/doc/coin.md +++ b/aptos-framework/doc/coin.md @@ -907,7 +907,8 @@ A helper function that returns the address of CoinType. Returns the balance of owner for provided CoinType. -
public fun balance<CoinType>(owner: address): u64
+
#[view]
+public fun balance<CoinType>(owner: address): u64
 
@@ -936,7 +937,8 @@ Returns the balance of owner for provided CoinType. Returns true if the type CoinType is an initialized coin. -
public fun is_coin_initialized<CoinType>(): bool
+
#[view]
+public fun is_coin_initialized<CoinType>(): bool
 
@@ -961,7 +963,8 @@ Returns true if the type CoinType is an initial Returns true if account_addr is registered to receive CoinType. -
public fun is_account_registered<CoinType>(account_addr: address): bool
+
#[view]
+public fun is_account_registered<CoinType>(account_addr: address): bool
 
@@ -986,7 +989,8 @@ Returns true if account_addr is registered to r Returns the name of the coin. -
public fun name<CoinType>(): string::String
+
#[view]
+public fun name<CoinType>(): string::String
 
@@ -1011,7 +1015,8 @@ Returns the name of the coin. Returns the symbol of the coin, usually a shorter version of the name. -
public fun symbol<CoinType>(): string::String
+
#[view]
+public fun symbol<CoinType>(): string::String
 
@@ -1038,7 +1043,8 @@ For example, if decimals equals 2, a balance of be displayed to a user as 5.05 (505 / 10 ** 2). -
public fun decimals<CoinType>(): u8
+
#[view]
+public fun decimals<CoinType>(): u8
 
@@ -1063,7 +1069,8 @@ be displayed to a user as 5.05 (505 / 10 ** 2). Returns the amount of coin in existence. -
public fun supply<CoinType>(): option::Option<u128>
+
#[view]
+public fun supply<CoinType>(): option::Option<u128>
 
@@ -1313,7 +1320,8 @@ Extracts the entire amount from the passed-in c Freeze a CoinStore to prevent transfers -
public entry fun freeze_coin_store<CoinType>(account_addr: address, _freeze_cap: &coin::FreezeCapability<CoinType>)
+
#[legacy_entry_fun]
+public entry fun freeze_coin_store<CoinType>(account_addr: address, _freeze_cap: &coin::FreezeCapability<CoinType>)
 
@@ -1342,7 +1350,8 @@ Freeze a CoinStore to prevent transfers Unfreeze a CoinStore to allow transfers -
public entry fun unfreeze_coin_store<CoinType>(account_addr: address, _freeze_cap: &coin::FreezeCapability<CoinType>)
+
#[legacy_entry_fun]
+public entry fun unfreeze_coin_store<CoinType>(account_addr: address, _freeze_cap: &coin::FreezeCapability<CoinType>)
 
@@ -2113,7 +2122,8 @@ Get address by reflection. ### Function `balance` -
public fun balance<CoinType>(owner: address): u64
+
#[view]
+public fun balance<CoinType>(owner: address): u64
 
@@ -2130,7 +2140,8 @@ Get address by reflection. ### Function `is_coin_initialized` -
public fun is_coin_initialized<CoinType>(): bool
+
#[view]
+public fun is_coin_initialized<CoinType>(): bool
 
@@ -2188,7 +2199,8 @@ Get address by reflection. ### Function `name` -
public fun name<CoinType>(): string::String
+
#[view]
+public fun name<CoinType>(): string::String
 
@@ -2204,7 +2216,8 @@ Get address by reflection. ### Function `symbol` -
public fun symbol<CoinType>(): string::String
+
#[view]
+public fun symbol<CoinType>(): string::String
 
@@ -2220,7 +2233,8 @@ Get address by reflection. ### Function `decimals` -
public fun decimals<CoinType>(): u8
+
#[view]
+public fun decimals<CoinType>(): u8
 
@@ -2236,7 +2250,8 @@ Get address by reflection. ### Function `supply` -
public fun supply<CoinType>(): option::Option<u128>
+
#[view]
+public fun supply<CoinType>(): option::Option<u128>
 
@@ -2403,7 +2418,8 @@ The value of zero_coin must be 0. ### Function `freeze_coin_store` -
public entry fun freeze_coin_store<CoinType>(account_addr: address, _freeze_cap: &coin::FreezeCapability<CoinType>)
+
#[legacy_entry_fun]
+public entry fun freeze_coin_store<CoinType>(account_addr: address, _freeze_cap: &coin::FreezeCapability<CoinType>)
 
@@ -2423,7 +2439,8 @@ The value of zero_coin must be 0. ### Function `unfreeze_coin_store` -
public entry fun unfreeze_coin_store<CoinType>(account_addr: address, _freeze_cap: &coin::FreezeCapability<CoinType>)
+
#[legacy_entry_fun]
+public entry fun unfreeze_coin_store<CoinType>(account_addr: address, _freeze_cap: &coin::FreezeCapability<CoinType>)
 
diff --git a/aptos-framework/doc/delegation_pool.md b/aptos-framework/doc/delegation_pool.md index 205790b4d..b96923272 100644 --- a/aptos-framework/doc/delegation_pool.md +++ b/aptos-framework/doc/delegation_pool.md @@ -738,7 +738,8 @@ Scaling factor of shares pools used within the delegation pool Return whether supplied address addr is owner of a delegation pool. -
public fun owner_cap_exists(addr: address): bool
+
#[view]
+public fun owner_cap_exists(addr: address): bool
 
@@ -763,7 +764,8 @@ Return whether supplied address addr is owner of a delegation pool. Return address of the delegation pool owned by owner or fail if there is none. -
public fun get_owned_pool_address(owner: address): address
+
#[view]
+public fun get_owned_pool_address(owner: address): address
 
@@ -789,7 +791,8 @@ Return address of the delegation pool owned by owner or fail if the Return whether a delegation pool exists at supplied address addr. -
public fun delegation_pool_exists(addr: address): bool
+
#[view]
+public fun delegation_pool_exists(addr: address): bool
 
@@ -814,7 +817,8 @@ Return whether a delegation pool exists at supplied address addr. Return the index of current observed lockup cycle on delegation pool pool_address. -
public fun observed_lockup_cycle(pool_address: address): u64
+
#[view]
+public fun observed_lockup_cycle(pool_address: address): u64
 
@@ -840,7 +844,8 @@ Return the index of current observed lockup cycle on delegation pool pool_ Return the operator commission percentage set on the delegation pool pool_address. -
public fun operator_commission_percentage(pool_address: address): u64
+
#[view]
+public fun operator_commission_percentage(pool_address: address): u64
 
@@ -866,7 +871,8 @@ Return the operator commission percentage set on the delegation pool pool_ Return the number of delegators owning active stake within pool_address. -
public fun shareholders_count_active_pool(pool_address: address): u64
+
#[view]
+public fun shareholders_count_active_pool(pool_address: address): u64
 
@@ -893,7 +899,8 @@ Return the stake amounts on pool_address in the different states: (active,inactive,pending_active,pending_inactive) -
public fun get_delegation_pool_stake(pool_address: address): (u64, u64, u64, u64)
+
#[view]
+public fun get_delegation_pool_stake(pool_address: address): (u64, u64, u64, u64)
 
@@ -920,7 +927,8 @@ Return whether the given delegator has any withdrawable stake. If they recently some stake and the stake pool's lockup cycle has not ended, their coins are not withdrawable yet. -
public fun get_pending_withdrawal(pool_address: address, delegator_address: address): (bool, u64)
+
#[view]
+public fun get_pending_withdrawal(pool_address: address, delegator_address: address): (bool, u64)
 
@@ -979,7 +987,8 @@ Return total stake owned by delegator_address within delegation poo in each of its individual states: (active,inactive,pending_inactive) -
public fun get_stake(pool_address: address, delegator_address: address): (u64, u64, u64)
+
#[view]
+public fun get_stake(pool_address: address, delegator_address: address): (u64, u64, u64)
 
@@ -1060,7 +1069,8 @@ for the rewards the remaining stake would have earned if active: extracted-fee = (amount - extracted-fee) * reward-rate% * (100% - operator-commission%) -
public fun get_add_stake_fee(pool_address: address, amount: u64): u64
+
#[view]
+public fun get_add_stake_fee(pool_address: address, amount: u64): u64
 
@@ -1097,7 +1107,8 @@ the delegation pool, implicitly its stake pool, in the special case the validator had gone inactive before its lockup expired. -
public fun can_withdraw_pending_inactive(pool_address: address): bool
+
#[view]
+public fun can_withdraw_pending_inactive(pool_address: address): bool
 
diff --git a/aptos-framework/doc/fungible_asset.md b/aptos-framework/doc/fungible_asset.md index 4116601a5..55018f171 100644 --- a/aptos-framework/doc/fungible_asset.md +++ b/aptos-framework/doc/fungible_asset.md @@ -81,7 +81,8 @@ metadata object can be any object that equipped with Supply has key +
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct Supply has key
 
@@ -115,7 +116,8 @@ metadata object can be any object that equipped with Metadata has key +
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct Metadata has key
 
@@ -171,7 +173,8 @@ Metadata of a Fungible asset The store object that holds fungible assets of a specific type associated with an account. -
struct FungibleStore has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct FungibleStore has key
 
@@ -210,7 +213,8 @@ The store object that holds fungible assets of a specific type associated with a -
struct FungibleAssetEvents has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct FungibleAssetEvents has key
 
@@ -854,7 +858,8 @@ This can only be called at object creation time as constructor_ref is only avail Get the current supply from the metadata object. -
public fun supply<T: key>(metadata: object::Object<T>): option::Option<u128>
+
#[view]
+public fun supply<T: key>(metadata: object::Object<T>): option::Option<u128>
 
@@ -885,7 +890,8 @@ Get the current supply from the metadata object. Get the maximum supply from the metadata object. -
public fun maximum<T: key>(metadata: object::Object<T>): option::Option<u128>
+
#[view]
+public fun maximum<T: key>(metadata: object::Object<T>): option::Option<u128>
 
@@ -916,7 +922,8 @@ Get the maximum supply from the metadata object. Get the name of the fungible asset from the metadata object. -
public fun name<T: key>(metadata: object::Object<T>): string::String
+
#[view]
+public fun name<T: key>(metadata: object::Object<T>): string::String
 
@@ -941,7 +948,8 @@ Get the name of the fungible asset from the metadata object. Get the symbol of the fungible asset from the metadata object. -
public fun symbol<T: key>(metadata: object::Object<T>): string::String
+
#[view]
+public fun symbol<T: key>(metadata: object::Object<T>): string::String
 
@@ -966,7 +974,8 @@ Get the symbol of the fungible asset from the metadata object. Get the decimals from the metadata object. -
public fun decimals<T: key>(metadata: object::Object<T>): u8
+
#[view]
+public fun decimals<T: key>(metadata: object::Object<T>): u8
 
@@ -991,7 +1000,8 @@ Get the decimals from the metadata object. Return whether the provided address has a store initialized. -
public fun store_exists(store: address): bool
+
#[view]
+public fun store_exists(store: address): bool
 
@@ -1041,7 +1051,8 @@ Return the underlying metadata object Return the underlying metadata object. -
public fun store_metadata<T: key>(store: object::Object<T>): object::Object<fungible_asset::Metadata>
+
#[view]
+public fun store_metadata<T: key>(store: object::Object<T>): object::Object<fungible_asset::Metadata>
 
@@ -1091,7 +1102,8 @@ Return the amount of a given fungible asset. Get the balance of a given store. -
public fun balance<T: key>(store: object::Object<T>): u64
+
#[view]
+public fun balance<T: key>(store: object::Object<T>): u64
 
@@ -1122,7 +1134,8 @@ Return whether a store is frozen. If the store has not been created, we default to returning false so deposits can be sent to it. -
public fun is_frozen<T: key>(store: object::Object<T>): bool
+
#[view]
+public fun is_frozen<T: key>(store: object::Object<T>): bool
 
diff --git a/aptos-framework/doc/genesis.md b/aptos-framework/doc/genesis.md index 90607e0d4..38011baa6 100644 --- a/aptos-framework/doc/genesis.md +++ b/aptos-framework/doc/genesis.md @@ -812,7 +812,8 @@ The last step of genesis. -
fun initialize_for_verification(gas_schedule: vector<u8>, chain_id: u8, initial_version: u64, consensus_config: vector<u8>, execution_config: vector<u8>, epoch_interval_microsecs: u64, minimum_stake: u64, maximum_stake: u64, recurring_lockup_duration_secs: u64, allow_validator_set_change: bool, rewards_rate: u64, rewards_rate_denominator: u64, voting_power_increase_limit: u64, aptos_framework: &signer, min_voting_threshold: u128, required_proposer_stake: u64, voting_duration_secs: u64, accounts: vector<genesis::AccountMap>, employee_vesting_start: u64, employee_vesting_period_duration: u64, employees: vector<genesis::EmployeeAccountMap>, validators: vector<genesis::ValidatorConfigurationWithCommission>)
+
#[verify_only]
+fun initialize_for_verification(gas_schedule: vector<u8>, chain_id: u8, initial_version: u64, consensus_config: vector<u8>, execution_config: vector<u8>, epoch_interval_microsecs: u64, minimum_stake: u64, maximum_stake: u64, recurring_lockup_duration_secs: u64, allow_validator_set_change: bool, rewards_rate: u64, rewards_rate_denominator: u64, voting_power_increase_limit: u64, aptos_framework: &signer, min_voting_threshold: u128, required_proposer_stake: u64, voting_duration_secs: u64, accounts: vector<genesis::AccountMap>, employee_vesting_start: u64, employee_vesting_period_duration: u64, employees: vector<genesis::EmployeeAccountMap>, validators: vector<genesis::ValidatorConfigurationWithCommission>)
 
@@ -895,7 +896,8 @@ The last step of genesis. ### Function `initialize_for_verification` -
fun initialize_for_verification(gas_schedule: vector<u8>, chain_id: u8, initial_version: u64, consensus_config: vector<u8>, execution_config: vector<u8>, epoch_interval_microsecs: u64, minimum_stake: u64, maximum_stake: u64, recurring_lockup_duration_secs: u64, allow_validator_set_change: bool, rewards_rate: u64, rewards_rate_denominator: u64, voting_power_increase_limit: u64, aptos_framework: &signer, min_voting_threshold: u128, required_proposer_stake: u64, voting_duration_secs: u64, accounts: vector<genesis::AccountMap>, employee_vesting_start: u64, employee_vesting_period_duration: u64, employees: vector<genesis::EmployeeAccountMap>, validators: vector<genesis::ValidatorConfigurationWithCommission>)
+
#[verify_only]
+fun initialize_for_verification(gas_schedule: vector<u8>, chain_id: u8, initial_version: u64, consensus_config: vector<u8>, execution_config: vector<u8>, epoch_interval_microsecs: u64, minimum_stake: u64, maximum_stake: u64, recurring_lockup_duration_secs: u64, allow_validator_set_change: bool, rewards_rate: u64, rewards_rate_denominator: u64, voting_power_increase_limit: u64, aptos_framework: &signer, min_voting_threshold: u128, required_proposer_stake: u64, voting_duration_secs: u64, accounts: vector<genesis::AccountMap>, employee_vesting_start: u64, employee_vesting_period_duration: u64, employees: vector<genesis::EmployeeAccountMap>, validators: vector<genesis::ValidatorConfigurationWithCommission>)
 
diff --git a/aptos-framework/doc/multisig_account.md b/aptos-framework/doc/multisig_account.md index fdfc38d0d..8d890f766 100644 --- a/aptos-framework/doc/multisig_account.md +++ b/aptos-framework/doc/multisig_account.md @@ -926,7 +926,8 @@ Transaction with specified id cannot be found. Return the multisig account's metadata. -
public fun metadata(multisig_account: address): simple_map::SimpleMap<string::String, vector<u8>>
+
#[view]
+public fun metadata(multisig_account: address): simple_map::SimpleMap<string::String, vector<u8>>
 
@@ -952,7 +953,8 @@ Return the number of signatures required to execute or execute-reject a transact multisig account. -
public fun num_signatures_required(multisig_account: address): u64
+
#[view]
+public fun num_signatures_required(multisig_account: address): u64
 
@@ -977,7 +979,8 @@ multisig account. Return a vector of all of the provided multisig account's owners. -
public fun owners(multisig_account: address): vector<address>
+
#[view]
+public fun owners(multisig_account: address): vector<address>
 
@@ -1002,7 +1005,8 @@ Return a vector of all of the provided multisig account's owners. Return the transaction with the given transaction id. -
public fun get_transaction(multisig_account: address, sequence_number: u64): multisig_account::MultisigTransaction
+
#[view]
+public fun get_transaction(multisig_account: address, sequence_number: u64): multisig_account::MultisigTransaction
 
@@ -1035,7 +1039,8 @@ Return the transaction with the given transaction id. Return all pending transactions. -
public fun get_pending_transactions(multisig_account: address): vector<multisig_account::MultisigTransaction>
+
#[view]
+public fun get_pending_transactions(multisig_account: address): vector<multisig_account::MultisigTransaction>
 
@@ -1068,7 +1073,8 @@ Return all pending transactions. Return the payload for the next transaction in the queue. -
public fun get_next_transaction_payload(multisig_account: address, provided_payload: vector<u8>): vector<u8>
+
#[view]
+public fun get_next_transaction_payload(multisig_account: address, provided_payload: vector<u8>): vector<u8>
 
@@ -1102,7 +1108,8 @@ Return the payload for the next transaction in the queue. Return true if the transaction with given transaction id can be executed now. -
public fun can_be_executed(multisig_account: address, sequence_number: u64): bool
+
#[view]
+public fun can_be_executed(multisig_account: address, sequence_number: u64): bool
 
@@ -1136,7 +1143,8 @@ Return true if the transaction with given transaction id can be executed now. Return true if the transaction with given transaction id can be officially rejected. -
public fun can_be_rejected(multisig_account: address, sequence_number: u64): bool
+
#[view]
+public fun can_be_rejected(multisig_account: address, sequence_number: u64): bool
 
@@ -1170,7 +1178,8 @@ Return true if the transaction with given transaction id can be officially rejec Return the predicted address for the next multisig account if created from the given creator address. -
public fun get_next_multisig_account_address(creator: address): address
+
#[view]
+public fun get_next_multisig_account_address(creator: address): address
 
@@ -1196,7 +1205,8 @@ Return the predicted address for the next multisig account if created from the g Return the id of the last transaction that was executed (successful or failed) or removed. -
public fun last_resolved_sequence_number(multisig_account: address): u64
+
#[view]
+public fun last_resolved_sequence_number(multisig_account: address): u64
 
@@ -1222,7 +1232,8 @@ Return the id of the last transaction that was executed (successful or failed) o Return the id of the next transaction created. -
public fun next_sequence_number(multisig_account: address): u64
+
#[view]
+public fun next_sequence_number(multisig_account: address): u64
 
@@ -1248,7 +1259,8 @@ Return the id of the next transaction created. Return a bool tuple indicating whether an owner has voted and if so, whether they voted yes or no. -
public fun vote(multisig_account: address, sequence_number: u64, owner: address): (bool, bool)
+
#[view]
+public fun vote(multisig_account: address, sequence_number: u64, owner: address): (bool, bool)
 
diff --git a/aptos-framework/doc/object.md b/aptos-framework/doc/object.md index 520ed1c93..99ceda65c 100644 --- a/aptos-framework/doc/object.md +++ b/aptos-framework/doc/object.md @@ -99,7 +99,8 @@ make it so that a reference to a global object can be returned from a function. The core of the object model that defines ownership, transferability, and events. -
struct ObjectCore has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct ObjectCore has key
 
@@ -146,7 +147,8 @@ The core of the object model that defines ownership, transferability, and events A shared resource group for storing object resources together in storage. -
struct ObjectGroup
+
#[resource_group(#[scope = global])]
+struct ObjectGroup
 
diff --git a/aptos-framework/doc/primary_fungible_store.md b/aptos-framework/doc/primary_fungible_store.md index d7b918098..b3666cc50 100644 --- a/aptos-framework/doc/primary_fungible_store.md +++ b/aptos-framework/doc/primary_fungible_store.md @@ -51,7 +51,8 @@ stores for users with deterministic addresses so that users can easily deposit/w assets. -
struct DeriveRefPod has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct DeriveRefPod has key
 
@@ -195,7 +196,8 @@ Create a primary store object to hold fungible asset for the given address. Get the address of the primary store for the given account. -
public fun primary_store_address<T: key>(owner: address, metadata: object::Object<T>): address
+
#[view]
+public fun primary_store_address<T: key>(owner: address, metadata: object::Object<T>): address
 
@@ -221,7 +223,8 @@ Get the address of the primary store for the given account. Get the primary store object for the given account. -
public fun primary_store<T: key>(owner: address, metadata: object::Object<T>): object::Object<fungible_asset::FungibleStore>
+
#[view]
+public fun primary_store<T: key>(owner: address, metadata: object::Object<T>): object::Object<fungible_asset::FungibleStore>
 
@@ -247,7 +250,8 @@ Get the primary store object for the given account. Return whether the given account's primary store exists. -
public fun primary_store_exists<T: key>(account: address, metadata: object::Object<T>): bool
+
#[view]
+public fun primary_store_exists<T: key>(account: address, metadata: object::Object<T>): bool
 
@@ -272,7 +276,8 @@ Return whether the given account's primary store exists. Get the balance of account's primary store. -
public fun balance<T: key>(account: address, metadata: object::Object<T>): u64
+
#[view]
+public fun balance<T: key>(account: address, metadata: object::Object<T>): u64
 
@@ -301,7 +306,8 @@ Get the balance of account's p Return whether the given account's primary store is frozen. -
public fun is_frozen<T: key>(account: address, metadata: object::Object<T>): bool
+
#[view]
+public fun is_frozen<T: key>(account: address, metadata: object::Object<T>): bool
 
diff --git a/aptos-framework/doc/stake.md b/aptos-framework/doc/stake.md index e838e2f4d..f829d2a58 100644 --- a/aptos-framework/doc/stake.md +++ b/aptos-framework/doc/stake.md @@ -1373,7 +1373,8 @@ Return the lockup expiration of the stake pool at pool_address. This will throw an error if there's no stake pool at pool_address. -
public fun get_lockup_secs(pool_address: address): u64
+
#[view]
+public fun get_lockup_secs(pool_address: address): u64
 
@@ -1400,7 +1401,8 @@ Return the remaining lockup of the stake pool at pool_address. This will throw an error if there's no stake pool at pool_address. -
public fun get_remaining_lockup_secs(pool_address: address): u64
+
#[view]
+public fun get_remaining_lockup_secs(pool_address: address): u64
 
@@ -1432,7 +1434,8 @@ Return the different stake amounts for pool_address (whether the va The returned amounts are for (active, inactive, pending_active, pending_inactive) stake respectively. -
public fun get_stake(pool_address: address): (u64, u64, u64, u64)
+
#[view]
+public fun get_stake(pool_address: address): (u64, u64, u64, u64)
 
@@ -1464,7 +1467,8 @@ The returned amounts are for (active, inactive, pending_active, pending_inactive Returns the validator's state. -
public fun get_validator_state(pool_address: address): u64
+
#[view]
+public fun get_validator_state(pool_address: address): u64
 
@@ -1499,7 +1503,8 @@ Return the voting power of the validator in the current epoch. This is the same as the validator's total active and pending_inactive stake. -
public fun get_current_epoch_voting_power(pool_address: address): u64
+
#[view]
+public fun get_current_epoch_voting_power(pool_address: address): u64
 
@@ -1533,7 +1538,8 @@ This is the same as the validator's total active and pending_inactive stake. Return the delegated voter of the validator at pool_address. -
public fun get_delegated_voter(pool_address: address): address
+
#[view]
+public fun get_delegated_voter(pool_address: address): address
 
@@ -1559,7 +1565,8 @@ Return the delegated voter of the validator at pool_address. Return the operator of the validator at pool_address. -
public fun get_operator(pool_address: address): address
+
#[view]
+public fun get_operator(pool_address: address): address
 
@@ -1610,7 +1617,8 @@ Return the pool address in owner_cap. Return the validator index for pool_address. -
public fun get_validator_index(pool_address: address): u64
+
#[view]
+public fun get_validator_index(pool_address: address): u64
 
@@ -1636,7 +1644,8 @@ Return the validator index for pool_address. Return the number of successful and failed proposals for the proposal at the given validator index. -
public fun get_current_epoch_proposal_counts(validator_index: u64): (u64, u64)
+
#[view]
+public fun get_current_epoch_proposal_counts(validator_index: u64): (u64, u64)
 
@@ -1663,7 +1672,8 @@ Return the number of successful and failed proposals for the proposal at the giv Return the validator's config. -
public fun get_validator_config(pool_address: address): (vector<u8>, vector<u8>, vector<u8>)
+
#[view]
+public fun get_validator_config(pool_address: address): (vector<u8>, vector<u8>, vector<u8>)
 
@@ -1689,7 +1699,8 @@ Return the validator's config. -
public fun stake_pool_exists(addr: address): bool
+
#[view]
+public fun stake_pool_exists(addr: address): bool
 
@@ -3695,7 +3706,8 @@ Returns validator's next epoch voting power, including pending_active, active, a ### Function `get_validator_state` -
public fun get_validator_state(pool_address: address): u64
+
#[view]
+public fun get_validator_state(pool_address: address): u64
 
diff --git a/aptos-framework/doc/staking_contract.md b/aptos-framework/doc/staking_contract.md index 3c64f4bf0..6b096895e 100644 --- a/aptos-framework/doc/staking_contract.md +++ b/aptos-framework/doc/staking_contract.md @@ -123,7 +123,8 @@ pool. -
struct StakingGroupContainer
+
#[resource_group(#[scope = module_])]
+struct StakingGroupContainer
 
@@ -333,7 +334,8 @@ pool. -
struct StakingGroupUpdateCommissionEvent has key
+
#[resource_group_member(#[group = 0x1::staking_contract::StakingGroupContainer])]
+struct StakingGroupUpdateCommissionEvent has key
 
@@ -849,7 +851,8 @@ operator. This errors out the staking contract with the provided staker and operator doesn't exist. -
public fun stake_pool_address(staker: address, operator: address): address
+
#[view]
+public fun stake_pool_address(staker: address, operator: address): address
 
@@ -879,7 +882,8 @@ for staking contract between the provided staker and operator. This errors out the staking contract with the provided staker and operator doesn't exist. -
public fun last_recorded_principal(staker: address, operator: address): u64
+
#[view]
+public fun last_recorded_principal(staker: address, operator: address): u64
 
@@ -909,7 +913,8 @@ between the provided staker and operator. This errors out the staking contract with the provided staker and operator doesn't exist. -
public fun commission_percentage(staker: address, operator: address): u64
+
#[view]
+public fun commission_percentage(staker: address, operator: address): u64
 
@@ -941,7 +946,8 @@ Return a tuple of three numbers: This errors out the staking contract with the provided staker and operator doesn't exist. -
public fun staking_contract_amounts(staker: address, operator: address): (u64, u64, u64)
+
#[view]
+public fun staking_contract_amounts(staker: address, operator: address): (u64, u64, u64)
 
@@ -971,7 +977,8 @@ Return the number of pending distributions (e.g. commission, withdrawals from st This errors out the staking contract with the provided staker and operator doesn't exist. -
public fun pending_distribution_counts(staker: address, operator: address): u64
+
#[view]
+public fun pending_distribution_counts(staker: address, operator: address): u64
 
@@ -998,7 +1005,8 @@ This errors out the staking contract with the provided staker and operator doesn Return true if the staking contract between the provided staker and operator exists. -
public fun staking_contract_exists(staker: address, operator: address): bool
+
#[view]
+public fun staking_contract_exists(staker: address, operator: address): bool
 
@@ -1944,7 +1952,8 @@ Create a new staking_contracts resource. ### Function `stake_pool_address` -
public fun stake_pool_address(staker: address, operator: address): address
+
#[view]
+public fun stake_pool_address(staker: address, operator: address): address
 
@@ -1960,7 +1969,8 @@ Create a new staking_contracts resource. ### Function `last_recorded_principal` -
public fun last_recorded_principal(staker: address, operator: address): u64
+
#[view]
+public fun last_recorded_principal(staker: address, operator: address): u64
 
@@ -1977,7 +1987,8 @@ Staking_contract exists the stacker/operator pair. ### Function `commission_percentage` -
public fun commission_percentage(staker: address, operator: address): u64
+
#[view]
+public fun commission_percentage(staker: address, operator: address): u64
 
@@ -1994,7 +2005,8 @@ Staking_contract exists the stacker/operator pair. ### Function `staking_contract_amounts` -
public fun staking_contract_amounts(staker: address, operator: address): (u64, u64, u64)
+
#[view]
+public fun staking_contract_amounts(staker: address, operator: address): (u64, u64, u64)
 
@@ -2015,7 +2027,8 @@ Staking_contract exists the stacker/operator pair. ### Function `pending_distribution_counts` -
public fun pending_distribution_counts(staker: address, operator: address): u64
+
#[view]
+public fun pending_distribution_counts(staker: address, operator: address): u64
 
@@ -2032,7 +2045,8 @@ Staking_contract exists the stacker/operator pair. ### Function `staking_contract_exists` -
public fun staking_contract_exists(staker: address, operator: address): bool
+
#[view]
+public fun staking_contract_exists(staker: address, operator: address): bool
 
diff --git a/aptos-framework/doc/timestamp.md b/aptos-framework/doc/timestamp.md index c00827692..fe4b42000 100644 --- a/aptos-framework/doc/timestamp.md +++ b/aptos-framework/doc/timestamp.md @@ -163,7 +163,8 @@ Updates the wall clock time by consensus. Requires VM privilege and will be invo Gets the current time in microseconds. -
public fun now_microseconds(): u64
+
#[view]
+public fun now_microseconds(): u64
 
@@ -188,7 +189,8 @@ Gets the current time in microseconds. Gets the current time in seconds. -
public fun now_seconds(): u64
+
#[view]
+public fun now_seconds(): u64
 
diff --git a/aptos-framework/doc/vesting.md b/aptos-framework/doc/vesting.md index 50f672f72..04eaa5b97 100644 --- a/aptos-framework/doc/vesting.md +++ b/aptos-framework/doc/vesting.md @@ -1148,7 +1148,8 @@ Return the address of the underlying stake pool (separate resource account) of t This errors out if the vesting contract with the provided address doesn't exist. -
public fun stake_pool_address(vesting_contract_address: address): address
+
#[view]
+public fun stake_pool_address(vesting_contract_address: address): address
 
@@ -1177,7 +1178,8 @@ Vesting will start at this time, and once a full period has passed, the first ve This errors out if the vesting contract with the provided address doesn't exist. -
public fun vesting_start_secs(vesting_contract_address: address): u64
+
#[view]
+public fun vesting_start_secs(vesting_contract_address: address): u64
 
@@ -1206,7 +1208,8 @@ Each vest is released after one full period has started, starting from the speci This errors out if the vesting contract with the provided address doesn't exist. -
public fun period_duration_secs(vesting_contract_address: address): u64
+
#[view]
+public fun period_duration_secs(vesting_contract_address: address): u64
 
@@ -1237,7 +1240,8 @@ according to the vesting schedule. This errors out if the vesting contract with the provided address doesn't exist. -
public fun remaining_grant(vesting_contract_address: address): u64
+
#[view]
+public fun remaining_grant(vesting_contract_address: address): u64
 
@@ -1266,7 +1270,8 @@ This is the same as the shareholder address by default and only different if it' This errors out if the vesting contract with the provided address doesn't exist. -
public fun beneficiary(vesting_contract_address: address, shareholder: address): address
+
#[view]
+public fun beneficiary(vesting_contract_address: address, shareholder: address): address
 
@@ -1294,7 +1299,8 @@ Return the percentage of accumulated rewards that is paid to the operator as com This errors out if the vesting contract with the provided address doesn't exist. -
public fun operator_commission_percentage(vesting_contract_address: address): u64
+
#[view]
+public fun operator_commission_percentage(vesting_contract_address: address): u64
 
@@ -1320,7 +1326,8 @@ This errors out if the vesting contract with the provided address doesn't exist. Return all the vesting contracts a given address is an admin of. -
public fun vesting_contracts(admin: address): vector<address>
+
#[view]
+public fun vesting_contracts(admin: address): vector<address>
 
@@ -1351,7 +1358,8 @@ Return the operator who runs the validator for the vesting contract. This errors out if the vesting contract with the provided address doesn't exist. -
public fun operator(vesting_contract_address: address): address
+
#[view]
+public fun operator(vesting_contract_address: address): address
 
@@ -1380,7 +1388,8 @@ pool. This errors out if the vesting contract with the provided address doesn't exist. -
public fun voter(vesting_contract_address: address): address
+
#[view]
+public fun voter(vesting_contract_address: address): address
 
@@ -1414,7 +1423,8 @@ So 268435456 = 0.0625. This errors out if the vesting contract with the provided address doesn't exist. -
public fun vesting_schedule(vesting_contract_address: address): vesting::VestingSchedule
+
#[view]
+public fun vesting_schedule(vesting_contract_address: address): vesting::VestingSchedule
 
@@ -1443,7 +1453,8 @@ This excludes any unpaid commission that the operator has not collected. This errors out if the vesting contract with the provided address doesn't exist. -
public fun total_accumulated_rewards(vesting_contract_address: address): u64
+
#[view]
+public fun total_accumulated_rewards(vesting_contract_address: address): u64
 
@@ -1476,7 +1487,8 @@ the beneficiary address instead of shareholder address. This errors out if the vesting contract with the provided address doesn't exist. -
public fun accumulated_rewards(vesting_contract_address: address, shareholder_or_beneficiary: address): u64
+
#[view]
+public fun accumulated_rewards(vesting_contract_address: address, shareholder_or_beneficiary: address): u64
 
@@ -1508,7 +1520,8 @@ This errors out if the vesting contract with the provided address doesn't exist. Return the list of all shareholders in the vesting contract. -
public fun shareholders(vesting_contract_address: address): vector<address>
+
#[view]
+public fun shareholders(vesting_contract_address: address): vector<address>
 
@@ -1540,7 +1553,8 @@ address is actually a shareholder address, just return the address back. This returns 0x0 if no shareholder is found for the given beneficiary / the address is not a shareholder itself. -
public fun shareholder(vesting_contract_address: address, shareholder_or_beneficiary: address): address
+
#[view]
+public fun shareholder(vesting_contract_address: address, shareholder_or_beneficiary: address): address
 
@@ -2708,7 +2722,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `stake_pool_address` -
public fun stake_pool_address(vesting_contract_address: address): address
+
#[view]
+public fun stake_pool_address(vesting_contract_address: address): address
 
@@ -2724,7 +2739,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `vesting_start_secs` -
public fun vesting_start_secs(vesting_contract_address: address): u64
+
#[view]
+public fun vesting_start_secs(vesting_contract_address: address): u64
 
@@ -2740,7 +2756,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `period_duration_secs` -
public fun period_duration_secs(vesting_contract_address: address): u64
+
#[view]
+public fun period_duration_secs(vesting_contract_address: address): u64
 
@@ -2756,7 +2773,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `remaining_grant` -
public fun remaining_grant(vesting_contract_address: address): u64
+
#[view]
+public fun remaining_grant(vesting_contract_address: address): u64
 
@@ -2772,7 +2790,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `beneficiary` -
public fun beneficiary(vesting_contract_address: address, shareholder: address): address
+
#[view]
+public fun beneficiary(vesting_contract_address: address, shareholder: address): address
 
@@ -2788,7 +2807,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `operator_commission_percentage` -
public fun operator_commission_percentage(vesting_contract_address: address): u64
+
#[view]
+public fun operator_commission_percentage(vesting_contract_address: address): u64
 
@@ -2804,7 +2824,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `vesting_contracts` -
public fun vesting_contracts(admin: address): vector<address>
+
#[view]
+public fun vesting_contracts(admin: address): vector<address>
 
@@ -2820,7 +2841,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `operator` -
public fun operator(vesting_contract_address: address): address
+
#[view]
+public fun operator(vesting_contract_address: address): address
 
@@ -2836,7 +2858,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `voter` -
public fun voter(vesting_contract_address: address): address
+
#[view]
+public fun voter(vesting_contract_address: address): address
 
@@ -2852,7 +2875,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `vesting_schedule` -
public fun vesting_schedule(vesting_contract_address: address): vesting::VestingSchedule
+
#[view]
+public fun vesting_schedule(vesting_contract_address: address): vesting::VestingSchedule
 
@@ -2868,7 +2892,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `total_accumulated_rewards` -
public fun total_accumulated_rewards(vesting_contract_address: address): u64
+
#[view]
+public fun total_accumulated_rewards(vesting_contract_address: address): u64
 
@@ -2904,7 +2929,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `accumulated_rewards` -
public fun accumulated_rewards(vesting_contract_address: address, shareholder_or_beneficiary: address): u64
+
#[view]
+public fun accumulated_rewards(vesting_contract_address: address, shareholder_or_beneficiary: address): u64
 
@@ -2920,7 +2946,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `shareholders` -
public fun shareholders(vesting_contract_address: address): vector<address>
+
#[view]
+public fun shareholders(vesting_contract_address: address): vector<address>
 
@@ -2936,7 +2963,8 @@ This address should be deterministic for the same admin and vesting contract cre ### Function `shareholder` -
public fun shareholder(vesting_contract_address: address, shareholder_or_beneficiary: address): address
+
#[view]
+public fun shareholder(vesting_contract_address: address, shareholder_or_beneficiary: address): address
 
diff --git a/aptos-framework/doc/voting.md b/aptos-framework/doc/voting.md index ef1e50db8..ca96fe6ae 100644 --- a/aptos-framework/doc/voting.md +++ b/aptos-framework/doc/voting.md @@ -1106,7 +1106,8 @@ there are more yes votes than no. If either of these conditions is not met, this Return the next unassigned proposal id -
public fun next_proposal_id<ProposalType: store>(voting_forum_address: address): u64
+
#[view]
+public fun next_proposal_id<ProposalType: store>(voting_forum_address: address): u64
 
@@ -1131,7 +1132,8 @@ Return the next unassigned proposal id -
public fun is_voting_closed<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
+
#[view]
+public fun is_voting_closed<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
 
@@ -1193,7 +1195,8 @@ Return the state of the proposal with given id. @return Proposal state as an enum value. -
public fun get_proposal_state<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
+
#[view]
+public fun get_proposal_state<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
 
@@ -1234,7 +1237,8 @@ Return the state of the proposal with given id. Return the proposal's creation time. -
public fun get_proposal_creation_secs<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
+
#[view]
+public fun get_proposal_creation_secs<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
 
@@ -1264,7 +1268,8 @@ Return the proposal's creation time. Return the proposal's expiration time. -
public fun get_proposal_expiration_secs<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
+
#[view]
+public fun get_proposal_expiration_secs<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
 
@@ -1294,7 +1299,8 @@ Return the proposal's expiration time. Return the proposal's execution hash. -
public fun get_execution_hash<ProposalType: store>(voting_forum_address: address, proposal_id: u64): vector<u8>
+
#[view]
+public fun get_execution_hash<ProposalType: store>(voting_forum_address: address, proposal_id: u64): vector<u8>
 
@@ -1324,7 +1330,8 @@ Return the proposal's execution hash. Return the proposal's minimum vote threshold -
public fun get_min_vote_threshold<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u128
+
#[view]
+public fun get_min_vote_threshold<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u128
 
@@ -1354,7 +1361,8 @@ Return the proposal's minimum vote threshold Return the proposal's early resolution minimum vote threshold (optionally set) -
public fun get_early_resolution_vote_threshold<ProposalType: store>(voting_forum_address: address, proposal_id: u64): option::Option<u128>
+
#[view]
+public fun get_early_resolution_vote_threshold<ProposalType: store>(voting_forum_address: address, proposal_id: u64): option::Option<u128>
 
@@ -1384,7 +1392,8 @@ Return the proposal's early resolution minimum vote threshold (optionally set) Return the proposal's current vote count (yes_votes, no_votes) -
public fun get_votes<ProposalType: store>(voting_forum_address: address, proposal_id: u64): (u128, u128)
+
#[view]
+public fun get_votes<ProposalType: store>(voting_forum_address: address, proposal_id: u64): (u128, u128)
 
@@ -1414,7 +1423,8 @@ Return the proposal's current vote count (yes_votes, no_votes) Return true if the governance proposal has already been resolved. -
public fun is_resolved<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
+
#[view]
+public fun is_resolved<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
 
@@ -1444,7 +1454,8 @@ Return true if the governance proposal has already been resolved. Return true if the multi-step governance proposal is in execution. -
public fun is_multi_step_proposal_in_execution<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
+
#[view]
+public fun is_multi_step_proposal_in_execution<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
 
@@ -1697,7 +1708,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `next_proposal_id` -
public fun next_proposal_id<ProposalType: store>(voting_forum_address: address): u64
+
#[view]
+public fun next_proposal_id<ProposalType: store>(voting_forum_address: address): u64
 
@@ -1713,7 +1725,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `is_voting_closed` -
public fun is_voting_closed<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
+
#[view]
+public fun is_voting_closed<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
 
@@ -1758,7 +1771,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `get_proposal_state` -
public fun get_proposal_state<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
+
#[view]
+public fun get_proposal_state<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
 
@@ -1790,7 +1804,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `get_proposal_creation_secs` -
public fun get_proposal_creation_secs<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
+
#[view]
+public fun get_proposal_creation_secs<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
 
@@ -1806,7 +1821,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `get_proposal_expiration_secs` -
public fun get_proposal_expiration_secs<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
+
#[view]
+public fun get_proposal_expiration_secs<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u64
 
@@ -1822,7 +1838,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `get_execution_hash` -
public fun get_execution_hash<ProposalType: store>(voting_forum_address: address, proposal_id: u64): vector<u8>
+
#[view]
+public fun get_execution_hash<ProposalType: store>(voting_forum_address: address, proposal_id: u64): vector<u8>
 
@@ -1838,7 +1855,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `get_min_vote_threshold` -
public fun get_min_vote_threshold<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u128
+
#[view]
+public fun get_min_vote_threshold<ProposalType: store>(voting_forum_address: address, proposal_id: u64): u128
 
@@ -1854,7 +1872,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `get_early_resolution_vote_threshold` -
public fun get_early_resolution_vote_threshold<ProposalType: store>(voting_forum_address: address, proposal_id: u64): option::Option<u128>
+
#[view]
+public fun get_early_resolution_vote_threshold<ProposalType: store>(voting_forum_address: address, proposal_id: u64): option::Option<u128>
 
@@ -1870,7 +1889,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `get_votes` -
public fun get_votes<ProposalType: store>(voting_forum_address: address, proposal_id: u64): (u128, u128)
+
#[view]
+public fun get_votes<ProposalType: store>(voting_forum_address: address, proposal_id: u64): (u128, u128)
 
@@ -1886,7 +1906,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `is_resolved` -
public fun is_resolved<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
+
#[view]
+public fun is_resolved<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
 
@@ -1917,7 +1938,8 @@ Return true if the voting period of the given proposal has already ended. ### Function `is_multi_step_proposal_in_execution` -
public fun is_multi_step_proposal_in_execution<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
+
#[view]
+public fun is_multi_step_proposal_in_execution<ProposalType: store>(voting_forum_address: address, proposal_id: u64): bool
 
diff --git a/aptos-stdlib/doc/math128.md b/aptos-stdlib/doc/math128.md index 14734913c..d6a83377c 100644 --- a/aptos-stdlib/doc/math128.md +++ b/aptos-stdlib/doc/math128.md @@ -421,7 +421,8 @@ For functions that approximate a value it's useful to test a value is close to the most correct value up to last digit -
fun assert_approx_the_same(x: u128, y: u128, precission: u128)
+
#[testonly]
+fun assert_approx_the_same(x: u128, y: u128, precission: u128)
 
diff --git a/aptos-stdlib/doc/math64.md b/aptos-stdlib/doc/math64.md index 2cc3dafb6..3e8d628be 100644 --- a/aptos-stdlib/doc/math64.md +++ b/aptos-stdlib/doc/math64.md @@ -376,7 +376,8 @@ For functions that approximate a value it's useful to test a value is close to the most correct value up to last digit -
fun assert_approx_the_same(x: u128, y: u128, precission: u64)
+
#[testonly]
+fun assert_approx_the_same(x: u128, y: u128, precission: u64)
 
diff --git a/aptos-stdlib/doc/math_fixed.md b/aptos-stdlib/doc/math_fixed.md index 3b877662f..2fc1bb6fe 100644 --- a/aptos-stdlib/doc/math_fixed.md +++ b/aptos-stdlib/doc/math_fixed.md @@ -304,7 +304,8 @@ For functions that approximate a value it's useful to test a value is close to the most correct value up to last digit -
fun assert_approx_the_same(x: u128, y: u128, precission: u128)
+
#[testonly]
+fun assert_approx_the_same(x: u128, y: u128, precission: u128)
 
diff --git a/aptos-stdlib/doc/math_fixed64.md b/aptos-stdlib/doc/math_fixed64.md index 7a250af28..cd972b701 100644 --- a/aptos-stdlib/doc/math_fixed64.md +++ b/aptos-stdlib/doc/math_fixed64.md @@ -299,7 +299,8 @@ For functions that approximate a value it's useful to test a value is close to the most correct value up to last digit -
fun assert_approx_the_same(x: u256, y: u256, precission: u128)
+
#[testonly]
+fun assert_approx_the_same(x: u256, y: u256, precission: u128)
 
diff --git a/aptos-stdlib/doc/string_utils.md b/aptos-stdlib/doc/string_utils.md index 60f2459b6..7c7923372 100644 --- a/aptos-stdlib/doc/string_utils.md +++ b/aptos-stdlib/doc/string_utils.md @@ -102,7 +102,8 @@ A module for formatting move values as strings. -
struct FakeCons<T, N> has copy, drop, store
+
#[testonly]
+struct FakeCons<T, N> has copy, drop, store
 
diff --git a/aptos-stdlib/doc/type_info.md b/aptos-stdlib/doc/type_info.md index 1846162aa..85fad0a2d 100644 --- a/aptos-stdlib/doc/type_info.md +++ b/aptos-stdlib/doc/type_info.md @@ -293,7 +293,8 @@ analysis of vector size dynamism. -
fun verify_type_of()
+
#[verify_only]
+fun verify_type_of()
 
@@ -325,7 +326,8 @@ analysis of vector size dynamism. -
fun verify_type_of_generic<T>()
+
#[verify_only]
+fun verify_type_of_generic<T>()
 
@@ -427,7 +429,8 @@ analysis of vector size dynamism. ### Function `verify_type_of_generic` -
fun verify_type_of_generic<T>()
+
#[verify_only]
+fun verify_type_of_generic<T>()
 
diff --git a/aptos-token-objects/doc/aptos_token.md b/aptos-token-objects/doc/aptos_token.md index 8e483e065..54c8cc83e 100644 --- a/aptos-token-objects/doc/aptos_token.md +++ b/aptos-token-objects/doc/aptos_token.md @@ -77,7 +77,8 @@ The key features are: Storage state for managing the no-code Collection. -
struct AptosCollection has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct AptosCollection has key
 
@@ -159,7 +160,8 @@ Storage state for managing the no-code Collection. Storage state for managing the no-code Token. -
struct AptosToken has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct AptosToken has key
 
@@ -553,7 +555,8 @@ With an existing collection, directly mint a soul bound token into the recipient -
public fun are_properties_mutable<T: key>(token: object::Object<T>): bool
+
#[view]
+public fun are_properties_mutable<T: key>(token: object::Object<T>): bool
 
@@ -578,7 +581,8 @@ With an existing collection, directly mint a soul bound token into the recipient -
public fun is_burnable<T: key>(token: object::Object<T>): bool
+
#[view]
+public fun is_burnable<T: key>(token: object::Object<T>): bool
 
@@ -602,7 +606,8 @@ With an existing collection, directly mint a soul bound token into the recipient -
public fun is_freezable_by_creator<T: key>(token: object::Object<T>): bool
+
#[view]
+public fun is_freezable_by_creator<T: key>(token: object::Object<T>): bool
 
@@ -626,7 +631,8 @@ With an existing collection, directly mint a soul bound token into the recipient -
public fun is_mutable_description<T: key>(token: object::Object<T>): bool
+
#[view]
+public fun is_mutable_description<T: key>(token: object::Object<T>): bool
 
@@ -650,7 +656,8 @@ With an existing collection, directly mint a soul bound token into the recipient -
public fun is_mutable_name<T: key>(token: object::Object<T>): bool
+
#[view]
+public fun is_mutable_name<T: key>(token: object::Object<T>): bool
 
@@ -674,7 +681,8 @@ With an existing collection, directly mint a soul bound token into the recipient -
public fun is_mutable_uri<T: key>(token: object::Object<T>): bool
+
#[view]
+public fun is_mutable_uri<T: key>(token: object::Object<T>): bool
 
diff --git a/aptos-token-objects/doc/collection.md b/aptos-token-objects/doc/collection.md index 4eefe2c26..ae8c94427 100644 --- a/aptos-token-objects/doc/collection.md +++ b/aptos-token-objects/doc/collection.md @@ -70,7 +70,8 @@ require adding the field original_name. Represents the common fields for a collection. -
struct Collection has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct Collection has key
 
@@ -181,7 +182,8 @@ Fixed supply tracker, this is useful for ensuring that a limited number of token and adding events and supply tracking to a collection. -
struct FixedSupply has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct FixedSupply has key
 
@@ -233,7 +235,8 @@ and adding events and supply tracking to a collection. Unlimited supply tracker, this is useful for adding events and supply tracking to a collection. -
struct UnlimitedSupply has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct UnlimitedSupply has key
 
@@ -887,7 +890,8 @@ Creates a MutatorRef, which gates the ability to mutate any fields that support Provides the count of the current selection if supply tracking is used -
public fun count<T: key>(collection: object::Object<T>): option::Option<u64>
+
#[view]
+public fun count<T: key>(collection: object::Object<T>): option::Option<u64>
 
@@ -922,7 +926,8 @@ Provides the count of the current selection if supply tracking is used -
public fun creator<T: key>(collection: object::Object<T>): address
+
#[view]
+public fun creator<T: key>(collection: object::Object<T>): address
 
@@ -946,7 +951,8 @@ Provides the count of the current selection if supply tracking is used -
public fun description<T: key>(collection: object::Object<T>): string::String
+
#[view]
+public fun description<T: key>(collection: object::Object<T>): string::String
 
@@ -970,7 +976,8 @@ Provides the count of the current selection if supply tracking is used -
public fun name<T: key>(collection: object::Object<T>): string::String
+
#[view]
+public fun name<T: key>(collection: object::Object<T>): string::String
 
@@ -994,7 +1001,8 @@ Provides the count of the current selection if supply tracking is used -
public fun uri<T: key>(collection: object::Object<T>): string::String
+
#[view]
+public fun uri<T: key>(collection: object::Object<T>): string::String
 
diff --git a/aptos-token-objects/doc/property_map.md b/aptos-token-objects/doc/property_map.md index 877591080..15f7a895a 100644 --- a/aptos-token-objects/doc/property_map.md +++ b/aptos-token-objects/doc/property_map.md @@ -64,7 +64,8 @@ A Map for typed key to value mapping, the contract using it should keep track of what keys are what types, and parse them accordingly. -
struct PropertyMap has drop, key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct PropertyMap has drop, key
 
diff --git a/aptos-token-objects/doc/royalty.md b/aptos-token-objects/doc/royalty.md index 9e2351b45..68635764b 100644 --- a/aptos-token-objects/doc/royalty.md +++ b/aptos-token-objects/doc/royalty.md @@ -40,7 +40,8 @@ Royalties are optional for a collection. Royalty percentage is calculated by (numerator / denominator) * 100% -
struct Royalty has copy, drop, key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct Royalty has copy, drop, key
 
diff --git a/aptos-token-objects/doc/token.md b/aptos-token-objects/doc/token.md index fe6671a10..0b2323768 100644 --- a/aptos-token-objects/doc/token.md +++ b/aptos-token-objects/doc/token.md @@ -58,7 +58,8 @@ token are: Represents the common fields to all tokens. -
struct Token has key
+
#[resource_group_member(#[group = 0x1::object::ObjectGroup])]
+struct Token has key
 
@@ -612,7 +613,8 @@ Extracts the tokens address from a BurnRef. -
public fun creator<T: key>(token: object::Object<T>): address
+
#[view]
+public fun creator<T: key>(token: object::Object<T>): address
 
@@ -636,7 +638,8 @@ Extracts the tokens address from a BurnRef. -
public fun collection_name<T: key>(token: object::Object<T>): string::String
+
#[view]
+public fun collection_name<T: key>(token: object::Object<T>): string::String
 
@@ -660,7 +663,8 @@ Extracts the tokens address from a BurnRef. -
public fun collection_object<T: key>(token: object::Object<T>): object::Object<collection::Collection>
+
#[view]
+public fun collection_object<T: key>(token: object::Object<T>): object::Object<collection::Collection>
 
@@ -684,7 +688,8 @@ Extracts the tokens address from a BurnRef. -
public fun description<T: key>(token: object::Object<T>): string::String
+
#[view]
+public fun description<T: key>(token: object::Object<T>): string::String
 
@@ -708,7 +713,8 @@ Extracts the tokens address from a BurnRef. -
public fun name<T: key>(token: object::Object<T>): string::String
+
#[view]
+public fun name<T: key>(token: object::Object<T>): string::String
 
@@ -732,7 +738,8 @@ Extracts the tokens address from a BurnRef. -
public fun uri<T: key>(token: object::Object<T>): string::String
+
#[view]
+public fun uri<T: key>(token: object::Object<T>): string::String
 
@@ -756,7 +763,8 @@ Extracts the tokens address from a BurnRef. -
public fun royalty<T: key>(token: object::Object<T>): option::Option<royalty::Royalty>
+
#[view]
+public fun royalty<T: key>(token: object::Object<T>): option::Option<royalty::Royalty>
 
diff --git a/aptos-token/doc/token.md b/aptos-token/doc/token.md index 3c1435ad9..f4c11b8ad 100644 --- a/aptos-token/doc/token.md +++ b/aptos-token/doc/token.md @@ -4150,7 +4150,8 @@ return if the tokendata's default properties is mutable with a token mutability return the collection mutation setting -
public fun get_collection_mutability_config(creator: address, collection_name: string::String): token::CollectionMutabilityConfig
+
#[view]
+public fun get_collection_mutability_config(creator: address, collection_name: string::String): token::CollectionMutabilityConfig
 
@@ -5958,7 +5959,8 @@ The length of name should less than MAX_NFT_NAME_LENGTH ### Function `get_collection_mutability_config` -
public fun get_collection_mutability_config(creator: address, collection_name: string::String): token::CollectionMutabilityConfig
+
#[view]
+public fun get_collection_mutability_config(creator: address, collection_name: string::String): token::CollectionMutabilityConfig
 
diff --git a/move-stdlib/doc/vector.md b/move-stdlib/doc/vector.md index 7b4578232..3c6ffb2f2 100644 --- a/move-stdlib/doc/vector.md +++ b/move-stdlib/doc/vector.md @@ -128,7 +128,8 @@ The length of the vectors are not equal. Create an empty vector. -
public fun empty<Element>(): vector<Element>
+
#[bytecode_instruction]
+public fun empty<Element>(): vector<Element>
 
@@ -151,7 +152,8 @@ Create an empty vector. Return the length of the vector. -
public fun length<Element>(v: &vector<Element>): u64
+
#[bytecode_instruction]
+public fun length<Element>(v: &vector<Element>): u64
 
@@ -175,7 +177,8 @@ Acquire an immutable reference to the ith element of the vector i
is out of bounds. -
public fun borrow<Element>(v: &vector<Element>, i: u64): &Element
+
#[bytecode_instruction]
+public fun borrow<Element>(v: &vector<Element>, i: u64): &Element
 
@@ -198,7 +201,8 @@ Aborts if i is out of bounds. Add element e to the end of the vector v. -
public fun push_back<Element>(v: &mut vector<Element>, e: Element)
+
#[bytecode_instruction]
+public fun push_back<Element>(v: &mut vector<Element>, e: Element)
 
@@ -222,7 +226,8 @@ Return a mutable reference to the ith element in the vector v Aborts if i is out of bounds. -
public fun borrow_mut<Element>(v: &mut vector<Element>, i: u64): &mut Element
+
#[bytecode_instruction]
+public fun borrow_mut<Element>(v: &mut vector<Element>, i: u64): &mut Element
 
@@ -246,7 +251,8 @@ Pop an element from the end of vector v. Aborts if v is empty. -
public fun pop_back<Element>(v: &mut vector<Element>): Element
+
#[bytecode_instruction]
+public fun pop_back<Element>(v: &mut vector<Element>): Element
 
@@ -270,7 +276,8 @@ Destroy the vector v. Aborts if v is not empty. -
public fun destroy_empty<Element>(v: vector<Element>)
+
#[bytecode_instruction]
+public fun destroy_empty<Element>(v: vector<Element>)
 
@@ -294,7 +301,8 @@ Swaps the elements at the ith and jth indices in the v Aborts if i or j is out of bounds. -
public fun swap<Element>(v: &mut vector<Element>, i: u64, j: u64)
+
#[bytecode_instruction]
+public fun swap<Element>(v: &mut vector<Element>, i: u64, j: u64)