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.

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.

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>).

A very efficient reference to a managed type, with copy semantics.

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>).

A multi-value container, that keeps raw values as ManagedBuffer It allows encoding and decoding of multi-values.

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 ManagedMultiValue it deserializes eagerly.

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>, short for ‘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.

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

IgnoreVarArgsDeprecated

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

ManagedVarArgsDeprecated
MultiArg2Deprecated
MultiArg3Deprecated
MultiArg4Deprecated
MultiArg5Deprecated
MultiArg6Deprecated
MultiArg7Deprecated
MultiArg8Deprecated
MultiArg9Deprecated
MultiArg10Deprecated
MultiArg11Deprecated
MultiArg12Deprecated
MultiArg13Deprecated
MultiArg14Deprecated
MultiArg15Deprecated
MultiArg16Deprecated
MultiArgVecDeprecated

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

MultiResult2Deprecated
MultiResult3Deprecated
MultiResult4Deprecated
MultiResult5Deprecated
MultiResult6Deprecated
MultiResult7Deprecated
MultiResult8Deprecated
MultiResult9Deprecated
MultiResult10Deprecated
MultiResult11Deprecated
MultiResult12Deprecated
MultiResult13Deprecated
MultiResult14Deprecated
MultiResult15Deprecated
MultiResult16Deprecated
MultiResultVecDeprecated

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

OptionalArgDeprecated

A smart contract argument or result that can be missing.

OptionalResultDeprecated

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.

VarArgsDeprecated

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