I am trying to view values stored on my ethereum contract using ethereum wallet. Currently the values are being placed onto the contract in hex format. Is there a way to decode them on the contract so that Ethereum wallet can read back words rather than hex values?

  • Could you show source code of your contract? Usually, smart contracts store values in binary rather than hex format, so you are probably misunderstanding something. – Mikhail Vladimirov Apr 6 '19 at 8:02

Yes, you can use web3.utils.hexToAscii(hex)

check documentation: https://web3js.readthedocs.io/en/1.0/web3-utils.html#hextoascii

  • Or web3.toAscii if web3 version is 0.x. – goodvibration Feb 25 '19 at 11:15

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.