Contracts::Error

Variant 563 v393

pallet_contracts::pallet::Error

The `Error` enum of this pallet.

About This Type

Error enum for the Error pallet.

Contains all error types that the Error pallet can return when a call fails.

Variants (37)

IndexNameFieldsDocs
0InvalidSchedulenoneInvalid schedule supplied, e.g. with zero weight of a basic operation.
1InvalidCallFlagsnoneInvalid combination of flags supplied to `seal_call` or `seal_delegate_call`.
2OutOfGasnoneThe executed contract exhausted its gas limit.
3OutputBufferTooSmallnoneThe output buffer supplied to a contract API call was too small.
4TransferFailednonePerforming the requested transfer failed. Probably because there isn't enough free balance in the sender's account.
5MaxCallDepthReachednonePerforming a call was denied because the calling depth reached the limit of what is specified in the schedule.
6ContractNotFoundnoneNo contract was found at the specified address.
7CodeTooLargenoneThe code supplied to `instantiate_with_code` exceeds the limit specified in the current schedule.
8CodeNotFoundnoneNo code could be found at the supplied code hash.
9CodeInfoNotFoundnoneNo code info could be found at the supplied code hash.
10OutOfBoundsnoneA buffer outside of sandbox memory was passed to a contract API function.
11DecodingFailednoneInput passed to a contract API function failed to decode as expected type.
12ContractTrappednoneContract trapped during execution.
13ValueTooLargenoneThe size defined in `T::MaxValueSize` was exceeded.
14TerminatedWhileReentrantnoneTermination of a contract is not allowed while the contract is already on the call stack. Can be triggered by `seal_terminate`.
15InputForwardednone`seal_call` forwarded this contracts input. It therefore is no longer available.
16RandomSubjectTooLongnoneThe subject passed to `seal_random` exceeds the limit.
17TooManyTopicsnoneThe amount of topics passed to `seal_deposit_events` exceeds the limit.
18NoChainExtensionnoneThe chain does not provide a chain extension. Calling the chain extension results in this error. Note that this usually shouldn't happen as deploying such contracts is rejected.
19XCMDecodeFailednoneFailed to decode the XCM program.
20DuplicateContractnoneA contract with the same AccountId already exists.
21TerminatedInConstructornoneA contract self destructed in its constructor. This can be triggered by a call to `seal_terminate`.
22ReentranceDeniednoneA call tried to invoke a contract that is flagged as non-reentrant. The only other cause is that a call from a contract into the runtime tried to call back into `pallet-contracts`. This would make the whole pallet reentrant with regard to contract code execution which is not supported.
23StateChangeDeniednoneA contract attempted to invoke a state modifying API while being in read-only mode.
24StorageDepositNotEnoughFundsnoneOrigin doesn't have enough balance to pay the required storage deposits.
25StorageDepositLimitExhaustednoneMore storage was created than allowed by the storage deposit limit.
26CodeInUsenoneCode removal was denied because the code is still in use by at least one contract.
27ContractRevertednoneThe contract ran to completion but decided to revert its storage changes. Please note that this error is only returned from extrinsics. When called directly or via RPC an `Ok` will be returned. In this case the caller needs to inspect the flags to determine whether a reversion has taken place.
28CodeRejectednoneThe contract's code was found to be invalid during validation. The most likely cause of this is that an API was used which is not supported by the node. This happens if an older node is used with a new version of ink!. Try updating your node to the newest available version. A more detailed error can be found on the node console if debug messages are enabled by supplying `-lruntime::contracts=debug`.
29IndeterministicnoneAn indeterministic code was used in a context where this is not permitted.
30MigrationInProgressnoneA pending migration needs to complete before the extrinsic can be called.
31NoMigrationPerformednoneMigrate dispatch call was attempted but no migration was performed.
32MaxDelegateDependenciesReachednoneThe contract has reached its maximum number of delegate dependencies.
33DelegateDependencyNotFoundnoneThe dependency was not found in the contract's delegate dependencies.
34DelegateDependencyAlreadyExistsnoneThe contract already depends on the given delegate dependency.
35CannotAddSelfAsDelegateDependencynoneCan not add a delegate dependency to the code hash of the contract itself.
36OutOfTransientStoragenoneCan not add more data to transient storage.

SCALE Encoding

Rule
1-byte variant index followed by variant-specific field data. 37 possible variants.
Size
variable (1+ bytes)

Examples

InvalidSchedule
0x00
00 Variant index 0 = InvalidSchedule
InvalidCallFlags
0x01
01 Variant index 1 = InvalidCallFlags
OutOfGas
0x02
02 Variant index 2 = OutOfGas

Code Examples

import { TypeRegistry } from "@polkadot/types";

const registry = new TypeRegistry();

// Encode Contracts::Error — variant "InvalidSchedule"
const value = registry.createType("Contracts::Error", "InvalidSchedule");
console.log("Hex:", value.toHex());

Type Parameters

T

Referenced By (21)

and 1 more...

Also See

Type Information

Type ID
563
Kind
Variant
Path
pallet_contracts::pallet::Error
Runtime
v393