From 6229a6d67e8c5ef933e6e96c1f07718960e9d3e4 Mon Sep 17 00:00:00 2001 From: Fraser Scott Date: Wed, 6 Dec 2023 11:29:47 +0000 Subject: [PATCH 1/3] fix(store): slice4 should return bytes4 --- packages/store/src/Bytes.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) } From 2a1b5569b50414cbd415da48fd8dd17adc3f928d Mon Sep 17 00:00:00 2001 From: Fraser Scott Date: Wed, 3 Jan 2024 13:11:28 +0000 Subject: [PATCH 2/3] chore: changeset --- .changeset/blue-forks-move.md | 5 +++++ 1 file changed, 5 insertions(+) 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..e3ce32aaa3 --- /dev/null +++ b/.changeset/blue-forks-move.md @@ -0,0 +1,5 @@ +--- +"@latticexyz/store": patch +--- + +Changed the return type of the `slice4` function to `bytes4`. From b5db16c2a8d3e3fca67bb19100b56da171e13ed3 Mon Sep 17 00:00:00 2001 From: Fraser Scott Date: Wed, 3 Jan 2024 13:12:10 +0000 Subject: [PATCH 3/3] chore: modify changeset --- .changeset/blue-forks-move.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/blue-forks-move.md b/.changeset/blue-forks-move.md index e3ce32aaa3..59dee73733 100644 --- a/.changeset/blue-forks-move.md +++ b/.changeset/blue-forks-move.md @@ -2,4 +2,4 @@ "@latticexyz/store": patch --- -Changed the return type of the `slice4` function to `bytes4`. +Changed the type of the output variable in the `slice4` function to `bytes4`.