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โ
Name | Type | Description |
---|---|---|
def | any | calldata decoder data for a def |
calldata | any | Buffer 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โ
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โ
Name | Type | Description |
---|---|---|
sig | string | a 0x-prefixed hex string containing 4 bytes of info |
name | string | canonical name of the function |
Returnsโ
any
[]
Buffer containing RLP-serialized array of calldata info to pass to signing request
Defined inโ
parseSolidityJSONABIโ
โธ parseSolidityJSONABI(sig
, abi
): Object
Look through an ABI definition to see if there is a function that matches the signature provided.
Parametersโ
Name | Type | Description |
---|---|---|
sig | string | a 0x-prefixed hex string containing 4 bytes of info |
abi | any [] | a Solidity JSON ABI structure (external link) |
Returnsโ
Object
Buffer containing RLP-serialized array of calldata info to pass to signing request
Name | Type |
---|---|
def | EVMDef |
Defined inโ
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โ
Name | Type | Description |
---|---|---|
def | any | Decoder data for a specific calldata function (def) |
nestedDefs | any | Array containing a possible set of nested defs which must be added to def |
Returnsโ
any
- Possibly modified version of
def