Skip to content

Commit

Permalink
disabled upgradeAndCall for 7702 SMA
Browse files Browse the repository at this point in the history
  • Loading branch information
fangting-alchemy committed Nov 14, 2024
1 parent b5c869d commit 7e6263a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/account/ModularAccountBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -371,6 +371,7 @@ abstract contract ModularAccountBase is
function upgradeToAndCall(address newImplementation, bytes calldata data)
public
payable
virtual
override
onlyProxy
wrapNativeFunction
Expand Down
6 changes: 6 additions & 0 deletions src/account/SemiModularAccount7702.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -34,4 +36,8 @@ contract SemiModularAccount7702 is SemiModularAccountBase {

return address(this);
}

function upgradeToAndCall(address, bytes calldata) public payable override {

Check warning on line 40 in src/account/SemiModularAccount7702.sol

View workflow job for this annotation

GitHub Actions / Check Format and Run Linters

Function order is incorrect, public payable function can not go after internal view function (line 26)
revert UpgradeNotAllowed();
}
}

0 comments on commit 7e6263a

Please sign in to comment.