-
-
Notifications
You must be signed in to change notification settings - Fork 176
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
Unable to use address parameter for ERC20 contracts #40
Comments
Thanks for submitting. I will have a look after Devcon next week. PRs are welcome too. |
I met the same question |
我遇到了这个问题,返回值为空 |
Abi.php中45行在签名后面加24个0即可解决这个问题 |
Would be really helpful id you stick to English. |
The encodedFunction does not pad to uint256 (32 bytes) of data. you can update at Abi.php:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi,
I'm trying to fetch account balances from ERC20 smart contracts.
To do so, I have the ERC20 standard ABI, so I should just have to call the "balanceOf" function of the contracts.
According to the ABI, the "balanceOf" function has just one input : the account address.
Here is my piece of code with a specific example where
$abi_json
is a json of the ERC20 ABI:It turns out that the response value is 0, but it should be positive with this particular provided addresses.
I added logs in the Ethereum::request method and I found out that the "data" field sent is :
0x70a08231cc7d71df5e7b6c765448fb7ec79a602d6e3ab4f8
.The first 8 characters
70a08231
represent the signature of the "BalanceOf" function, and the rest is the address sent as an input, on 40 characters.But it looks like the Ethereum Node is expecting this address to be padded in a 64 characters string.
I could prove that with the geth js console on my Parity node :
Am I doing something wrong while preparing the "eth_call" request ? How should I do it so that the address is padded to a 64 characters string in the data field ?
The text was updated successfully, but these errors were encountered: