I'm trying to check that a string value is equal to a bytes32 value in Solidity, like stringValue == bytes32Value.
As you can see in:
Variable values in Truffle Debugging

both variables have the same content. But how can I compare them?
See if this post helps - https://ethereum.stackexchange.com/a/9152
First, the string is read in as bytes using bytes method, which is used to perform empty string test, and then it leverages assembly method to return bytes32 representation of provided string.
Moreover, solidity documentation points to byte initialization techniques from string
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With