Skip to content

Commit

Permalink
add ERC165Checker for supportsInterface
Browse files Browse the repository at this point in the history
  • Loading branch information
zuies committed Jun 17, 2024
1 parent 8080ece commit 023074d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion contracts/Engagement.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ pragma solidity 0.8.26;
import "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import "@openzeppelin/contracts/access/AccessControl.sol";
import "@openzeppelin/contracts/utils/Strings.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "./IEngagement.sol";

contract Engagement is IEngagement, ERC1155, AccessControl {
using ERC165Checker for address;

uint private _counter;
bytes32 public constant PROVIDER_ROLE = keccak256("PROVIDER_ROLE");

Expand Down Expand Up @@ -99,7 +102,10 @@ contract Engagement is IEngagement, ERC1155, AccessControl {
function supportsInterface(
bytes4 interfaceId
) public view override(AccessControl, ERC1155) returns (bool) {
return super.supportsInterface(interfaceId);
if (address(this).supportsERC165()) {
return super.supportsInterface(interfaceId);
}
return false;
}

function uri(
Expand Down

0 comments on commit 023074d

Please sign in to comment.