@@ -4,7 +4,7 @@ pragma solidity ^0.8.23;
44import {EIP7702ProxyBase} from "../base/EIP7702ProxyBase.sol " ;
55import {EIP7702Proxy} from "../../src/EIP7702Proxy.sol " ;
66import {CoinbaseSmartWallet} from "../../lib/smart-wallet/src/CoinbaseSmartWallet.sol " ;
7- import {UUPSUpgradeable} from "solady/src/ utils/UUPSUpgradeable.sol " ;
7+ import {UUPSUpgradeable} from "solady/utils/UUPSUpgradeable.sol " ;
88
99contract UpgradeToAndCallTest is EIP7702ProxyBase {
1010 DummyImplementation newImplementation;
@@ -22,8 +22,8 @@ contract UpgradeToAndCallTest is EIP7702ProxyBase {
2222 newImplementation = new DummyImplementation ();
2323 }
2424
25- function testUpgradeToAndCall () public {
26- // Only owner should be able to upgrade
25+ function testUpgradeToAndCall_succeedsForOwner () public {
26+ // Wallet owner should be able to upgrade
2727 vm.prank (_newOwner);
2828
2929 CoinbaseSmartWallet (payable (_eoa)).upgradeToAndCall (
@@ -37,6 +37,21 @@ contract UpgradeToAndCallTest is EIP7702ProxyBase {
3737 DummyImplementation (payable (_eoa)).dummy ();
3838 }
3939
40+ function testUpgradeToAndCall_succeedsForEOA () public {
41+ // EOA should be able to upgrade
42+ vm.prank (_eoa);
43+
44+ CoinbaseSmartWallet (payable (_eoa)).upgradeToAndCall (
45+ address (newImplementation),
46+ abi.encodeWithSignature ("dummy() " )
47+ );
48+
49+ // Verify upgrade worked by calling new function
50+ vm.expectEmit (true , true , true , true , _eoa);
51+ emit DummyImplementation.DummyCalled ();
52+ DummyImplementation (payable (_eoa)).dummy ();
53+ }
54+
4055 function testUpgradeToAndCallRevertsForNonOwner () public {
4156 vm.prank (address (0xBAD ));
4257 vm.expectRevert (); // CoinbaseSmartWallet will revert for non-owner
0 commit comments