Problem retrieving contract storage via JavaScript

I wanted to know how can I get the data stored in a contract via JavaScript to show it on a TextArea(for example)

I've tried to find out how to store the return value of the contract on a variable.

This is what's in my code "var returnValue = eth.transact({to: contractAdress, data:transactionData, gas: 5000});"

Thanks in advance!

Comments

  • StephanTualStephanTual London, EnglandMember, Moderator Posts: 1,282 mod
    Transact never returns anything, except if you've used it to create a contract - in which case it returns the address of the newly created contract.

    You could just query the the contract storage as part of your display function using web3.eth.stateAt(_a, _s)
  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    Apparently there are 'simulated calls' now, eth.call(...argument as in transact...).

    If you're on an lightweight client, it has to get at least proofs of all the data the call requires.(or it is trustful) Presumably they are just planning to do that. (the recent blog post suggests that too) Probably that will be acceptable for bandwidth by proxy of contracts not costing too much gas if they touch too much state.
Sign In or Register to comment.