Skip to content

Commit

Permalink
bit mask the top 12 bits for permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
saucepoint committed Nov 22, 2023
1 parent ea2f033 commit 266f1bf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/utils/HookMiner.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ pragma solidity ^0.8.20;
/// @title HookMiner - a library for mining hook addresses
/// @dev This library is intended for `forge test` environments. There may be gotchas when using salts in `forge script` or `forge create`
library HookMiner {
// mask to slice out the top 8 bit of the address
uint160 constant FLAG_MASK = 0xFF << 152;
// mask to slice out the top 12 bit of the address
uint160 constant FLAG_MASK = 0xFFF << 148;

// Maximum number of iterations to find a salt, avoid infinite loops
uint256 constant MAX_LOOP = 10_000;
Expand Down

0 comments on commit 266f1bf

Please sign in to comment.