-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
33 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: GPL-3.0 | ||
pragma solidity ^0.8.20; | ||
|
||
import {IModularAccount} from "../interfaces/IModularAccount.sol"; | ||
import {SemiModularAccount} from "./SemiModularAccount.sol"; | ||
import {IEntryPoint} from "@eth-infinitism/account-abstraction/interfaces/IEntryPoint.sol"; | ||
|
||
contract SemiModularAccount7702 is SemiModularAccount { | ||
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 If the fallback signer is set in storage, ignore the 7702 signer. | ||
function _retrieveFallbackSignerUnchecked(SemiModularAccountStorage storage _storage) | ||
internal | ||
view | ||
override | ||
returns (address) | ||
{ | ||
address storageFallbackSigner = _storage.fallbackSigner; | ||
if (storageFallbackSigner != address(0)) { | ||
return storageFallbackSigner; | ||
} | ||
|
||
// To support 7702, we default to address(this) as the fallback signer. | ||
return address(this); | ||
} | ||
} |