Skip to content

Commit 11c78c4

Browse files
refactor: snekmate supported interface (#41)
* refactor: reuse eip165 logic from snekmate * style: reorder storage var
1 parent fdf2285 commit 11c78c4

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

contracts/RewardsHandler.vy

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,7 @@ LENS_MANAGER: public(constant(bytes32)) = keccak256("LENS_MANAGER")
107107
WEEK: constant(uint256) = 86_400 * 7 # 7 days
108108
MAX_BPS: constant(uint256) = 10**4 # 100%
109109

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

@@ -121,16 +119,14 @@ _SUPPORTED_INTERFACES: constant(bytes4[3]) = [
121119

122120
stablecoin: immutable(IERC20)
123121
vault: public(immutable(IVault))
122+
stablecoin_lens: public(IStablecoinLens)
124123

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

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

131-
# stablecoin circulating supply contract
132-
stablecoin_lens: public(IStablecoinLens)
133-
134130

135131
################################################################
136132
# CONSTRUCTOR #
@@ -255,7 +251,10 @@ def supportsInterface(interface_id: bytes4) -> bool:
255251
@return bool The verification whether the contract implements the interface or
256252
not.
257253
"""
258-
return interface_id in _SUPPORTED_INTERFACES
254+
return (
255+
interface_id in access_control._SUPPORTED_INTERFACES
256+
or interface_id in _SUPPORTED_INTERFACES
257+
)
259258

260259

261260
@external

0 commit comments

Comments
 (0)