@@ -8,14 +8,14 @@ import {StorageSlot} from "openzeppelin-contracts/contracts/utils/StorageSlot.so
88
99/// @title EIP7702Proxy
1010/// @notice Proxy contract designed for EIP-7702 smart accounts
11- /// @dev Implements ERC-1967 with an initial implementation and guarded initialization
11+ /// @dev Implements ERC-1967 with an initial implementation address and guarded initializer function
1212/// @author Coinbase (https://github.com/base-org/eip-7702-proxy)
1313contract EIP7702Proxy is Proxy {
1414 /// @notice ERC1271 interface constants
1515 bytes4 internal constant ERC1271_MAGIC_VALUE = 0x1626ba7e ;
1616 bytes4 internal constant ERC1271_FAIL_VALUE = 0xffffffff ;
1717
18- /// @notice Address of this proxy contract (stored as immutable)
18+ /// @notice Address of this proxy contract delegate
1919 address immutable proxy;
2020
2121 /// @notice Initial implementation address set during construction
@@ -24,15 +24,12 @@ 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, conforms to ERC-7201
27+ /// @dev Storage slot with the initialized flag, calculated via ERC-7201
2828 bytes32 internal constant INITIALIZED_SLOT =
2929 keccak256 (
3030 abi.encode (uint256 (keccak256 ("EIP7702Proxy.initialized " )) - 1 )
3131 ) & ~ bytes32 (uint256 (0xff ));
3232
33- /// @notice Emitted when the implementation is upgraded
34- event Upgraded (address indexed implementation );
35-
3633 /// @notice Emitted when the initialization signature is invalid
3734 error InvalidSignature ();
3835
@@ -76,9 +73,7 @@ contract EIP7702Proxy is Proxy {
7673 // Construct hash without Ethereum signed message prefix to prevent phishing via standard wallet signing.
7774 // Since this proxy is designed for EIP-7702 (where the proxy address is an EOA),
7875 // using a raw hash ensures that initialization signatures cannot be obtained through normal
79- // wallet "Sign Message" prompts. This prevents malicious dapps from tricking users into
80- // initializing their account via standard wallet signing flows.
81- // Wallets must implement custom signing logic at a lower level to support initialization.
76+ // wallet "Sign Message" prompts.
8277 bytes32 hash = keccak256 (abi.encode (proxy, args));
8378 address recovered = ECDSA.recover (hash, signature);
8479 if (recovered != address (this )) revert InvalidSignature ();
@@ -93,7 +88,7 @@ contract EIP7702Proxy is Proxy {
9388 );
9489 }
9590
96- /// @notice Handles ERC-1271 signature validation by enforcing a final ecrecover check if signatures fail `isValidSignature` check
91+ /// @notice Handles ERC-1271 signature validation by enforcing a final ` ecrecover` check if signatures fail `isValidSignature` check
9792 ///
9893 /// @dev This ensures EOA signatures are considered valid regardless of the implementation's `isValidSignature` implementation
9994 ///
0 commit comments