You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tag:
Branch:
Tree:
d75b4cf613
audit/2023-03
audit/2023-06
audit/2023-07-10
audit/2023-07-24
audit/2023-08-01
audit/2023-08-07
audit/M-01
audits/5.1
docs-org
docs-v2.x
docs-v3.x
docs-v4.x
docs-v5.x
eof
features/full-math
formal-verification
frangio-patch-1
frangio-patch-2
fv/ERC20Votes
fv/Governor
master
next-v5.0
release-v2.3.0
release-v2.4.0
release-v2.5.0
release-v3.0.0
release-v3.1.0
release-v3.2.0
release-v3.2.0-solc-0.7
release-v3.3
release-v3.3-solc-0.7
release-v3.4
release-v3.4-solc-0.7
release-v4.0
release-v4.1
release-v4.2
release-v4.3
release-v4.4
release-v4.5
release-v4.6
release-v4.7
release-v4.8
release-v4.9
release-v5.0
release-v5.1
release-v5.2
renovate/certora-cli-7.x
renovate/lock-file-maintenance
renovate/major-linters
renovate/npm-undici-vulnerability
solc-0.6
solc-0.7
test/linearization
transient/access-manager-execution-id
typo-fixes
update/certora-7.3.0
v1.0.0
v1.0.1
v1.0.2
v1.0.3
v1.0.4
v1.0.5
v1.0.6
v1.0.7
v1.1.0
v1.10.0
v1.11.0
v1.11.0-rc.1
v1.12.0
v1.12.0-rc.1
v1.12.0-rc.2
v1.2.0
v1.3.0
v1.4.0
v1.5.0
v1.6.0
v1.7.0
v1.8.0
v1.9.0
v1.9.1
v1.9.2
v1.9.3
v1.9.4
v2.0.0
v2.0.0-rc.1
v2.0.0-rc.2
v2.0.0-rc.3
v2.0.0-rc.4
v2.0.1
v2.0.2
v2.1.0-rc.1
v2.1.0-rc.2
v2.1.1
v2.1.2
v2.1.3
v2.2.0
v2.2.0-rc.1
v2.2.1
v2.2.2
v2.2.3
v2.3.0
v2.3.0-rc.0
v2.3.0-rc.1
v2.3.0-rc.2
v2.3.0-rc.3
v2.4.0
v2.4.0-beta.0
v2.4.0-beta.1
v2.4.0-beta.2
v2.5.0
v2.5.0-rc.0
v2.5.1
v3.0.0
v3.0.0-beta.0
v3.0.0-rc.0
v3.0.0-rc.1
v3.0.1
v3.0.2
v3.1.0
v3.1.0-rc.0
v3.1.0-solc-0.7
v3.2.0
v3.2.0-rc.0
v3.2.1-solc-0.7
v3.2.2-solc-0.7
v3.3.0
v3.3.0-rc.0
v3.3.0-rc.1
v3.3.0-rc.2
v3.3.0-solc-0.7
v3.4.0
v3.4.0-rc.0
v3.4.0-solc-0.7
v3.4.1
v3.4.1-solc-0.7
v3.4.1-solc-0.7-2
v3.4.2
v3.4.2-solc-0.7
v4.0.0
v4.0.0-beta.0
v4.0.0-beta.1
v4.0.0-rc.0
v4.1.0
v4.1.0-rc.0
v4.2.0
v4.2.0-rc.0
v4.3.0
v4.3.0-rc.0
v4.3.1
v4.3.2
v4.3.3
v4.4.0
v4.4.0-rc.0
v4.4.0-rc.1
v4.4.1
v4.4.2
v4.5.0
v4.5.0-rc.0
v4.5.1
v4.5.2
v4.6.0
v4.6.0-rc.0
v4.7.0
v4.7.0-rc.0
v4.7.1
v4.7.2
v4.7.3
v4.8.0
v4.8.0-rc.0
v4.8.0-rc.1
v4.8.0-rc.2
v4.8.1
v4.8.2
v4.8.3
v4.9.0
v4.9.0-rc.0
v4.9.0-rc.1
v4.9.1
v4.9.2
v4.9.3
v4.9.4
v4.9.5
v4.9.6
v5.0.0
v5.0.0-rc.0
v5.0.0-rc.1
v5.0.0-rc.2
v5.0.1
v5.0.2
v5.1.0
v5.1.0-rc.0
v5.1.0-rc.1
v5.2.0
v5.2.0-rc.0
v5.2.0-rc.1
${ noResults }
112 lines
4.6 KiB
112 lines
4.6 KiB
|
// SPDX-License-Identifier: MIT
|
||
|
|||
pragma solidity ^0.8.0;
|
|||
|
|||
/**
|
|||
* @dev Interface of the global ERC1820 Registry, as defined in the
|
|||
* https://eips.ethereum.org/EIPS/eip-1820[EIP]. Accounts may register
|
|||
* implementers for interfaces in this registry, as well as query support.
|
|||
*
|
|||
* Implementers may be shared by multiple accounts, and can also implement more
|
|||
* than a single interface for each account. Contracts can implement interfaces
|
|||
* for themselves, but externally-owned accounts (EOA) must delegate this to a
|
|||
* contract.
|
|||
*
|
|||
* {IERC165} interfaces can also be queried via the registry.
|
|||
*
|
|||
* For an in-depth explanation and source code analysis, see the EIP text.
|
|||
*/
|
|||
interface IERC1820Registry {
|
|||
/**
|
|||
* @dev Sets `newManager` as the manager for `account`. A manager of an
|
|||
* account is able to set interface implementers for it.
|
|||
*
|
|||
* By default, each account is its own manager. Passing a value of `0x0` in
|
|||
* `newManager` will reset the manager to this initial state.
|
|||
*
|
|||
* Emits a {ManagerChanged} event.
|
|||
*
|
|||
* Requirements:
|
|||
*
|
|||
* - the caller must be the current manager for `account`.
|
|||
*/
|
|||
function setManager(address account, address newManager) external;
|
|||
|
|||
/**
|
|||
* @dev Returns the manager for `account`.
|
|||
*
|
|||
* See {setManager}.
|
|||
*/
|
|||
function getManager(address account) external view returns (address);
|
|||
|
|||
/**
|
|||
|
* @dev Sets the `implementer` contract as ``account``'s implementer for
|
||
* `interfaceHash`.
|
|||
*
|
|||
* `account` being the zero address is an alias for the caller's address.
|
|||
* The zero address can also be used in `implementer` to remove an old one.
|
|||
*
|
|||
* See {interfaceHash} to learn how these are created.
|
|||
*
|
|||
* Emits an {InterfaceImplementerSet} event.
|
|||
*
|
|||
* Requirements:
|
|||
*
|
|||
* - the caller must be the current manager for `account`.
|
|||
* - `interfaceHash` must not be an {IERC165} interface id (i.e. it must not
|
|||
* end in 28 zeroes).
|
|||
* - `implementer` must implement {IERC1820Implementer} and return true when
|
|||
* queried for support, unless `implementer` is the caller. See
|
|||
* {IERC1820Implementer-canImplementInterfaceForAddress}.
|
|||
*/
|
|||
|
function setInterfaceImplementer(address account, bytes32 _interfaceHash, address implementer) external;
|
||
|
|||
/**
|
|||
* @dev Returns the implementer of `interfaceHash` for `account`. If no such
|
|||
* implementer is registered, returns the zero address.
|
|||
*
|
|||
* If `interfaceHash` is an {IERC165} interface id (i.e. it ends with 28
|
|||
* zeroes), `account` will be queried for support of it.
|
|||
*
|
|||
* `account` being the zero address is an alias for the caller's address.
|
|||
*/
|
|||
|
function getInterfaceImplementer(address account, bytes32 _interfaceHash) external view returns (address);
|
||
|
|||
/**
|
|||
* @dev Returns the interface hash for an `interfaceName`, as defined in the
|
|||
* corresponding
|
|||
* https://eips.ethereum.org/EIPS/eip-1820#interface-name[section of the EIP].
|
|||
*/
|
|||
function interfaceHash(string calldata interfaceName) external pure returns (bytes32);
|
|||
|
|||
/**
|
|||
* @notice Updates the cache with whether the contract implements an ERC165 interface or not.
|
|||
* @param account Address of the contract for which to update the cache.
|
|||
* @param interfaceId ERC165 interface for which to update the cache.
|
|||
*/
|
|||
function updateERC165Cache(address account, bytes4 interfaceId) external;
|
|||
|
|||
/**
|
|||
* @notice Checks whether a contract implements an ERC165 interface or not.
|
|||
* If the result is not cached a direct lookup on the contract address is performed.
|
|||
* If the result is not cached or the cached value is out-of-date, the cache MUST be updated manually by calling
|
|||
* {updateERC165Cache} with the contract address.
|
|||
* @param account Address of the contract to check.
|
|||
* @param interfaceId ERC165 interface to check.
|
|||
* @return True if `account` implements `interfaceId`, false otherwise.
|
|||
*/
|
|||
function implementsERC165Interface(address account, bytes4 interfaceId) external view returns (bool);
|
|||
|
|||
/**
|
|||
* @notice Checks whether a contract implements an ERC165 interface or not without using nor updating the cache.
|
|||
* @param account Address of the contract to check.
|
|||
* @param interfaceId ERC165 interface to check.
|
|||
* @return True if `account` implements `interfaceId`, false otherwise.
|
|||
*/
|
|||
function implementsERC165InterfaceNoCache(address account, bytes4 interfaceId) external view returns (bool);
|
|||
|
|||
event InterfaceImplementerSet(address indexed account, bytes32 indexed interfaceHash, address indexed implementer);
|
|||
|
|||
event ManagerChanged(address indexed account, address indexed newManager);
|
|||
}
|