@@ -5,12 +5,16 @@ pragma solidity 0.8.15;
55import { GnosisSafe as Safe } from "safe-contracts/GnosisSafe.sol " ;
66import { Enum } from "safe-contracts/common/Enum.sol " ;
77import { Guard as IGuard } from "safe-contracts/base/GuardManager.sol " ;
8+ import { IERC165 } from "safe-contracts/interfaces/IERC165.sol " ;
89
910// Libraries
1011import { EnumerableSet } from "@openzeppelin/contracts/utils/structs/EnumerableSet.sol " ;
1112import { SemverComp } from "src/libraries/SemverComp.sol " ;
1213import { Constants } from "src/libraries/Constants.sol " ;
1314
15+ // Interfaces
16+ import { ITransactionGuard } from "interfaces/safe/ITransactionGuard.sol " ;
17+
1418/// @title TimelockGuard
1519/// @notice This guard provides timelock functionality for Safe transactions
1620/// @dev This is a singleton contract, any Safe on the network can use this guard to enforce a timelock delay, and
@@ -65,7 +69,7 @@ import { Constants } from "src/libraries/Constants.sol";
6569/// | Quorum+ | challenge + | cancelTransaction |
6670/// | | changeOwnershipToFallback | |
6771/// +-------------------------------------------------------------------------------------------------+
68- abstract contract TimelockGuard is IGuard {
72+ abstract contract TimelockGuard is IGuard , IERC165 {
6973 using EnumerableSet for EnumerableSet.Bytes32Set;
7074
7175 /// @notice Allowed states of a transaction
@@ -673,4 +677,16 @@ abstract contract TimelockGuard is IGuard {
673677 function signCancellation (bytes32 ) public {
674678 emit Message ("This function is not meant to be called, did you mean to call cancelTransaction? " );
675679 }
680+
681+ ////////////////////////////////////////////////////////////////
682+ // ERC165 Support //
683+ ////////////////////////////////////////////////////////////////
684+
685+ /// @notice ERC165 interface detection
686+ /// @param _interfaceId The interface identifier to check
687+ /// @return True if the contract implements the interface
688+ function supportsInterface (bytes4 _interfaceId ) external view virtual override returns (bool ) {
689+ return _interfaceId == type (ITransactionGuard).interfaceId // 0xe6d7a83a
690+ || _interfaceId == type (IERC165 ).interfaceId; // 0x01ffc9a7
691+ }
676692}
0 commit comments