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
Overloaded functions with the same number of arguments may have overlapping argument types. This can cause confusion about valid arguments and could inadvertently cause problems when calling a function. Using the syntax for calling a function from Contract.functions.myFunction can be opaque in how it behaves when there are two functions in the contract for myFunction(bytes) and myFunction(bytes32).
Someone may want to call myFunction(bytes32) but accidently pass a 33 byte argument to the function instead of 32 bytes. web3.py would use myFunction(bytes) without the user being explicit by using get_function_by_identifier() or bracket notation, i.e. Contract.functions["myFunction(bytes32)"].
To make this more apparent to the user, the code should warn when calling a function that has the same number of arguments and similar types. Before the warning, also determine how this should be implemented such that functions will not warn when arguments are of varying types like string and bytes, etc.
The text was updated successfully, but these errors were encountered:
What feature should we add?
Overloaded functions with the same number of arguments may have overlapping argument types. This can cause confusion about valid arguments and could inadvertently cause problems when calling a function. Using the syntax for calling a function from Contract.functions.myFunction can be opaque in how it behaves when there are two functions in the contract for
myFunction(bytes)
andmyFunction(bytes32)
.Someone may want to call
myFunction(bytes32)
but accidently pass a 33 byte argument to the function instead of 32 bytes. web3.py would usemyFunction(bytes)
without the user being explicit by usingget_function_by_identifier()
or bracket notation, i.e.Contract.functions["myFunction(bytes32)"]
.To make this more apparent to the user, the code should warn when calling a function that has the same number of arguments and similar types. Before the warning, also determine how this should be implemented such that functions will not warn when arguments are of varying types like
string
andbytes
, etc.The text was updated successfully, but these errors were encountered: