Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(store): slice4 output should be bytes4 [M-03] #2031

Merged
merged 3 commits into from
Jan 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/blue-forks-move.md
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Loading