I'm trying to run the first example code from this webpage https://docs.soliditylang.org/en/v0.8.11/solidity-by-example.html

However, I'm not able to figure out how exactly am I suppose to pass the parameters to this constructor. I tried passing numbers, strings, array of numbers, array of strings, but they all gave errors as shown in the second pic. Can anyone show me the correct way to pass the arguments.

enter image description here

enter image description here

  • ["0x...", "0x.....", "0x..."]
    – Majd TL
    Feb 10, 2022 at 16:03

1 Answer 1


you need to give an array of bytes32 in hex like this

["0x...", "0x.....", "0x..."]

example: proposalName -> hash(https://emn178.github.io/online-tools/keccak_256.html)

"Test1" -> d283f3979d00cb5493f2da07819695bc299fba34aa6e0bacb484fe07a2fc0ae0

"Test2" -> 4659db3b248cae1bb6856ee63308af6c9c15239e3bb76f425fbacdd84bb15330

["0xd283f3979d00cb5493f2da07819695bc299fba34aa6e0bacb484fe07a2fc0ae0", "0x4659db3b248cae1bb6856ee63308af6c9c15239e3bb76f425fbacdd84bb15330"]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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