Skip to content

Commit

Permalink
fix(store): slice4 output should be bytes4 [M-03] (#2031)
Browse files Browse the repository at this point in the history
  • Loading branch information
yonadaaa committed Jan 3, 2024
1 parent 6db95ce commit 1b86eac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .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`.
2 changes: 1 addition & 1 deletion packages/store/src/Bytes.sol
Expand Up @@ -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)
}
Expand Down

0 comments on commit 1b86eac

Please sign in to comment.