I am attempting to store a hash (web3.sha3) into an array in a smart contract.

What is the best way to do that?


The question is a little unclear, but are you asking the datatype to store it in? Do you want to store the individual bytes of the hash into different slots in an array? If so, use the bytes datatype. If you want to store an array of sha3 hashes, you should use a bytes32[] array and store the hashes at different indexes in the array.

If you need more information, consider editing your question to add specific needs you have.

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.