I am trying to add msg.value and msg.sender into an array using web3 for every client that invokes my contract. I would like this information to be stored on the contract for as long as possible, if possible.

If a new client invokes this method, they are added to the array, and so on.

I then want to be able to retrieve those values (msg.value, msg.sender) from the array via web3 at a later point in time.

It would be great to see the contract code, and the web3 code if possible.

| improve this question | | | | |

Set and retrieve to/from array: http://solidity.readthedocs.org/en/latest/types.html#arrays

To retrieve array values through web3, write a function in the contract that returns the values (see above example) and then call it with: https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethcall

| improve this answer | | | | |
  • Answers should be clear and useful even if all the links are broken. please include a summary of each source or a code snippet – Tjaden Hess Feb 11 '16 at 14:37

Your Answer

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

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