@tevm/voltaire / primitives/RevertReason
primitives/RevertReason
Type Aliases
CustomRevertReason
CustomRevertReason = object
Defined in: src/primitives/RevertReason/RevertReasonType.ts:31
Custom error with selector and data
Properties
data
Defined in: src/primitives/RevertReason/RevertReasonType.ts:34readonlydata:Uint8Array
selector
Defined in: src/primitives/RevertReason/RevertReasonType.ts:33readonlyselector:string
type
Defined in: src/primitives/RevertReason/RevertReasonType.ts:32readonlytype:"Custom"
ErrorRevertReason
ErrorRevertReason = object
Defined in: src/primitives/RevertReason/RevertReasonType.ts:14
Standard Error(string) revert
Properties
message
Defined in: src/primitives/RevertReason/RevertReasonType.ts:16readonlymessage:string
type
Defined in: src/primitives/RevertReason/RevertReasonType.ts:15readonlytype:"Error"
PanicCode
PanicCode = keyof typeof PANIC_CODES
Defined in: src/primitives/RevertReason/constants.ts:23
PanicRevertReason
PanicRevertReason = object
Defined in: src/primitives/RevertReason/RevertReasonType.ts:22
Solidity 0.8+ Panic(uint256) revert
Properties
code
Defined in: src/primitives/RevertReason/RevertReasonType.ts:24readonlycode:number
description
Defined in: src/primitives/RevertReason/RevertReasonType.ts:25readonlydescription:string
type
Defined in: src/primitives/RevertReason/RevertReasonType.ts:23readonlytype:"Panic"
RevertReasonType
RevertReasonType =Defined in: src/primitives/RevertReason/RevertReasonType.ts:48 RevertReason union typeErrorRevertReason|PanicRevertReason|CustomRevertReason|UnknownRevertReason
UnknownRevertReason
UnknownRevertReason = object
Defined in: src/primitives/RevertReason/RevertReasonType.ts:40
Unknown/unrecognized revert
Properties
data
Defined in: src/primitives/RevertReason/RevertReasonType.ts:42readonlydata:Uint8Array
type
Defined in: src/primitives/RevertReason/RevertReasonType.ts:41readonlytype:"Unknown"
Variables
ERROR_SELECTOR
Defined in: src/primitives/RevertReason/constants.ts:4 Standard error selectorsconstERROR_SELECTOR:"0x08c379a0"="0x08c379a0"
PANIC_CODES
Defined in: src/primitives/RevertReason/constants.ts:10 Solidity 0.8+ panic codesconstPANIC_CODES:object
Type Declaration
0
readonly0:"Generic panic"="Generic panic"
1
readonly1:"Assertion failed"="Assertion failed"
17
readonly17:"Arithmetic overflow/underflow"="Arithmetic overflow/underflow"
18
readonly18:"Division by zero"="Division by zero"
33
readonly33:"Invalid enum value"="Invalid enum value"
34
readonly34:"Invalid storage encoding"="Invalid storage encoding"
49
readonly49:"Array pop on empty array"="Array pop on empty array"
50
readonly50:"Array out of bounds"="Array out of bounds"
65
readonly65:"Out of memory"="Out of memory"
81
readonly81:"Invalid internal function"="Invalid internal function"
PANIC_SELECTOR
Defined in: src/primitives/RevertReason/constants.ts:5constPANIC_SELECTOR:"0x4e487b71"="0x4e487b71"
Functions
_from()
_from(Defined in: src/primitives/RevertReason/from.js:15 Create RevertReason from various inputsvalue):RevertReasonType
Parameters
value
Return datastring | Uint8Array<ArrayBufferLike> | ReturnDataType
Returns
RevertReasonType
Decoded revert reason
Example
_fromReturnData()
_fromReturnData(Defined in: src/primitives/RevertReason/fromReturnData.js:24 Decode RevertReason from ReturnDatareturnData):RevertReasonType
Parameters
returnData
ReturnDataType
Return data from failed call
Returns
RevertReasonType
Decoded revert reason
Example
_toString()
_toString(Defined in: src/primitives/RevertReason/toString.js:17 Convert RevertReason to string representationreason):string
Parameters
reason
RevertReasonType
Revert reason
Returns
string
String representation
Example
from()
from(Defined in: src/primitives/RevertReason/index.ts:19 Create RevertReason from various inputsvalue):RevertReasonType
Parameters
value
string | Uint8Array<ArrayBufferLike> | ReturnDataType
Returns
RevertReasonType
fromReturnData()
fromReturnData(Defined in: src/primitives/RevertReason/index.ts:28 Decode RevertReason from ReturnDatareturnData):RevertReasonType
Parameters
returnData
ReturnDataType
Returns
RevertReasonType
getPanicDescription()
getPanicDescription(Defined in: src/primitives/RevertReason/constants.ts:28 Get panic code descriptioncode):string
Parameters
code
number
Returns
string
toString()
toString(Defined in: src/primitives/RevertReason/index.ts:36 Convert RevertReason to string representationreason):string
Parameters
reason
RevertReasonType
Returns
string
