Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expose encodeFunctionData and decodeFunctionResult as properties on the contract method #4749

Open
cosullivan opened this issue May 30, 2024 · 1 comment
Labels
enhancement New feature or improvement.

Comments

@cosullivan
Copy link

Describe the Feature

I have some scenarios were I need to call encodeFunctionData() and decodeFunctionResult() and whilst I can do this via the Interface, it would be nice to expose these as properties on the method just like there is;

testContract.testMethod.staticCall(...)
testContract.testMethod.estimateGas(...)

it would be nice to have these;

testContract.testMethod.encodeFunctionData(...)
testContract.testMethod.decodeFunctionResult(...)

The code pretty much exists already in the buildWrappedMethod function.

Code Example

No response

@cosullivan cosullivan added the enhancement New feature or improvement. label May 30, 2024
@ricmoo
Copy link
Member

ricmoo commented May 30, 2024

That is one of the reasons for moving the buckets from the contract to the methods in v6, so it can be backwards compatible to add new buckets.

I’ll research this a bit to see what all makes sense to add; it might make sense to add the decode to the events too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement.
Projects
None yet
Development

No branches or pull requests

2 participants