11// SPDX-License-Identifier: UNLICENSED
22pragma solidity ^ 0.8.0 ;
33
4- import {Proxy} from "openzeppelin-contracts /contracts/proxy/Proxy.sol " ;
5- import {ERC1967Utils } from "openzeppelin-contracts /contracts/proxy/ERC1967/ERC1967Utils.sol " ;
6- import {ECDSA} from "openzeppelin-contracts /contracts/utils/cryptography/ECDSA.sol " ;
7- import {Address} from "openzeppelin-contracts /contracts/utils/Address.sol " ;
4+ import {Proxy} from "@ openzeppelin/contracts/proxy/Proxy.sol " ;
5+ import {ERC1967Utils } from "@ openzeppelin/contracts/proxy/ERC1967/ERC1967Utils.sol " ;
6+ import {ECDSA} from "@ openzeppelin/contracts/utils/cryptography/ECDSA.sol " ;
7+ import {Address} from "@ openzeppelin/contracts/utils/Address.sol " ;
88
99/// @notice Proxy contract designed for EIP-7702 smart accounts.
1010///
@@ -25,22 +25,32 @@ contract EIP7702Proxy is Proxy {
2525 guardedInitializer = initializer;
2626 }
2727
28- function initialize (bytes calldata args , bytes calldata signature ) external {
28+ function initialize (
29+ bytes calldata args ,
30+ bytes calldata signature
31+ ) external {
2932 // construct hash incompatible with wallet RPCs to avoid phishing
3033 bytes32 hash = keccak256 (abi.encode (proxy, args));
3134 address recovered = ECDSA.recover (hash, signature);
3235 if (recovered != address (this )) revert InvalidSignature ();
3336
3437 // enforce initialization only on initial implementation
3538 address implementation = _implementation ();
36- if (implementation != initialImplementation) revert InvalidImplementation ();
39+ if (implementation != initialImplementation)
40+ revert InvalidImplementation ();
3741
38- Address.functionDelegateCall (initialImplementation, abi.encodePacked (guardedInitializer, args));
42+ Address.functionDelegateCall (
43+ initialImplementation,
44+ abi.encodePacked (guardedInitializer, args)
45+ );
3946 }
4047
4148 function _implementation () internal view override returns (address ) {
4249 address implementation = ERC1967Utils .getImplementation ();
43- return implementation != address (0 ) ? implementation : initialImplementation;
50+ return
51+ implementation != address (0 )
52+ ? implementation
53+ : initialImplementation;
4454 }
4555
4656 function _fallback () internal override {
0 commit comments