Skip to content
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

How to get token balance? #32

Closed
danimesq opened this issue Oct 31, 2021 · 2 comments
Closed

How to get token balance? #32

danimesq opened this issue Oct 31, 2021 · 2 comments

Comments

@danimesq
Copy link

Have tried ethereal contract call --contract=0xc944e90c64b2c07662a292be6244bdf05cda44a7 --call='balanceOf(0xDDfC2e10702d8A781727A34D83B3bb3CA94a3E91)' --from=0xDDfC2e10702d8A781727A34D83B3bb3CA94a3E91 to get the balance I hold of GRT (The Graph's token) but then:

Failed to parse call: unknown method name balanceOf

@danimesq
Copy link
Author

Using ABI JSON:

ethereal contract call --contract=0xc944e90c64b2c07662a292be6244bdf05cda44a7 --json=abi.json --call='balanceOf(0xDDfC2e10702d8A781727A34D83B3bb3CA94a3E91)' --from=0xDDfC2e10702d8A781727A34D83B3bb3CA94a3E91

Failed to parse JSON: JSON does not contain contracts element

abi.json:

{
"constant": true,
"inputs": [
{
"name": "_owner",
"type": "address"
}
],
"name": "balanceOf",
"outputs": [
{
"name": "balance",
"type": "uint256"
}
],
"payable": false,
"type": "function"
}

@mcdee
Copy link
Collaborator

mcdee commented Oct 31, 2021

$ ethereal token balance --holder=0xDDfC2e10702d8A781727A34D83B3bb3CA94a3E91 --token=0xc944e90c64b2c07662a292be6244bdf05cda44a7
685

@mcdee mcdee closed this as completed Oct 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants