Skip to main content

Module: calldata/evm

Functionsโ€‹

getNestedCalldataโ€‹

โ–ธ getNestedCalldata(def, calldata): any[]

Pull out nested calldata which may correspond to nested ABI definitions. This is relevant for e.g. multicall patterns. A def may be nested if the underlying type is bytes or bytes[] and the calldata parm is of size (4 + 32*n).

Parametersโ€‹

NameTypeDescription
defanycalldata decoder data for a def
calldataanyBuffer containing full calldata payload

Returnsโ€‹

any[]

  • Array of calldata params, or null values. If the return item has data (0x-prefixed hex string), it should be checked as a possible nested def

Defined inโ€‹

src/calldata/evm.ts:71


parseCanonicalNameโ€‹

โ–ธ parseCanonicalName(sig, name): any[]

Convert a canonical name into an ABI definition that can be included with calldata to a general "2", "2.1", "3")

Parametersโ€‹

NameTypeDescription
sigstringa 0x-prefixed hex string containing 4 bytes of info
namestringcanonical name of the function

Returnsโ€‹

any[]

Buffer containing RLP-serialized array of calldata info to pass to signing request

Defined inโ€‹

src/calldata/evm.ts:36


parseSolidityJSONABIโ€‹

โ–ธ parseSolidityJSONABI(sig, abi): Object

Look through an ABI definition to see if there is a function that matches the signature provided.

Parametersโ€‹

NameTypeDescription
sigstringa 0x-prefixed hex string containing 4 bytes of info
abiany[]a Solidity JSON ABI structure (external link)

Returnsโ€‹

Object

Buffer containing RLP-serialized array of calldata info to pass to signing request

NameType
defEVMDef

Defined inโ€‹

src/calldata/evm.ts:11


replaceNestedDefsโ€‹

โ–ธ replaceNestedDefs(def, nestedDefs): any

If applicable, update decoder data to represent nested definitions, which are used in e.g. multicall patterns. This will update def in place and return it with any additional info necessary.

Parametersโ€‹

NameTypeDescription
defanyDecoder data for a specific calldata function (def)
nestedDefsanyArray containing a possible set of nested defs which must be added to def

Returnsโ€‹

any

  • Possibly modified version of def

Defined inโ€‹

src/calldata/evm.ts:126