# Packages
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
# Functions
BooleanToInt returns 1 if the given bool is true, 0 otherwise.
CustomStorageKey appends the given key type to the given associated key.
DisableLoggingForTests sets log level to *:NONE.
GetBlockchainContext returns the blockchain context.
GetCryptoContext returns the crypto context.
GetManagedTypesContext returns the big int context.
GetMeteringContext returns the metering context.
GetOutputContext returns the output context.
GetRuntimeContext returns the runtime context.
GetSCCode returns the SC code from a given file.
GetStorageContext returns the storage context.
GetVMHost returns the vm Context from the vm context map
nolint:all.
GuardedGetBytesSlice returns a chunk from the given data.
GuardedMakeByteSlice2D creates a new two-dimensional byte slice of the given dimension.
IfNil tests if the provided interface pointer or underlying object is nil.
InverseBytes reverses the bytes of the given byte slice.
PadBytesLeft adds a padding of the given size to the left the byte slice.
SetLoggingForTests configures the logger package with *:TRACE and enabled logger names.
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.
WithFault returns true if the error is not nil, and uses the remaining gas if the execution has failed.
WithFaultAndHost fails the execution with the provided error.
WithFaultAndHostIfFailAlwaysActive returns true if the error is not nil, and uses the remaining gas if the execution has failed.
WithFaultIfFailAlwaysActive returns true if the error is not nil, and uses the remaining gas if the execution has failed.
WrapError constructs a WrappableError from an error.
# Constants
AddressLen specifies the length of the address.
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.
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.
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.
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.
BreakpointExecutionFailed means that Wasmer must stop immediately due to failure indicated by VM.
BreakpointMemoryLimit means that Wasmer must stop immediately due to over-allocation of WASM memory.
BreakpointNone means the lack of a breakpoint.
BreakpointOutOfGas means that Wasmer must stop immediately due to gas being exhausted.
BreakpointSignalError means that Wasmer must stop immediately due to a contract-signalled error.
CallbackFunctionName is the name of the default asynchronous callback function of a smart contract.
CheckExecuteOnReadOnlyFlag defines the flag that activates the check execute on read only.
CodeMetadataLen specifies the length of the code metadata.
CreateNFTThroughExecByCallerFlag defines the flag that activates the create nft through exec by caller fix.
DisableExecByCallerFlag defines the flag that activates disable exec by caller.
ESDTTransferOnCallBack indicated that the async call is actually a callback with ESDT transfer.
FailExecutionOnEveryAPIErrorFlag defines the flag that activates the fail execution on every api error.
FixOOGReturnCodeFlag defines the flag that activates the fix oog return code.
HashLen specifies the lenghth of a hash.
InitFunctionName specifies the name for the init function.
InitFunctionNameEth specifies the name for the init function on Ethereum.
ManagedCryptoAPIsFlag defines the flag that activates the manage crypto apis.
MultiESDTTransferFixOnCallBackFlag defines the flag that activates the multi esdt transfer fix on callback.
ProtectedStoragePrefix is the storage key prefix that will be protected by VM explicitly, and implicitly by the node due to '@'; the protection can be disabled temporarily by the StorageContext.
RefactorContextFlag defines the flag that activates the refactor context.
RemoveNonUpdatedStorageFlag defines the flag that activates the remove non updated storage fix.
RuntimeCodeSizeFixFlag defines the flag that activates the runtime code size fix.
RuntimeMemStoreLimitFlag defines the flag that activates the runtime mem store limit.
StorageAdded signals that something was added to storage.
StorageAPICostOptimizationFlag defines the flag that activates the storage api cost optimization.
StorageDeleted signals that something was removed from storage.
StorageModified signals that the storage has been modified.
StorageUnchanged signals that the storage was not changed.
SyncCall indicates that the async call can be executed synchronously, with its corresponding callback.
TimeLockKeyPrefix is the storage key prefix used for timelock-related storage.
UpgradeFunctionName specifies if the call is an upgradeContract call.
VMVersion returns the current vm version.
WASMPageSize size in bytes of a WASM Linear Memory Page.
# Variables
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.
ErrAsyncContextDoesNotExist signals that the async context does not exist.
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.
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.
ErrCallBackFuncNotExpected signals that an unexpected callback was received.
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.
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.
ErrFuncNotFound signals that the the function does not exist.
ErrFunctionNonvoidSignature signals that the signature for the function is invalid.
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.
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.
ErrInvalidFunction signals that the function is invalid.
ErrInvalidFunctionName signals that the function name is invalid.
ErrInvalidPublicKeySize signals that the public key size is invalid.
ErrInvalidTokenIndex is given when argument is invalid.
ErrInvalidUpgradeArguments signals that the upgrade process failed due to invalid arguments.
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.
ErrNilCallbackFunction signals that a nil callback function has been provided.
ErrNilContract signals that the contract is nil.
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.
ErrNilHasher signals that the provided hasher is nil.
ErrNilHost signals that a nil host was provided.
ErrNilHostParameters signals that nil host parameters was provided.
ErrNilVMHost signals that the VM Host is nil.
ErrNilVMType signals that a nil VMType was provided.
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.
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.
ErrNotEnoughGas signals that there is not enough gas for the operation.
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.
ErrUnhandledRuntimeBreakpoint signals that the runtime breakpoint is unhandled.
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.
Zero is the big integer 0.
# Structs
AsyncCallInfo contains the information required to handle the asynchronous call of another SmartContract.
AsyncContext is a structure containing a group of async calls and a callback that should be called when all these async calls are resolved.
AsyncContextInfo is the structure resulting after a smart contract call that has initiated one or more async calls.
AsyncGeneratedCall holds the information abount an async call.
CodeDeployInput contains code deploy state, whether it comes from a ContractCreateInput or a ContractCallInput.
VMHostParameters represents the parameters to be passed to VMHost.
# Interfaces
AsyncCallInfoHandler defines the functionality for working with AsyncCallInfo.
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.
InstanceBuilder defines the functionality needed to create Wasmer instances.
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.
StorageStatus defines the states the storage can be in.