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

Throw a new error with the list of methods found compatible when calling an overloading smart contract method with inputs that fits more than one #6923

Closed
Muhammad-Altabba opened this issue Mar 24, 2024 · 1 comment
Labels
5.x 5.0 related issues Stale Has not received enough activity

Comments

@Muhammad-Altabba
Copy link
Contributor

In case of smart contract methods overloading, if there is more than one smart contract method that is compatible with a given input, the current code will use the first method mentioned in the ABI. This means for a smart contract method that accepts for example, either string or address, and the ABI of the method that accept string in the input exists before the other overloading function, then the code will use the string overloading even if the value provided was an address. This is because every address is a string. And the code currently handles it by picking just the first match of the overloading method found.

Expected behavior

For the above case, an error should be thrown because of ambiguity.

Actual behavior

In the mentioned case the current code just picks the first method found in the ABI and use it.

Where to change in the code

https://github.com/web3/web3.js/pull/6922/files#diff-7fa8f782e68ce845dbb6e8446b86041697fa427db5485b9c63bf689d0b32ed81R1091

Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. If you believe this was a mistake, please comment.

@github-actions github-actions bot added the Stale Has not received enough activity label May 24, 2024
@github-actions github-actions bot closed this as completed Jun 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5.x 5.0 related issues Stale Has not received enough activity
Projects
None yet
Development

No branches or pull requests

1 participant