MyAccountERC7702.sol 910 B

1234567891011121314151617181920
  1. // contracts/MyAccountERC7702.sol
  2. // SPDX-License-Identifier: MIT
  3. pragma solidity ^0.8.20;
  4. import {Account} from "../../../account/Account.sol";
  5. import {ERC721Holder} from "../../../token/ERC721/utils/ERC721Holder.sol";
  6. import {ERC1155Holder} from "../../../token/ERC1155/utils/ERC1155Holder.sol";
  7. import {ERC7821} from "../../../account/extensions/draft-ERC7821.sol";
  8. import {SignerERC7702} from "../../../utils/cryptography/signers/SignerERC7702.sol";
  9. contract MyAccountERC7702 is Account, SignerERC7702, ERC7821, ERC721Holder, ERC1155Holder {
  10. /// @dev Allows the entry point as an authorized executor.
  11. function _erc7821AuthorizedExecutor(
  12. address caller,
  13. bytes32 mode,
  14. bytes calldata executionData
  15. ) internal view virtual override returns (bool) {
  16. return caller == address(entryPoint()) || super._erc7821AuthorizedExecutor(caller, mode, executionData);
  17. }
  18. }