1

I have a deployed contract address and I need to query a contract storage value, a token account balance that is stored on a mapping variable:

mapping (address => uint256) balances;

From go-etherum code, I would like to get that value for a given account avoiding making a call to the contract ( I do not have an EVM reference, just a StateDB reference) so I guess I could retrieve the variable value using the StateDB reference and getStateObject function:

core\state\statedb.go(511): func (s *StateDB) getStateObject(addr common.Address) (stateObject *stateObject)

So, how can I build a stateObject from the contract address, and the variable name (balances) and type (mapping (address => uint256)) ?

Thanks a lot!

Your Answer

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

Browse other questions tagged or ask your own question.