1
        address addr1 = 0x70997970C51812dc3A010C7d01b50e0d17dc79C8;
        bytes memory addr2 = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8";
        require(keccak256(abi.encodePacked(addr1)) == keccak256(addr2), 'not equal');

I would think that the above require statement evaluates to true, but it evaluates to false. Any reasoning as to why would be very helpful, thank you!

1 Answers1

0

The result of abi.encodePacked(addr1) is a 20 bytes array.

On the other hand addr2 is a 42 bytes array.

Ismael
  • 30,570
  • 21
  • 53
  • 96