Assessment reports>Initia>Threat Model>Module account.move

Module account.move

Function: create_account_script

This function is used by chain-external calls to create accounts of the base type.

Inputs

Full prototype: public entry fun create_account_script(addr: address)

  • addr: address

    • Validation: The account does not already exist.

    • Impact: The address of the new account that is created.

Function: create_account

This function is used by on-chain code to create new accounts.

Inputs

Full prototype: public fun create_account(addr: address): u64

  • addr: address

    • Validation: The account does not already exist.

    • Impact: The address of the new account that is created.

Function: create_table_account

This function is used internally by the standard library to create accounts for storing tables.

Inputs

Full prototype: public(friend) fun create_table_account(addr: address): u64

  • addr: address

    • Validation: The account does not already exist.

    • Impact: The address of the new account that is created.

Function: create_object_account

Internal function used by the standard library to create an account for holding the object.

Inputs

Full prototype: public(friend) fun create_object_account(addr: address): u64

  • addr: address

    • Validation: The account does not already exist, or if it exists, it is an object account.

    • Impact: The address of the new account that is created.

Function: exists_at

Checks if an account exists at an address.

Inputs

Full prototype: #[view] public fun exists_at(addr: address): bool

  • addr: address

    • Validation: None necessary.

    • Impact: The address is checked for the existence of an account.

Function: get_account_number

Gets the account number of an account.

Inputs

Full prototype: #[view] public fun get_account_number(addr: address): u64

  • addr: address

    • Validation: Checks that the account exists.

    • Impact: The address whose account is queried.

Function: get_sequence_number

Gets the sequence number of an account.

Inputs

Full prototype: #[view] public fun get_sequence_number(addr: address): u64

  • addr: address

    • Validation: Checks that the account exists.

    • Impact: The address whose account is queried.

Function: is_base_account

Checks if the address is a base account type. That is, not a table, object, or other special type of account.

Inputs

Full prototype: #[view] public fun is_base_account(addr: address): bool

  • addr: address

    • Validation: Checks that the account exists.

    • Impact: The address whose account is queried.

Function: is_object_account

Checks if the address is an object account type.

Inputs

Full prototype: #[view] public fun is_object_account(addr: address): bool

  • addr: address

    • Validation: Checks that the account exists.

    • Impact: The address whose account is queried.

Function: is_table_account

Checks if the address is an table account type.

Inputs

Full prototype: #[view] public fun is_table_account(addr: address): bool

  • addr: address

    • Validation: Checks that the account exists.

    • Impact: The address whose account is queried.

Function: is_module_account

Checks if the address is a module account type.

Inputs

Full prototype: #[view] public fun is_module_account(addr: address): bool

  • addr: address

    • Validation: Checks that the account exists.

    • Impact: The address whose account is queried.

Function: get_account_info

Calls the Cosmos get_account_info interface.

Inputs

Full prototype: native public fun get_account_info(addr: address): (bool /* found */, u64 /* account_number */, u64 /* sequence_number */, u8 /* account_type */)

  • addr: address

    • Validation: None necessary — error returned if not found.

    • Impact: The address whose data is queried.

Function: create_address

Parses an address from a u8 vector into an address type.

Inputs

Full prototype: native public(friend) fun create_address(bytes: vector<u8>): address

  • bytes: vector<u8>

    • Validation: The vector is of the correct length.

    • Impact: The bytes that are parsed into the address.

Function: create_signer

This internal function converts an address into a signer for non-base accounts.

Inputs

Full prototype: native public(friend) fun create_signer(addr: address): signer

  • addr: address

    • Validation: None.

    • Impact: The passed-in address is converted into a signer.

Zellic © 2024Back to top ↑