Module elrond_wasm::types[][src]

Structs

An Address is just a H256 with a different name. Has a different ABI name than H256.

Helper structure for providing arguments to all SC call functions other than async_call_raw. It keeps argument lengths separately from the argument data itself. Argument data is concatenated into a single byte buffer.

A pointer type for heap allocation.

Simple wrapper around a boxed byte slice, but with a lot of optimized methods for manipulating it. The focus is on reducing code size rather improving speed.

Helps the callback macro expansion to perform callback name matching more efficiently. The current implementation hashes by callback name length, but in principle further optimizations are possible.

Temporary solution until gas costs of the managed version are reduced. Only contains logic for deserializing and for being used in the callback handling macros.

Flags concerning smart contract creation and upgrade. Currently always represented as a 2-byte bitfield.

Represents metadata for calling another contract. Can transform into either an async call, transfer call or other types of calls.

Thin wrapper around EsdtTokenPayment, which has different I/O behaviour:

Type that holds 32 bytes of data. Data is kept on the heap to keep wasm size low and avoid copies.

Structure that allows taking a variable number of arguments, but does nothing with them, not even deserialization.

A byte buffer managed by an external API.

Nested decode buffer based on a managed buffer. Uses the load/copy slice API to extract pieces of the managed buffer for deserialization.

A list of items that lives inside a managed buffer. Items can be either stored there in full (e.g. u32), or just via handle (e.g. BigUint<M>).

Argument or result that is made up of the argument count, followed by the arguments themselves. Think of it as a VarArgs preceded by the count. Unlike ManagedMultiResultVec it deserializes eagerly.

Smart contract error that can concatenate multiple message pieces. The message is kept as a managed buffer in the VM.

A list of items that lives inside a managed buffer. Items can be either stored there in full (e.g. u32), or just via handle (e.g. BigUint<M>).

Structure that allows taking a variable number of arguments or returning a variable number of results in a smart contract endpoint.

A simple queue struct that is able to push and pop without moving elements. New items are pushed at the end, just like for a regular Vec. When popping, instead of performing a regular Vec remove that would shift items, a start index is moved up 1 position. When serializing, items before the start index are ignored.

Contains a smart contract execution error message.

Specialized type for handling token identifiers. It wraps a BoxedBytes with the full ASCII name of the token. EGLD is stored as an empty name.

A contiguous growable array type, written as Vec<T> and pronounced ‘vector’.

Enums

Used internally between the callback and callback_selector methods. It is likely to be removed in the future.

Message hash type for the verifyCustomSecp256k1 CryptoApi function

Standard way of signalling that an operation was interrupted early, before running out of gas. An endpoint that performs a longer operation can check from time to time if it is running low on gas and can decide to save its state and exit, so that it can continue the same operation later.

A smart contract argument or result that can be missing.

Default way to optionally return an error from a smart contract endpoint.

Traits

Commonalities between all managed types.

Types that implement this trait can be items inside a ManagedVec. All these types need a payload, i.e a representation that gets stored in the underlying managed buffer. Not all data needs to be stored as payload, for instance for most managed types the payload is just the handle, whereas the mai ndata is kept by the VM.

Any type that implements this trait can be used to signal errors when returning from a SC endpoint.

Functions

For compatibility with the older Arwen EI.

Syntactical sugar to help macros to generate code easier. Unlike calling CallbackClosure::<SA, R>::new, here types can be inferred from the context.

Syntactical sugar to help macros to generate code easier. Unlike calling ContractCall::<SA, R>::new, here types can be inferred from the context.

Syntactical sugar to help macros to generate code easier. Unlike calling ContractDeploy::<SA>::new, here types can be inferred from the context.

Type Definitions

Used for returning a variable number of results from an endpoint, it is synonymous with MultiResult.

It is just an alias for OptionalArg. In general we use OptionalArg for arguments and OptionalResult for results, but it is the same implementation for both.

Used for taking a variable number of arguments in an endpoint, it is synonymous with MultiResultVec/MultiArgVec.