Skip to content
Closed
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
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,5 @@ just test

### Ethereum mainnet

- Address: `0xda7afeed01fe625cf15d187a19f94b45f00b8c5f`
- Address: `0xDa7AfEeD021EAFC1c1Af9C362dE477DaD0396B81`
- Constructor: `MAX_UPDATE_AGE = 0`, `MAX_UPDATE_LEAD_TIME = 0`
- CREATE2 factory: `0x914d7Fec6aaC8cd542e72Bca78B30650d45643d7`
- Salt: `0x0000000000000000000000000000000000000000000000000000012809051083`
7 changes: 6 additions & 1 deletion src/PrioUpdateRegistry.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ contract PrioUpdateRegistry is EIP712 {
/// @dev Each target manages its own set of updaters via `addUpdater` / `removeUpdater`.
mapping(address target => mapping(address updater => bool)) public isUpdater;

/// @notice Domain separator used when deriving the storage base for a lane.
/// @dev Prevents lane 0 from sharing the `keccak256(abi.encode(target, 0))` derivation
/// used as the intermediate storage root of `isUpdater[target]`.
bytes32 public constant LANE_STORAGE_NAMESPACE = keccak256("PrioUpdateRegistry.lane");

/// @notice Maximum age (in seconds) by which `updateTimestamp` may lag `block.timestamp` on writes.
/// @dev A write is accepted iff
/// `block.timestamp - MAX_UPDATE_AGE <= updateTimestamp <= block.timestamp + MAX_UPDATE_LEAD_TIME`.
Expand Down Expand Up @@ -111,7 +116,7 @@ contract PrioUpdateRegistry is EIP712 {
}

function _laneSlot0Index(address target, uint256 laneIndex) internal pure returns (uint256) {
return uint256(keccak256(abi.encode(target, laneIndex)));
return uint256(keccak256(abi.encode(LANE_STORAGE_NAMESPACE, target, laneIndex)));
}

/// @notice Validates and writes a state update for `target` at `laneIndex`.
Expand Down
Loading