Skip to content

Commit

Permalink
refactor: reuse eip165 logic from snekmate
Browse files Browse the repository at this point in the history
  • Loading branch information
AlbertoCentonze committed Oct 18, 2024
1 parent fdf2285 commit 1e44d63
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions contracts/RewardsHandler.vy
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ LENS_MANAGER: public(constant(bytes32)) = keccak256("LENS_MANAGER")
WEEK: constant(uint256) = 86_400 * 7 # 7 days
MAX_BPS: constant(uint256) = 10**4 # 100%

_SUPPORTED_INTERFACES: constant(bytes4[3]) = [
0x01FFC9A7, # The ERC-165 identifier for ERC-165.
0x7965DB0B, # The ERC-165 identifier for `IAccessControl`.
_SUPPORTED_INTERFACES: constant(bytes4[1]) = [
0xA1AAB33F, # The ERC-165 identifier for the dynamic weight interface.
]

Expand Down Expand Up @@ -255,7 +253,10 @@ def supportsInterface(interface_id: bytes4) -> bool:
@return bool The verification whether the contract implements the interface or
not.
"""
return interface_id in _SUPPORTED_INTERFACES
return (
interface_id in access_control._SUPPORTED_INTERFACES
or interface_id in _SUPPORTED_INTERFACES
)


@external
Expand Down

0 comments on commit 1e44d63

Please sign in to comment.