IOperatorFilterRegistry
IOperatorFilterRegistry
isOperatorAllowed
function isOperatorAllowed(address registrant, address operator) external view returns (bool)
Returns true if operator is not filtered for a given token, either by address or codeHash. Also returns true if supplied registrant address is not registered.
register
function register(address registrant) external
Registers an address with the registry. May be called by address itself or by EIP-173 owner.
registerAndSubscribe
function registerAndSubscribe(address registrant, address subscription) external
Registers an address with the registry and "subscribes" to another address's filtered operators and codeHashes.
registerAndCopyEntries
function registerAndCopyEntries(address registrant, address registrantToCopy) external
Registers an address with the registry and copies the filtered operators and codeHashes from another address without subscribing.
unregister
function unregister(address addr) external
Unregisters an address with the registry and removes its subscription. May be called by address itself or by EIP-173 owner. Note that this does not remove any filtered addresses or codeHashes. Also note that any subscriptions to this registrant will still be active and follow the existing filtered addresses and codehashes.
updateOperator
function updateOperator(address registrant, address operator, bool filtered) external
Update an operator address for a registered address - when filtered is true, the operator is filtered.
updateOperators
function updateOperators(address registrant, address[] operators, bool filtered) external
Update multiple operators for a registered address - when filtered is true, the operators will be filtered. Reverts on duplicates.
updateCodeHash
function updateCodeHash(address registrant, bytes32 codehash, bool filtered) external
Update a codeHash for a registered address - when filtered is true, the codeHash is filtered.
updateCodeHashes
function updateCodeHashes(address registrant, bytes32[] codeHashes, bool filtered) external
Update multiple codeHashes for a registered address - when filtered is true, the codeHashes will be filtered. Reverts on duplicates.
subscribe
function subscribe(address registrant, address registrantToSubscribe) external
Subscribe an address to another registrant's filtered operators and codeHashes. Will remove previous subscription if present. Note that accounts with subscriptions may go on to subscribe to other accounts - in this case, subscriptions will not be forwarded. Instead the former subscription's existing entries will still be used.
unsubscribe
function unsubscribe(address registrant, bool copyExistingEntries) external
Unsubscribe an address from its current subscribed registrant, and optionally copy its filtered operators and codeHashes.
subscriptionOf
function subscriptionOf(address addr) external returns (address registrant)
Get the subscription address of a given registrant, if any.
subscribers
function subscribers(address registrant) external returns (address[])
Get the set of addresses subscribed to a given registrant. Note that order is not guaranteed as updates are made.
subscriberAt
function subscriberAt(address registrant, uint256 index) external returns (address)
Get the subscriber at a given index in the set of addresses subscribed to a given registrant. Note that order is not guaranteed as updates are made.
copyEntriesOf
function copyEntriesOf(address registrant, address registrantToCopy) external
Copy filtered operators and codeHashes from a different registrantToCopy to addr.
isOperatorFiltered
function isOperatorFiltered(address registrant, address operator) external returns (bool)
Returns true if operator is filtered by a given address or its subscription.
isCodeHashOfFiltered
function isCodeHashOfFiltered(address registrant, address operatorWithCode) external returns (bool)
Returns true if the hash of an address's code is filtered by a given address or its subscription.
isCodeHashFiltered
function isCodeHashFiltered(address registrant, bytes32 codeHash) external returns (bool)
Returns true if a codeHash is filtered by a given address or its subscription.
filteredOperators
function filteredOperators(address addr) external returns (address[])
Returns a list of filtered operators for a given address or its subscription.
filteredCodeHashes
function filteredCodeHashes(address addr) external returns (bytes32[])
Returns the set of filtered codeHashes for a given address or its subscription. Note that order is not guaranteed as updates are made.
filteredOperatorAt
function filteredOperatorAt(address registrant, uint256 index) external returns (address)
Returns the filtered operator at the given index of the set of filtered operators for a given address or its subscription. Note that order is not guaranteed as updates are made.
filteredCodeHashAt
function filteredCodeHashAt(address registrant, uint256 index) external returns (bytes32)
Returns the filtered codeHash at the given index of the list of filtered codeHashes for a given address or its subscription. Note that order is not guaranteed as updates are made.
isRegistered
function isRegistered(address addr) external returns (bool)
Returns true if an address has registered
codeHashOf
function codeHashOf(address addr) external returns (bytes32)
Convenience method to compute the code hash of an arbitrary contract