-
Notifications
You must be signed in to change notification settings - Fork 5k
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
contract method override types issues #6650
Comments
You need to specify the signature of the method you're calling like this: |
Hi @avkos , contract.methods['getPenaltyBP(address)'] ("0xaceaEcB820Be3f147FF40d1C221B25F10ee8dd92").call() However, for the mentioned case where a value could be an address and still also be handled as a UInt or a string, I think it is not a good idea to handle as an Or what do you think? |
We have an issue with the library with contract methods that are overriden, when there are multiple methods with the same name and different types,
_createContractMethod
will map the abi methods so that it will only use the first method typeissue is around here: https://github.com/web3/web3.js/blob/4.x/packages/web3-eth-contract/src/contract.ts#L1065
for example:
calling
contract.methods.getPenaltyBP("0xaceaEcB820Be3f147FF40d1C221B25F10ee8dd92").call().then(console.log)
will result in the address converted into a uint and being encoded improperlyExpected behavior
contract.methods.getPenaltyBP("0xaceaEcB820Be3f147FF40d1C221B25F10ee8dd92").call().then(console.log) method should be encoded as an address
Actual behavior
Steps to reproduce the behavior
Logs
Environment
The text was updated successfully, but these errors were encountered: