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

Question: How to handle Duplicate definition #35

Closed
akf0rce opened this issue Feb 24, 2022 · 1 comment
Closed

Question: How to handle Duplicate definition #35

akf0rce opened this issue Feb 24, 2022 · 1 comment

Comments

@akf0rce
Copy link

akf0rce commented Feb 24, 2022

In my ABI I have overloaded functions;

function test(address, overrides)
function test(address, amount, overrides)

In Javascript function overloading isn't applicable due to hoisting.

so when i call the contract function test the 3 params are available in typescripts scope, but it would invoke all sorts of strange issues.
Particularly when I pass overrides as position 2 in the function.

I'm looking for a solution to work around this, and was wondering how other people have handled this?

P.S. Love this library it's a god send <3

@joshstevens19
Copy link
Owner

Hey hey super interesting I actually not dealt with an ABI with multiple exposed public overloads!! A little bit of digging I’ve found some chat about how it’s dealt with in ethers ethers-io/ethers.js#407

I’m not sure how I can fix this in this lib as this is purely a interface wrapper which holds no logic at all! So I would suggest calling the overload as that issue says! I will look into this more to see if I can force typing in that syntax they use!

Hope it helps

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

No branches or pull requests

2 participants