Created
February 3, 2022 14:31
-
-
Save taijusanagi/1cf345cca91903ebebfe6a33cfc77d9f to your computer and use it in GitHub Desktop.
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.0+commit.c7dfd78e.js&optimize=false&runs=200&gist=
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
contract CompateAbiEncodePackedAndBytes { | |
function execute1() public { | |
require(test1()); | |
} | |
function execute2() public { | |
require(test2()); | |
} | |
function test1() public pure returns (bool) { | |
return keccak256(abi.encodePacked("string")) == keccak256(abi.encodePacked("string")); | |
} | |
function test2() public pure returns (bool) { | |
return keccak256(bytes("string")) == keccak256(bytes("string")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this gist is for this blog post.
https://qiita.com/taijusanagi/items/b26732c3cb5cf931428f