I'm trying to code a signature like opensea does for approving the Terms of Service. To do so I'm using the ECDSA library.
This code in javascript using ethers:
const message = ethers.utils.solidityKeccak256(
['address'],
[
'0x00cF2CFA50bD1434C65F00Bf80867499492f5639',
],
)
console.log(message)
Gives me a different output as this code in Solidity:
address owner = 0x00cF2CFA50bD1434C65F00Bf80867499492f5639;
bytes32 public message = keccak256(
abi.encodePacked(owner)
);
why is it so?
I checked this post and this one but they don't help me since they use WEB3 and I use ethers.
solidity gives: 0x5380c7b7ae81a58eb98d9c78de4a1fd7fd9535fc953ed2be602daaa41767312a
– Loo Mar 14 '23 at 17:21