|
| 1 | +--- |
| 2 | +description: Delegation Framework error codes |
| 3 | +sidebar_label: Error codes |
| 4 | +toc_max_heading_level: 2 |
| 5 | +keywords: [error codes, errors, debug, error references, delegation framework] |
| 6 | +--- |
| 7 | + |
| 8 | +# Error codes |
| 9 | + |
| 10 | +Error codes from the [MetaMask Delegation Framework contracts](https://github.com/metamask/delegation-framework). Use a decoder such as |
| 11 | +[calldata.swiss-knife.xyz](https://calldata.swiss-knife.xyz/decoder) to identify error signatures from raw revert data. |
| 12 | + |
| 13 | +## Delegation Manager error codes |
| 14 | + |
| 15 | +| Error code | Error name | Description | |
| 16 | +| ---------- | ---------- | ----------- | |
| 17 | +| `0xb5863604` | `InvalidDelegate()` | The caller is not the delegate specified in the delegation. | |
| 18 | +| `0xb9f0f171` | `InvalidDelegator()` | The caller is not the delegator specificed in the delegation, or the delegator is not deployed. | |
| 19 | +| `0x05baa052` | `CannotUseADisabledDelegation()` | The delegation has been disabled by the delegator. | |
| 20 | +| `0xded4370e` | `InvalidAuthority()` | The delegation chain authority validation failed. The authority hash of a child delegation does not match the hash of its parent delegation. | |
| 21 | +| `0x1bcaf69f` | `BatchDataLengthMismatch()` | The array lengths do not match in a batch `redeemDelegations` contract call. | |
| 22 | +| `0x005ecddb` | `AlreadyDisabled()` | The delegation has already been disabled. | |
| 23 | +| `0xf2a5f75a` | `AlreadyEnabled()` | The delegation is already enabled. | |
| 24 | +| `0xf645eedf` | `ECDSAInvalidSignature()` | Invalid ECDSA signature format. | |
| 25 | +| `0xfce698f7` | `ECDSAInvalidSignatureLength(uint256)` | The ECDSA signature length is incorrect. | |
| 26 | +| `0xac241e11` | `EmptySignature()` | The signature is empty. | |
| 27 | +| `0xd93c0665` | `EnforcedPause()` | The Delegation Manager contract is paused by the owner. | |
| 28 | +| `0x3db6791c` | `InvalidEOASignature()` | EOA signature verification failed. | |
| 29 | +| `0x155ff427` | `InvalidERC1271Signature()` | Smart contract signature (ERC-1271) verification failed. | |
| 30 | +| `0x118cdaa7` | `OwnableUnauthorizedAccount(address)` | An unauthorized account attempted an owner only action. | |
| 31 | +| `0x1e4fbdf7` | `OwnableInvalidOwner(address)` | Invalid owner address in an ownership transfer. | |
| 32 | +| `0xf6b6ef5b` | `InvalidShortString()` | A string parameter is too short. | |
| 33 | +| `0xaa0ea2d8` | `StringTooLong(string)` | A string parameter exceeds the maximum length. | |
| 34 | + |
| 35 | +## Smart account error codes |
| 36 | + |
| 37 | +| Error code | Error name | Description | |
| 38 | +| ---------- | ---------- | ----------- | |
| 39 | +| `0xd663742a` | `NotEntryPoint()` | The caller is not the EntryPoint contract. | |
| 40 | +| `0x0796d945` | `NotEntryPointOrSelf()` | The caller is neither the EntryPoint contract nor the smart account itself. | |
| 41 | +| `0x1a4b3a04` | `NotDelegationManager()` | The caller is not the DelegationManager contract. | |
| 42 | +| `0xb96fcfe4` | `UnsupportedCallType(bytes1)` | The execution call type is not supported. | |
| 43 | +| `0x1187dc06` | `UnsupportedExecType(bytes1)` | The execution type is not supported. | |
| 44 | +| `0x29c3b7ee` | `NotSelf()` | The caller is not the smart account itself. | |
| 45 | + |
| 46 | +## Caveat enforcer error codes |
| 47 | + |
| 48 | +| Error string | Description | |
| 49 | +| ------------ | ----------- | |
| 50 | +| `AllowedTargetsEnforcer:target-address-not-allowed` | When redeeming a delegation with an `allowedTargets` caveat, the execution's target address is not in the allowed list. | |
| 51 | +| `AllowedTargetsEnforcer:invalid-terms-length` | When creating a delegation with an `allowedTargets` caveat, the encoded terms length is not a multiple of 20 bytes (Ethereum address). | |
| 52 | +| `ERC20TransferAmountEnforcer:invalid-terms-length` | When creating a delegation with an `erc20TransferAmount` caveat, the encoded terms are not exactly 52 bytes (20 byte Ethereum address + 32 byte amount). | |
| 53 | +| `ERC20TransferAmountEnforcer:invalid-contract` | When redeeming a delegation with an `erc20TransferAmount` caveat, the execution targets a different contract than the allowed token address. | |
| 54 | +| `ERC20TransferAmountEnforcer:invalid-method` | When redeeming a delegation with an `erc20TransferAmount` caveat, the execution calls a function other than `transfer(address,uint256)`. | |
| 55 | +| `ERC20TransferAmountEnforcer:allowance-exceeded` | When redeeming a delegation with an `erc20TransferAmount` caveat, the cumulative transfer amount exceeds the allowed limit. | |
| 56 | +| `CaveatEnforcer:invalid-call-type` | When redeeming a delegation, the execution uses a batch call type, but the caveat enforcer only supports single calls. | |
| 57 | +| `CaveatEnforcer:invalid-execution-type` | When redeeming a delegation, the execution uses a non default execution mode, but the caveat enforcer only supports the default mode. [Learn more about execution modes](../reference/types.md#executionmode).| |
0 commit comments