Skip to content

Commit

Permalink
add ERC165 support
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-Colon committed Oct 22, 2024
1 parent 418a93f commit 79ac1f4
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 17 deletions.
33 changes: 16 additions & 17 deletions contracts/DecentAutonomousAdmin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,15 @@ pragma solidity 0.8.28;

import {IHats} from "./interfaces/hats/full/IHats.sol";
import {IHatsElectionEligibility} from "./interfaces/hats/full/IHatsElectionEligibility.sol";
import {ISablierV2Lockup} from "./interfaces/sablier/full/ISablierV2Lockup.sol";
import {FactoryFriendly} from "@gnosis.pm/zodiac/contracts/factory/FactoryFriendly.sol";

contract DecentAutonomousAdmin is FactoryFriendly {
string public constant NAME = "DecentAutonomousAdmin";
string public constant version_ = "0.1.0";

struct SablierStreamInfo {
uint256 streamId;
ISablierV2Lockup sablierV2Lockup;
}
struct TriggerStartArgs {
address currentWearer;
IHats userHatProtocol;
uint256 userHatId;
address nominatedWearer;
}

import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {IDecentAutonomousAdmin} from "./interfaces/IDecentAutonomousAdmin.sol";

contract DecentAutonomousAdmin is
IDecentAutonomousAdmin,
ERC165,
FactoryFriendly
{
// //////////////////////////////////////////////////////////////
// initializer
// //////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -56,6 +47,14 @@ contract DecentAutonomousAdmin is FactoryFriendly {
args.userHatProtocol.mintHat(args.userHatId, args.nominatedWearer);
}

function supportsInterface(
bytes4 interfaceId
) public view override returns (bool) {
return
interfaceId == type(IDecentAutonomousAdmin).interfaceId ||
super.supportsInterface(interfaceId);
}

// //////////////////////////////////////////////////////////////
// Internal Functions
// //////////////////////////////////////////////////////////////
Expand Down
21 changes: 21 additions & 0 deletions contracts/interfaces/IDecentAutonomousAdmin.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.28;

import {IHats} from "./hats/full/IHats.sol";
import {ISablierV2Lockup} from "./sablier/full/ISablierV2Lockup.sol";

interface IDecentAutonomousAdmin {
struct SablierStreamInfo {
uint256 streamId;
ISablierV2Lockup sablierV2Lockup;
}

struct TriggerStartArgs {
address currentWearer;
IHats userHatProtocol;
uint256 userHatId;
address nominatedWearer;
}

function triggerStartNextTerm(TriggerStartArgs calldata args) external;
}

0 comments on commit 79ac1f4

Please sign in to comment.