ethers-decode-error icon indicating copy to clipboard operation
ethers-decode-error copied to clipboard

Function to decode return data if it's received by means other than as an exception when sending transaction

Open sim31 opened this issue 11 months ago • 0 comments

The way it currently works is that you send a transactions using ethers and if transaction fails you provide a generated exception to this library so that it extracts and decodes an error.

I have a contract that sends custom messages ("calldata" specified by the user) to other contracts and emits return data from these calls as events. The original transaction does not revert (so no exception to decode is generated). I take return data from the emitted event and want to decode it into something meaningful.

So I added decodeReturnData to do that and extracted common code from decode and decodeReturnData to a separate function.

sim31 avatar Nov 11 '24 14:11 sim31