0

I refer to - http://solidity.readthedocs.io/en/develop/types.html?highlight=address

"It is possible to query the balance of an address using the property balance and to send Ether (in units of wei) to an address using the transfer function:"

Is this address a contract address?

I have con defined and I get this -

> eth.coinbase.balance
undefined

> con.address.balance
undefined

> con.address
"0x49b0bfa8e7fc7ac178d74b73dc92fa42cd7815e5"

> eth.coinbase
"0x46fb9a22689c4a4bfb494baeafbb8b2993725305"

How should balance be used with these addresses?

1 Answer 1

0

I am not sure if I did understand your point, as you have tagged the question with 'go-ethereum' and linked the documentation of Solidity, a language to create smart contracts.

If you want to request the balance of an account in the geth console (and your code snippet looks like you are trying to do this) you can use the getBalance function: > eth.getBalance(eth.coinbase)

If you are trying to query the balance of an account in Solidity in a smart contract, myAddress.balance should do exactly what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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