Pretty simple code here:
pragma solidity ^0.4.13;
contract Oracle{
event Print(string _name, bytes32 _value);
bytes32 key;
function Store(bytes32 _key) returns (bytes32) {
key = _key;
Print("Key",_key);
return _key;
}
}
Now I'm trying to store the value 1 as a key.
Using remix,
entered key: 1
printed key: 0x0100000000000000000000000000000000000000000000000000000000000000
entered key: "0x01"
printed key: 0x0100000000000000000000000000000000000000000000000000000000000000
Now a weird one:
entered key: "0x1"
printed key: 0x0100000000000000000000000000000000000000000000000000000000000000
And also weird:
entered key: "1"
printed key: 0x3100000000000000000000000000000000000000000000000000000000000000
And also super weird...when using NodeJS to push a raw transaction:
Entered:1
Printed key: 0x1000000000000000000000000000000000000000000000000000000000000000
So the question, why does "0x1" and "0x01" and 1 all give me the same answer on remix and not on node? And why is 1 when in quotes something different?