Skip to content

Commit ee0747d

Browse files
committed
use ERC7201 convention for specifying initialized flag storage slot
1 parent 66bd84e commit ee0747d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/EIP7702Proxy.sol

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ contract EIP7702Proxy is Proxy {
2424
/// @notice Function selector on the implementation that is guarded from direct calls
2525
bytes4 immutable guardedInitializer;
2626

27-
/// @dev Storage slot with the initialized flag
27+
/// @dev Storage slot with the initialized flag, conforms to ERC-7201
2828
bytes32 internal constant INITIALIZED_SLOT =
29-
bytes32(uint256(keccak256("EIP7702Proxy.initialized")) - 1);
29+
keccak256(
30+
abi.encode(uint256(keccak256("EIP7702Proxy.initialized")) - 1)
31+
) & ~bytes32(uint256(0xff));
3032

3133
/// @notice Emitted when the implementation is upgraded
3234
event Upgraded(address indexed implementation);

0 commit comments

Comments
 (0)