Skip to content

Commit

Permalink
fix(protocol): add 1 to _REENTRY_SLOT in EssentialContract (#16593)
Browse files Browse the repository at this point in the history
  • Loading branch information
dantaik authored Apr 3, 2024
1 parent ce9e67b commit a381ddd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/protocol/contracts/common/EssentialContract.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,13 @@ abstract contract EssentialContract is UUPSUpgradeable, Ownable2StepUpgradeable,

uint8 private constant _TRUE = 2;

/// @dev The slot in transient storage of the reentry lock. This is the keccak256 hash
/// of "ownerUUPS.reentry_slot"
/// @dev The slot in transient storage of the reentry lock.
/// This is the result of keccak256("ownerUUPS.reentry_slot") plus 1. The addition aims to
/// prevent hash collisions with slots defined in EIP-1967, where slots are derived by
/// keccak256("something") - 1, and with slots in SignalService, calculated directly with
/// keccak256("something").
bytes32 private constant _REENTRY_SLOT =
0xa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721a;
0xa5054f728453d3dbe953bdc43e4d0cb97e662ea32d7958190f3dc2da31d9721b;

/// @dev Slot 1.
uint8 private __reentry;
Expand Down

0 comments on commit a381ddd

Please sign in to comment.