This repository was archived by the owner on Mar 5, 2025. It is now read-only.

Description
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