This question already has an answer here:

I am trying to learn about solidity so I just watch a tutorial about it, I already copy the same code as the tutorial but there is an error with bytes32. Here it is: enter image description here

That is the deploy code: enter image description here

And that is the .sol: enter image description here

marked as duplicate by Rosco Kalis, Achala Dissanayake, Nicolas Massart, shane, flygoing Feb 6 at 18:16

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


Replace ['Sat', 'Vit'] with:

  • ['Sat', 'Vit'].map(x => web3.fromAscii(x)) if you're on Truffle 4.x (web3 0.x)
  • ['Sat', 'Vit'].map(x => web3.utils.asciiToHex(x)) if you're on Truffle 5.x (web3 1.x)

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