Skip to content
solidity
import "solidity-scale-codec/src/Xcm/v5/XcmError/XcmError.sol";

File-Level Functions

unit(struct UnitParams params)

solidity
function unit(struct UnitParams params) internal pure returns (struct XcmError)

Creates a unit `XcmError` with no payload.

trap(struct TrapErrorParams params)

solidity
function trap(struct TrapErrorParams params) internal pure returns (struct XcmError)

Creates a `Trap` error with the given u64 code.

File-Level Structs

XcmError

solidity
struct XcmError

XCM v5 error, containing the error type and an optional payload for `Trap`.

FieldTypeDescription
variantXcmErrorVariantThe type of the error. See `XcmErrorVariant` enum for possible values.
payloadbytesThe trap code. Only meaningful when `variant` is `Trap`.

UnitParams

solidity
struct UnitParams

Parameters for unit (payload-less) XCM errors.

FieldTypeDescription
variantXcmErrorVariantThe non-trap error discriminant.

TrapErrorParams

solidity
struct TrapErrorParams

Parameters for the `Trap` error variant.

FieldTypeDescription
codeuint64Trap code.

File-Level Enums

XcmErrorVariant

solidity
enum XcmErrorVariant

Error codes used in XCM.

VariantDescription
OverflowAn arithmetic overflow happened.
UnimplementedThe instruction is intentionally unsupported.
UntrustedReserveLocationOrigin Register does not contain a valid value for a reserve transfer notification.
UntrustedTeleportLocationOrigin Register does not contain a valid value for a teleport notification.
LocationFull`MultiLocation` value too large to descend further.
LocationNotInvertible`MultiLocation` value ascends more parents than known ancestors of local location.
BadOriginThe Origin Register does not contain a valid value for the instruction.
InvalidLocationThe location parameter is not a valid value for the instruction.
AssetNotFoundThe given asset is not handled.
FailedToTransactAssetAn asset transaction failed, typically due to type conversions. NOTE: The string field is #[codec(skip)] and not serialized.
NotWithdrawableAn asset cannot be withdrawn, potentially due to lack of ownership, availability or rights.
LocationCannotHoldAn asset cannot be deposited under the ownership of a particular location.
ExceedsMaxMessageSizeAttempt to send a message greater than the maximum supported by the transport protocol.
DestinationUnsupportedThe given message cannot be translated into a format supported by the destination.
TransportDestination is routable, but there is some issue with the transport mechanism. NOTE: The string field is #[codec(skip)] and not serialized.
UnroutableDestination is known to be unroutable.
UnknownClaimUsed by `ClaimAsset` when the given claim could not be recognized/found.
FailedToDecodeUsed by `Transact` when the functor cannot be decoded.
MaxWeightInvalidUsed by `Transact` to indicate that the given weight limit could be breached by the functor.
NotHoldingFeesUsed by `BuyExecution` when the Holding Register does not contain payable fees.
TooExpensiveUsed by `BuyExecution` when the fees declared to purchase weight are insufficient.
TrapUsed by the `Trap` instruction to force an error intentionally.
ExpectationFalseUsed by `ExpectAsset`, `ExpectError` and `ExpectOrigin` when the expectation was not true.
PalletNotFoundThe provided pallet index was not found.
NameMismatchThe given pallet's name is different to that expected.
VersionIncompatibleThe given pallet's version has an incompatible version to that expected.
HoldingWouldOverflowThe given operation would lead to an overflow of the Holding Register.
ExportErrorThe message was unable to be exported.
ReanchorFailed`MultiLocation` value failed to be reanchored.
NoDealNo deal is possible under the given constraints.
FeesNotMetFees were required which the origin could not pay.
LockErrorSome other error with locking.
NoPermissionThe state was not in a condition where the operation was valid to make.
UnanchoredThe universal location of the local consensus is improper.
NotDepositableAn asset cannot be deposited, probably because too much of it already exists.
TooManyAssetsToo many assets matched the given asset filter.

XcmError

Kind: source