Skip to content

Commit

Permalink
feat: block upgrades in 7702 account
Browse files Browse the repository at this point in the history
  • Loading branch information
Zer0dot committed Feb 3, 2025
1 parent 64571c5 commit f9215cd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/account/ReferenceModularAccount.sol
Original file line number Diff line number Diff line change
Expand Up @@ -305,6 +305,7 @@ contract ReferenceModularAccount is
function upgradeToAndCall(address newImplementation, bytes memory data)
public
payable
virtual
override
onlyProxy
wrapNativeFunction
Expand Down
7 changes: 7 additions & 0 deletions src/account/SemiModularAccount7702.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,20 @@ import {SemiModularAccount} from "./SemiModularAccount.sol";
import {IEntryPoint} from "@eth-infinitism/account-abstraction/interfaces/IEntryPoint.sol";

contract SemiModularAccount7702 is SemiModularAccount {
error UpgradeNotAllowed();

constructor(IEntryPoint anEntryPoint) SemiModularAccount(anEntryPoint) {}

/// @inheritdoc IModularAccount
function accountId() external pure virtual override returns (string memory) {
return "erc6900.reference-semi-modular-account-7702.0.8.0";
}

/// @dev To prevent accidental self-calls, upgrades are disabled in 7702 accounts.
function upgradeToAndCall(address, bytes memory) public payable override {
revert UpgradeNotAllowed();
}

/// @dev If the fallback signer is set in storage, ignore the 7702 signer.
function _retrieveFallbackSignerUnchecked(SemiModularAccountStorage storage _storage)
internal
Expand Down

0 comments on commit f9215cd

Please sign in to comment.