Takes a CalldataDecoding, which may have been produced in full mode or ABI mode, and converts it to its ABI mode equivalent. See the README for more information.
Please only use on decodings produced by this same decoder instance; use on decodings produced by other instances may not work consistently.
The decoding to abify
Takes a LogDecoding, which may have been produced in full mode or ABI mode, and converts it to its ABI mode equivalent. See the README for more information.
Please only use on decodings produced by this same decoder instance; use on decodings produced by other instances may not work consistently.
The decoding to abify
Takes a ReturndataDecoding, which may have been produced in full mode or ABI mode, and converts it to its ABI mode equivalent. See the README for more information.
Please only use on decodings produced by this same decoder instance; use on decodings produced by other instances may not work consistently.
The decoding to abify
This function is asynchronous.
Adds additional compilations to the decoder like addCompilations, but allows it to be specified in more general forms.
Information about the additional compilations or
contracts to be decoded. This may come in several forms; see the type
documentation for more information. If passing in { compilations: ... }
,
take care that the compilations have different IDs from others passed in
so far, otherwise this will error. If passed in in another form, an ID
will be assigned automatically, which should generally avoid any
collisions.
This function is asynchronous.
Adds compilations to the decoder after it has started. Note it is
only presently possible to do this with a ProjectDecoder
and not
with the other decoder classes.
The compilations to be added. Take care that these have IDs distinct from those the decoder already has.
This method is asynchronous.
Takes a Log object and decodes it. Logs can be ambiguous, so this function returns an array of LogDecodings.
Note that logs are decoded in strict mode, so (with one exception) none of the decodings should contain errors; if a decoding would contain an error, instead it is simply excluded from the list of possible decodings. The one exception to this is that indexed parameters of reference type cannot meaningfully be decoded, so those will decode to an error.
If there are multiple possible decodings, they will always be listed in the following order:
You can check the kind and class.contractKind fields to distinguish between these.
If no possible decodings are found, the returned array of decodings will be empty.
Note that different decodings may use different decoding modes.
Using options.extras = "on"
or options.extras = "necessary"
will change the
above behavior; see the documentation on ExtrasAllowed for more.
If absolutely necessary, you can also set options.disableChecks = true
to allow
looser decoding. Only use this option if you know what you are doing.
The log to be decoded.
Options for controlling decoding.
This method is asynchronous.
Takes a Transaction object and decodes it. The result is a CalldataDecoding; see the documentation on that interface for more.
Note that decoding of transactions sent to libraries is presently not supported and may have unreliable results. Limited support for this is planned for future versions.
The transaction to be decoded.
This method is asynchronous.
Gets all events meeting certain conditions and decodes them. This function is fairly rudimentary at the moment but more functionality will be added in the future.
Used to determine what events to fetch and how to decode them; see the documentation on the EventOptions type for more.
An array of DecodedLogs. These consist of a log together with its possible decodings; see that type for more info. And see decodeLog for more info on how log decoding works in general.
This method is asynchronous.
Constructs a contract instance decoder for a given instance of a contract in this project. Unlike forInstance, this method doesn't require an artifact; it will automatically detect the class of the given contract. If it's not in the project, or the decoder can't identify it, you'll get an exception.
The address of the contract instance to decode. If an invalid address is provided, this method will throw an exception.
You can include this argument to specify that this should be based on the addresses content's at a specific block (if say the contract has since self-destructed).
This method is asynchronous.
Constructs a contract decoder for a given contract artifact.
The artifact for the contract.
A contract constructor object may be substituted for the artifact, so if you're not sure which you're dealing with, it's OK.
Note: The artifact must be for a contract that the decoder knows about; otherwise you will have problems.
This method is asynchronous.
Constructs a contract instance decoder for a given instance of a contract in this project.
The artifact for the contract.
A contract constructor object may be substituted for the artifact, so if you're not sure which you're dealing with, it's OK.
Note: The artifact must be for a contract that the decoder knows about; otherwise you will have problems.
The address of the contract instance to decode. If left out, it will be autodetected. If an invalid address is provided, this method will throw an exception.
Generated using TypeDoc
The ProjectDecoder class. Decodes transactions and logs. See below for a method listing.