You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
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.
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.
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
oraddress
, and the ABI of the method that acceptstring
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
The text was updated successfully, but these errors were encountered: