diff --git a/src/account/ModularAccountBase.sol b/src/account/ModularAccountBase.sol index a362705d..d5adcf21 100644 --- a/src/account/ModularAccountBase.sol +++ b/src/account/ModularAccountBase.sol @@ -371,6 +371,7 @@ abstract contract ModularAccountBase is function upgradeToAndCall(address newImplementation, bytes calldata data) public payable + virtual override onlyProxy wrapNativeFunction diff --git a/src/account/SemiModularAccount7702.sol b/src/account/SemiModularAccount7702.sol index 950607fc..70d09419 100644 --- a/src/account/SemiModularAccount7702.sol +++ b/src/account/SemiModularAccount7702.sol @@ -12,6 +12,8 @@ import {SemiModularAccountBase} from "./SemiModularAccountBase.sol"; /// @dev Inherits SemiModularAccountBase. This account can be used as the delegate contract of an EOA with /// EIP-7702, where address(this) (aka the EOA address) is the default fallback signer. contract SemiModularAccount7702 is SemiModularAccountBase { + error UpgradeNotAllowed(); + constructor(IEntryPoint anEntryPoint) SemiModularAccountBase(anEntryPoint) {} /// @inheritdoc IModularAccount @@ -34,4 +36,8 @@ contract SemiModularAccount7702 is SemiModularAccountBase { return address(this); } + + function upgradeToAndCall(address, bytes calldata) public payable override { + revert UpgradeNotAllowed(); + } }