Skip to content

Commit

Permalink
refactor: snekmate supported interface (#41)
Browse files Browse the repository at this point in the history
* refactor: reuse eip165 logic from snekmate

* style: reorder storage var
  • Loading branch information
AlbertoCentonze authored Oct 18, 2024
1 parent fdf2285 commit 11c78c4
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 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 All @@ -121,16 +119,14 @@ _SUPPORTED_INTERFACES: constant(bytes4[3]) = [

stablecoin: immutable(IERC20)
vault: public(immutable(IVault))
stablecoin_lens: public(IStablecoinLens)

# scaling factor for the deposited token / circulating supply ratio.
scaling_factor: public(uint256)

# the minimum amount of rewards requested to the FeeSplitter.
minimum_weight: public(uint256)

# stablecoin circulating supply contract
stablecoin_lens: public(IStablecoinLens)


################################################################
# CONSTRUCTOR #
Expand Down Expand Up @@ -255,7 +251,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 11c78c4

Please sign in to comment.