I make a hash of these two values: 1 and 0xDA0bab807633f07f013f94DDD0E6A4F96F8742B53 and they return different values depending on where I do it.
In javascript:
const contract = "0xDA0bab807633f07f013f94DDD0E6A4F96F8742B53"
let messageHash = ethers.utils.hashMessage(1, contract);
result: 0x4d7df8449c9c3c240b091b1f6660a76593e77662edd1efa00e5d826609415208
with remix
function getMessageHash(
uint _idGame, address _contract
)
public pure returns (bytes32)
{
return keccak256(abi.encodePacked(_idGame, _contract));
}
Result:
0x2effa95a3e815cf3bca1b4e91c301eaee9683075d938ceedac1024d75071f972
Why are they different?