From 1b86eac0530d069ff267f6fee8d6a71d6bbb365b Mon Sep 17 00:00:00 2001 From: yonada Date: Wed, 3 Jan 2024 14:49:58 +0000 Subject: [PATCH] fix(store): slice4 output should be bytes4 [M-03] (#2031) --- .changeset/blue-forks-move.md | 5 +++++ packages/store/src/Bytes.sol | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 .changeset/blue-forks-move.md diff --git a/.changeset/blue-forks-move.md b/.changeset/blue-forks-move.md new file mode 100644 index 0000000000..59dee73733 --- /dev/null +++ b/.changeset/blue-forks-move.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/store": patch +--- + +Changed the type of the output variable in the `slice4` function to `bytes4`. diff --git a/packages/store/src/Bytes.sol b/packages/store/src/Bytes.sol index c66ffd92d0..1c81f79a58 100644 --- a/packages/store/src/Bytes.sol +++ b/packages/store/src/Bytes.sol @@ -262,7 +262,7 @@ library Bytes { * @return The extracted bytes4 value from the specified position in the bytes32 value. */ function slice4(bytes32 data, uint256 start) internal pure returns (bytes4) { - bytes2 output; + bytes4 output; assembly { output := shl(mul(8, start), data) }