[Ethereum] Solidity error when encoding arguments to call a function with Bytes32 Type Parameters

remixsolidity

While developing a Smart Contract with Solidity on Remix, after creating the contract I'm trying to call a function by passing Bytes32 datatype parameters:

function addTT(bytes32 _name) public {
...
}

but when I call addTT() by passing parameter "neo" it throws the following error:

transact to Abc.addTT errored: Error encoding arguments: Error:
invalid bytes32 value (arg=undefined, type="string", value="asda")

Any idea how can I properly call function addTT()?

Best Answer

You need to convert the value in hex to be passed. neo is 0x6e656f in hex. If you try to pass '0x6e656f' it will work (don't forget the quote).