Crate ink_env[][src]

Expand description

The ink_env utilities used to interoperate with the contract executor.

Mainly provides entities to work on a contract’s storage as well as high-level collections on top of those. Also provides environmental utilities, such as storage allocators, FFI to interface with FRAME contracts and a primitive blockchain emulator for simple off-chain testing.

Modules

Utilities to call or instantiate contracts on the chain.

Definitions and utilities for calling chain extension methods.

Provides type definitions and traits for the built-in cryptographic hashes.

Operations on the off-chain testing environment.

Macros

Appends a formatted string to the debug_message buffer which will be:

Appends a formatted string to the debug_message buffer, as per debug_print but with a newline appended.

Structs

The default environment AccountId type.

The default environment Hash type.

A fixed point representation of a number in the range [0, 1].

Information needed for rent calculations that can be requested by a contract.

Information about the required deposit and resulting rent.

The flags to indicate further information about the end of a contract execution.

Enums

The fundamental types of the default configuration.

Errors that can be encountered upon environmental interaction.

Placeholder for chains that have no defined chain extension.

Traits

The equivalent of Zero for hashes.

The environmental types usable by contracts defined with ink!.

Implemented by event types to guide the event topic serialization using the topics builder.

Functions

Returns the account ID of the executed contract.

Returns the balance of the executed contract.

Returns the current block number.

Returns the current block timestamp.

Returns the address of the caller of the executed contract.

Clears the contract’s storage key entry.

Appends the given message to the debug message buffer.

Returns the execution input to the executed contract and decodes it as T.

Recovers the compressed ECDSA public key for given signature and message_hash, and stores the result in output.

Emits an event with the given event data.

Evaluates a contract message and returns its result.

Returns the amount of gas left for the contract execution.

Returns the value stored under the given key in the contract’s storage if any.

Conducts the crypto hash of the given input and stores the result in output.

Conducts the crypto hash of the given encoded input and stores the result in output.

Instantiates another contract.

Invokes a contract message.

Returns the minimum balance that is required for creating an account.

Returns a random hash seed and the block number since which it was determinable by chain observers.

Returns the current rent allowance for the executed contract.

Returns information needed for rent calculations.

Returns information about the required deposit and resulting rent.

Restores a smart contract in tombstone state.

Returns the value back to the caller of the executed contract.

Writes the value to the contract storage under the given key.

Sets the rent allowance of the executed contract to the new value.

Terminates the existence of the currently executed smart contract without creating a tombstone.

Returns the tombstone deposit for the contracts chain.

Transfers value from the contract to the destination account ID.

Returns the transferred balance for the contract execution.

Returns the price for the specified amount of gas.

Type Definitions

A result of environmental operations.