According to this question I could write a simple contract like:
contract SimpleStorage {
bytes input;
function setInput(bytes enterBytes){
input = enterBytes;
}
}
Using "0x1234" as a parameter in Remix "does not work" and stores "0x307831323334" in the storage array. If I change the code to bytes2
then everything works as intended with the same command. How can I do the same using a dynamic array?
contract SimpleStorage {
bytes2 input;
function setInput(bytes2 enterBytes){
input = enterBytes;
}
}
Best Answer
code: