Skip to content

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

Open
sim31 wants to merge 1 commit intosuperical:mainfrom
sim31:main
Open

Function to decode return data if it's received by means other than as an exception when sending transaction#10
sim31 wants to merge 1 commit intosuperical:mainfrom
sim31:main

Conversation

@sim31
Copy link

@sim31 sim31 commented Nov 11, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant