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 Answer 1

0

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

On the other hand addr2 is a 42 bytes array.

2

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.