Attaching a geth client to a ganache-cli instance:

$ geth attach http://localhost:8550
Welcome to the Geth JavaScript console!

instance: EthereumJS TestRPC/v2.0.2/ethereum-js
coinbase: 0x322ecad098ba9125e5f5b35a390051af1592ab91
at block: 27 (Thu, 05 Apr 2018 15:51:09 BST)
 modules: eth:1.0 evm:1.0 net:1.0 personal:1.0 rpc:1.0 web3:1.0

I am attempting to call a contract function that has overloaded functions:

function transfer(address _to, uint256 _value, bytes _data)
function transfer(address _to, uint256 _value) //This one is called

After creating an interface on geth to access the contract functions, calling transfer results in a call to the second function definition.

How can I call a specific overloaded version of a contract function?

There doesn't seem to be a way to use encodeFunctionCall as shown with truffle here via geth.


The ganache-cli version being used that was failing was v6.0.3. For some reason this ganache version could not handle overloaded contract functions well.

Updating to v6.1.0 solves this problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.