Skip to content
This repository has been archived by the owner on May 23, 2023. It is now read-only.

can't execute the same name contract function #842

Open
shiqinfeng1 opened this issue Dec 18, 2017 · 0 comments
Open

can't execute the same name contract function #842

shiqinfeng1 opened this issue Dec 18, 2017 · 0 comments

Comments

@shiqinfeng1
Copy link

I am developing an ethereum Dapp with python. And import the ContractTranslator class easy to interact with smart contarct. I deployed a ERC223 token contract, but call transfer failed, in order to find the reason, I write test code like this:

    txhash = ERC223Token_2.transfer(user_2,2)
    txhash = ERC223Token_2.transfer(user_2,3,'')

first is fail, second is success,
it logs the print(format: function_name, args, signed_data):

('transfer', ('0x5252781539b365e08015fa7ed77af5a36097f39d', 2), 'be45fd620000000000000000000000005252781539b365e08015fa7ed77af5a36097f39d0000000000000000000000000000000000000000000000000000000000000002')

('transfer', ('0x5252781539b365e08015fa7ed77af5a36097f39d', 3, ''), 'be45fd620000000000000000000000005252781539b365e08015fa7ed77af5a36097f39d000000000000000000000000000000000000000000000000000000000000000300000000000000000000000000000000000000000000000000000000000000600000000000000000000000000000000000000000000000000000000000000000')

As you see, the function hash is both be45fd62 , and I get the correct hash from remix:

    "a9059cbb": "transfer(address,uint256)",
    "be45fd62":  "transfer(address,uint256,bytes)",

from source code, it call encode_function_call to get function hash, but the key is function name, so function transfer is conflicts:

description = self.function_data[function_name]

so it need unique key to store the data .

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant