# Functions
AddArgument adds the provided argument to the ContractCallInput.
AddFinishData appends the provided []byte to the ReturnData of the given vmOutput.
AddNewOutputAccount creates a new vmcommon.OutputAccount from the provided arguments and adds it to OutputAccounts of the provided vmOutput.
AddNewOutputAccountWithSender creates a new vmcommon.OutputAccount from the provided arguments and adds it to OutputAccounts of the provided vmOutput.
BooleanToInt returns 1 if the given bool is true, 0 otherwise.
CopyTxHashes copies the tx hashes from a source ContractCallInput into another.
CreateTestContractCallInputBuilder is a builder for ContractCallInputBuilder.
CustomStorageKey generates a storage key of a specific type.
DefaultTestContractCallInput creates a vmcommon.ContractCallInput struct with default values.
FromSerializableAsyncCallGroups - deserialize all call groups from protobuf.
GetSCCode retrieves the bytecode of a WASM module from a file.
GetTestSCCode retrieves the bytecode of a WASM testing module.
GuardedGetBytesSlice extracts a subslice from a given slice, guarding against overstepping the bounds.
IfNil tests if the provided interface pointer or underlying object is nil.
InverseBytes reverses the order of a byte slice.
MakeContractCallInput creates a ContractCallInput and sets the provided arguments.
MakeEmptyContractCallInput instantiates an empty ContractCallInput.
MakeEmptyVMOutput creates a vmcommon.VMOutput struct with default values.
MakeTestSCAddress generates a new smart contract address to be used for testing based on the given identifier.
NewAsyncCallGroup creates a new instance of AsyncCallGroup.
PadBytesLeft adds a specified number of zeros to the left of a byte slice.
SetCallParties sets the caller and recipient of the given ContractCallInput.
ToSerializableAsyncCallGroups serializes all call groups to protobuf.
U64ToLEB128 encodes an uint64 using LEB128 (Little Endian Base 128), used in WASM bytecode See https://en.wikipedia.org/wiki/LEB128 Copied from https://github.com/filecoin-project/go-leb128/blob/master/leb128.go.
WrapError constructs a WrappableError from an error.
# Constants
AddressLen specifies the length of the address.
AddressSize is the size of an account address, in bytes.
AsyncBuiltinFuncCrossShard indicates that the async call is a cross-shard call to a built-in function, which is executed half in-shard, half cross-shard.
AsyncBuiltinFuncIntraShard indicates that the async call is an intra-shard built in function call.
AsyncCallbackString is the human-readable label for execution type.
AsyncCallPending is the status of an async call that awaits complete execution.
AsyncCallRejected is the status of an async call that was executed completely but unsuccessfully.
AsyncCallResolved is the status of an async call that was executed completely and successfully.
AsyncCallString is the human-readable label for execution type.
AsyncDataPrefix is the storage key prefix used for AsyncContext-related storage.
AsyncUnknown indicates that the async call cannot be executed locally, and must be forwarded to the destination account.
BackTransferString is the human-readable label for execution type.
BalanceLen specifies the number of bytes on which the balance is stored.
BreakpointAsyncCall means that Wasmer must stop immediately so the VM can execute an AsyncCall.
BreakpointAsyncCallString is the human-readable name of BreakpointAsyncCall.
BreakpointExecutionFailed means that Wasmer must stop immediately due to failure indicated by VM.
BreakpointExecutionFailedString is the human-readable name of BreakpointExecutionFailed.
BreakpointMemoryLimit means that Wasmer must stop immediately due to over-allocation of WASM memory.
BreakpointNone means the lack of a breakpoint.
BreakpointNoneString is the human-readable name of BreakpointNone.
BreakpointOutOfGas means that Wasmer must stop immediately due to gas being exhausted.
BreakpointOutOfGasString is the human-readable name of BreakpointOutOfGas.
BreakpointSignalError means that Wasmer must stop immediately due to a contract-signalled error.
BreakpointSignalErrorString is the human-readable name of BreakpointSignalError.
CallbackFunctionName is the name of the default asynchronous callback function of a smart contract.
CodeMetadataLen specifies the length of the code metadata.
ContractsUpgradeFunctionName specifies the contract's function called at upgrade.
CryptoOpcodesV2Flag defines the flag that activates the new crypto APIs for RC1.7.
DeleteFunctionName specifies if the call is an deleteContract call.
DeployFromSourceString is the human-readable label for transfer type.
DeploySmartContractString is the human-readable label for transfer type.
DirectCallString is the human-readable label for execution type.
ESDTTransferOnCallBack indicated that the async call is actually a callback with ESDT transfer.
ExecuteOnDestContextString is the human-readable label for execution type.
ExecuteOnSameContextString is the human-readable label for execution type.
HashLen specifies the lenghth of a hash.
InitFunctionName specifies the name for the init function.
LegacyAsyncCallGroupID is the AsyncCallGroup identifier reserved for the implementation of the legacy asyncCall() EEI function.
MultiESDTNFTTransferAndExecuteByUserFlag defines the flag that activates the enshrined sovereign functions.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
StorageAdded signals that something was added to storage.
StorageDeleted signals that something was removed from storage.
StorageModified signals that the storage has been modified.
StorageUnchanged signals that the storage was not changed.
SyncExecution indicates that the async call can be executed synchronously, with its corresponding callback.
TimeLockKeyPrefix is the storage key prefix used for timelock-related storage.
TransferAndExecuteString is the human-readable label for execution type.
TransferValueOnlyString is the human-readable label for transfer type.
UnknownBreakpointString is the human-readable label for an unknown breakpoint value.
UpgradeFromSourceString is the human-readable label for execution type.
UpgradeFunctionName specifies if the call is an upgradeContract call.
UseGasBoundedShouldFailExecutionFlag defines the flag that activates failing of execution if gas bounded check fails.
VMVersion returns the current vm version.
WASMPageSize is the size in bytes of a WASM linear memory page.
# Variables
DefaultVMType is an exposed value to use in tests.
ErrAccountNotFound is an exposed value to use in tests.
ErrAccountNotPayable signals that the value transfer to a non payable contract is not possible.
ErrAllOperandsAreEqualToZero signals that all operands are equal to 0.
ErrArgIndexOutOfRange signals that the argument index is out of range.
ErrArgOutOfRange signals that the argument is out of range.
ErrAsyncCallGroupExistsAlready signals that an AsyncCallGroup with the same name already exists.
ErrAsyncCallNotFound signals that the requested AsyncCall was not found.
ErrAsyncInit signals an async context initialization error.
ErrAsyncNoCallbackForClosure signals that closure can't be obtained.
ErrAsyncNoMultiLevel signals that no multi-level async calls are allowed.
ErrAsyncNoOutputFromCallback signals that an error happen while producing the output of a callback.
ErrAsyncNotAllowed signals that the requested AsyncCall is not allowed.
ErrBadBounds signals that a certain variable is out of bounds.
ErrBadLowerBounds signals that a certain variable is lower than allowed.
ErrBadUpperBounds signals that a certain variable is higher than allowed.
ErrBigFloatWrongPrecision signals that the precision has a wrong value.
ErrBigIntCannotBeRepresentedAsInt64 signals that an attempt to apply a bitwise operation on negative numbers has been made.
ErrBitwiseNegative signals that an attempt to apply a bitwise operation on negative numbers has been made.
ErrBuiltinCallOnSameContextDisallowed signals that calling a built-in function on the same context is not allowed.
ErrCallBackFuncCalledInRun signals that a callback func was called directly, which is forbidden.
ErrCannotInterpretCallbackArgs signals that the cross-shard callback arguments are invalid.
ErrCannotUseBuiltinAsCallback signals that the specified callback was set to a built-in function, which is forbidden.
ErrCannotWriteOnReadOnly signals that write operation on read only is not allowed.
ErrCannotWriteProtectedKey signals an attempt to write to a protected key, while storage protection is enforced.
ErrContextCallbackDisabled signals that group callbacks cannot be set nor executed.
ErrContractInvalid signals that the contract code is invalid.
ErrContractNotFound signals that the contract was not found.
ErrDeploymentOverExistingAccount signals that an attempt to deploy a new SC over an already existing account has been made.
ErrDivZero signals that an attempt to divide by 0 has been made.
ErrEmptyProtectedKeyPrefix signals that the protected key prefix is empty or nil.
ErrExecutionFailed signals that the execution failed.
ErrExecutionFailedWithTimeout signals that the execution failed with timeout.
ErrExecutionPanicked signals that the execution failed irrecoverably.
ErrExponentTooBigOrTooSmall signals that the exponent is too big or too small.
ErrFailedTransfer signals that the transfer operation has failed.
ErrInfinityFloatOperation signals that operations with infinity are not allowed.
ErrInitFuncCalledInRun signals that the init func was called directly, which is forbidden.
ErrInputAndOutputGasDoesNotMatch is raised when the output gas (gas used + gas locked + gas remaining) is not equal to the input gas.
No description provided by the author
ErrInvalidAccount signals that a certain account does not exist.
ErrInvalidArgument is given when argument is invalid.
ErrInvalidBuiltInFunctionCall signals that built in function was used in the wrong context.
ErrInvalidCallOnReadOnlyMode signals that an operation is not permitted due to read only mode.
ErrInvalidFunctionName signals that the function name is invalid.
ErrInvalidGasProvided signals that an unacceptable GasProvided value was specified.
No description provided by the author
ErrInvalidPublicKeySize signals that the public key size is invalid.
ErrInvalidSignature signals that a signature verification failed.
ErrInvalidTokenIndex is given when argument is invalid.
ErrInvalidUpgradeArguments signals that the upgrade process failed due to invalid arguments.
ErrLegacyAsyncCallInvalid signals that the legacy async call is invalid.
ErrLegacyAsyncCallNotFound signals that a legacy async call was expected, but is missing.
ErrLengthOfBufferNotCorrect signals that length of the buffer is not correct.
ErrMaxInstancesReached signals that the max number of Wasmer instances has been reached.
ErrMemoryDeclarationMissing signals that a memory declaration is missing.
ErrMemoryLimit signals that too much memory was allocated by the contract.
ErrNegativeLength signals that the given length is less than 0.
ErrNilBlockChainHook signals that nil blockchain hook was provided.
ErrNilBuiltInFunctionsContainer signals that nil built in functions container was provided.
ErrNilCallArgsParser signals that nil call arguments parser was provided.
ErrNilCallbackFunction signals that a nil callback function has been provided.
ErrNilContract signals that the contract is nil.
ErrNilDestinationCallVMOutput signals that the destination call execution returned a nil VMOutput.
ErrNilEnableEpochsHandler signals that enable epochs handler is nil.
ErrNilEpochNotifier signals that epoch notifier is nil.
ErrNilESDTData is given when ESDT data is missing.
ErrNilESDTTransferParser signals that nil esdt transfer parser was provided.
ErrNilExecutor signals that the provided Executor is nil.
ErrNilHasher signals that the provided Hasher is nil.
ErrNilHostParameters signals that nil host parameters was provided.
ErrNilMapOpcodeAddress signals that nil map of opcodes and addresses was provided.
ErrNilVMHost signals that the provided VMHost is nil.
ErrNilVMType signals that the provided VMType is nil.
ErrNoAsyncParentContext signals that load parent was called for an async call.
ErrNoBigFloatUnderThisHandle signals that there is no bigInt for the given handle.
ErrNoBigIntUnderThisHandle signals that there is no bigInt for the given handle.
ErrNoEllipticCurveUnderThisHandle singals that there is no elliptic curve for the given handle.
ErrNoManagedBufferUnderThisHandle signals that there is no buffer for the given handle.
ErrNoManagedMapUnderThisHandle signals that there is no buffer for the given handle.
ErrNonPayableFunctionEgld signals that a non-payable function received non-zero call value.
ErrNonPayableFunctionEsdt signals that a non-payable function received non-zero ESDT call value.
ErrNoStoredAsyncContextFound signals that no persisted data was found for the AsyncContext to load.
ErrNotEnoughGas signals that there is not enough gas for the operation.
ErrOnlyOneLegacyAsyncCallAllowed signals that there was an attempt to create more than one legacy async calls, which is forbidden.
ErrOpcodeIsNotAllowed signals that opcode is not allowed for the address.
ErrPointNotOnCurve signals that the point to be used is not on curve.
ErrPositiveExponent signals that the exponent is greater or equal to 0.
ErrReturnCodeNotOk signals that the returned code is different than vmcommon.Ok.
ErrShiftNegative signals that an attempt to apply a bitwise shift operation on negative numbers has been made.
ErrSignalError is given when the smart contract signals an error.
ErrStorageValueOutOfRange signals that the storage value is out of range.
ErrStoreReservedKey signals that an attempt to write under an reserved key has been made.
ErrSyncExecutionNotInSameShard signals that the sync execution request is not in the same shard.
ErrTooManyESDTTransfers signals that too many ESDT transfers are in sc call.
ErrTransferInsufficientFunds signals that the transfer has failed due to insufficient funds.
ErrTransferNegativeValue signals that the transfer has failed due to the fact that the value is less than 0.
ErrTransferValueOnESDTCall signals that balance transfer was given in esdt call.
No description provided by the author
ErrUnhandledRuntimeBreakpoint signals that the runtime breakpoint is unhandled.
ErrUnknownCallType signals that the call type is not recognized.
ErrUpgradeFailed signals that the upgrade encountered an error.
ErrUpgradeNotAllowed signals that an upgrade is not allowed.
ErrVMIsClosing signals that vm is closing.
One is the big integer 1.
ParentAddress is an exposed value to use in tests.
SCAddressPrefix is the prefix of any smart contract address used for testing.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
UserAddress is an exposed value to use in tests.
Zero is the big integer 0.
# Structs
AsyncCall holds the information about an individual async call.
AsyncCallGroup is a structure containing a group of async calls and a callback that should be called when all these async calls are resolved.
AsyncCallInfo contains the information required to handle the asynchronous call of another SmartContract.
AsyncGeneratedCall holds the information abount an async call.
CodeDeployInput contains code deploy state, whether it comes from a ContractCreateInput or a ContractCallInput.
ContractCallInputBuilder extends a ContractCallInput for extra building functionality during testing.
ContractCreateInputBuilder extends a ContractCreateInput for extra building functionality during testing.
ESDTTransfersArgs defines the structure for ESDTTransferArgs, used in TransferAndExecute.
OldAsyncContext is a structure containing a group of async calls and a callback
that should be called when all these async calls are resolved.
No description provided by the author
No description provided by the author
VMHostParameters represents the parameters to be passed to VMHost.
# Interfaces
AsyncCallInfoHandler defines the functionality for working with AsyncCallInfo.
AsyncCallLocation defines the functionality for async calls.
AsyncContext defines the functionality needed for interacting with the asynchronous execution context.
BlockchainContext defines the functionality needed for interacting with the blockchain context.
CallArgsParser defines the functionality to parse transaction data for a smart contract call.
EnableEpochsHandler is used to verify which flags are set in a specific epoch based on EnableEpochs config.
GasTracing defines the functionality needed for a gas tracing.
HashComputer provides hash computation.
InstanceTracker defines the functionality needed for interacting with the instance tracker.
ManagedTypesContext defines the functionality needed for interacting with the big int context.
MeteringContext defines the functionality needed for interacting with the metering context.
OutputContext defines the functionality needed for interacting with the output context.
RuntimeContext defines the functionality needed for interacting with the runtime context.
StateStack defines the functionality for working with a state stack.
StorageContext defines the functionality needed for interacting with the storage context.
VMHost defines the functionality for working with the VM.
WrappableError - an interface that extends error and represents a multi-layer error.
# Type aliases
AsyncCallExecutionMode encodes the execution modes of an AsyncCall.
AsyncCallStatus represents the different status an async call can have.
BreakpointValue encodes Wasmer runtime breakpoint types.
No description provided by the author
No description provided by the author
StorageStatus defines the states the storage can be in.