mirror of
https://github.com/th30d4y/OpenLearnX.git
synced 2026-05-26 19:26:33 +00:00
Fix .gitignore: stop tracking ignored files
This commit is contained in:
+43
@@ -0,0 +1,43 @@
|
||||
// SPDX-License-Identifier: MIT
|
||||
// OpenZeppelin Contracts (last updated v4.9.0) (utils/introspection/ERC1820Implementer.sol)
|
||||
|
||||
pragma solidity ^0.8.0;
|
||||
|
||||
import "./IERC1820Implementer.sol";
|
||||
|
||||
/**
|
||||
* @dev Implementation of the {IERC1820Implementer} interface.
|
||||
*
|
||||
* Contracts may inherit from this and call {_registerInterfaceForAddress} to
|
||||
* declare their willingness to be implementers.
|
||||
* {IERC1820Registry-setInterfaceImplementer} should then be called for the
|
||||
* registration to be complete.
|
||||
*
|
||||
* CAUTION: This file is deprecated as of v4.9 and will be removed in the next major release.
|
||||
*/
|
||||
contract ERC1820Implementer is IERC1820Implementer {
|
||||
bytes32 private constant _ERC1820_ACCEPT_MAGIC = keccak256("ERC1820_ACCEPT_MAGIC");
|
||||
|
||||
mapping(bytes32 => mapping(address => bool)) private _supportedInterfaces;
|
||||
|
||||
/**
|
||||
* @dev See {IERC1820Implementer-canImplementInterfaceForAddress}.
|
||||
*/
|
||||
function canImplementInterfaceForAddress(
|
||||
bytes32 interfaceHash,
|
||||
address account
|
||||
) public view virtual override returns (bytes32) {
|
||||
return _supportedInterfaces[interfaceHash][account] ? _ERC1820_ACCEPT_MAGIC : bytes32(0x00);
|
||||
}
|
||||
|
||||
/**
|
||||
* @dev Declares the contract as willing to be an implementer of
|
||||
* `interfaceHash` for `account`.
|
||||
*
|
||||
* See {IERC1820Registry-setInterfaceImplementer} and
|
||||
* {IERC1820Registry-interfaceHash}.
|
||||
*/
|
||||
function _registerInterfaceForAddress(bytes32 interfaceHash, address account) internal virtual {
|
||||
_supportedInterfaces[interfaceHash][account] = true;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user