18
18
*/
19
19
pragma solidity 0.8.24 ;
20
20
21
+ import {DefaultCallbackHandler} from "../../../../callback/DefaultCallbackHandler.sol " ;
21
22
import {ExecutionUtils} from "../../../../utils/ExecutionUtils.sol " ;
22
23
import {InvalidInitializationInput} from "../../shared/common/Errors.sol " ;
23
24
import {FunctionReference} from "../common/Structs.sol " ;
@@ -26,13 +27,17 @@ import {BaseMSCA} from "./BaseMSCA.sol";
26
27
import {IEntryPoint} from "@account-abstraction/contracts/interfaces/IEntryPoint.sol " ;
27
28
import {UUPSUpgradeable} from "@openzeppelin/contracts-upgradeable/proxy/utils/UUPSUpgradeable.sol " ;
28
29
30
+ import {IERC1271 } from "@openzeppelin/contracts/interfaces/IERC1271.sol " ;
31
+ import {IERC1155Receiver } from "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol " ;
32
+ import {IERC721Receiver } from "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol " ;
33
+
29
34
/**
30
35
* @dev Leverage {ERC1967Proxy} brought by UUPS proxies, when this contract is set as the implementation behind such a
31
36
* proxy.
32
37
* The {_authorizeUpgrade} function is overridden here so more granular ACLs to the upgrade mechanism should be enforced
33
38
* by plugins.
34
39
*/
35
- contract UpgradableMSCA is BaseMSCA , UUPSUpgradeable {
40
+ contract UpgradableMSCA is BaseMSCA , DefaultCallbackHandler , UUPSUpgradeable {
36
41
using ExecutionUtils for address ;
37
42
38
43
event UpgradableMSCAInitialized (address indexed account , address indexed entryPointAddress );
@@ -72,6 +77,17 @@ contract UpgradableMSCA is BaseMSCA, UUPSUpgradeable {
72
77
emit UpgradableMSCAInitialized (address (this ), address (entryPoint));
73
78
}
74
79
80
+ function supportsInterface (bytes4 interfaceId )
81
+ public
82
+ view
83
+ override (BaseMSCA, DefaultCallbackHandler)
84
+ returns (bool )
85
+ {
86
+ // BaseMSCA has already implemented ERC165
87
+ return BaseMSCA.supportsInterface (interfaceId) || interfaceId == type (IERC721Receiver ).interfaceId
88
+ || interfaceId == type (IERC1155Receiver ).interfaceId || interfaceId == type (IERC1271 ).interfaceId;
89
+ }
90
+
75
91
/// @inheritdoc UUPSUpgradeable
76
92
function upgradeToAndCall (address newImplementation , bytes memory data )
77
93
public
0 commit comments