Commit 5b8d5eb5 by Francisco Giordano

convert ERC165 to initializers

parent 3a3d2b15
pragma solidity ^0.4.24; pragma solidity ^0.4.24;
import "../Initializable.sol";
import "./IERC165.sol"; import "./IERC165.sol";
...@@ -8,7 +9,7 @@ import "./IERC165.sol"; ...@@ -8,7 +9,7 @@ import "./IERC165.sol";
* @author Matt Condon (@shrugs) * @author Matt Condon (@shrugs)
* @dev Implements ERC165 using a lookup table. * @dev Implements ERC165 using a lookup table.
*/ */
contract ERC165 is IERC165 { contract ERC165 is Initializable, IERC165 {
bytes4 private constant _InterfaceId_ERC165 = 0x01ffc9a7; bytes4 private constant _InterfaceId_ERC165 = 0x01ffc9a7;
/** /**
...@@ -25,8 +26,9 @@ contract ERC165 is IERC165 { ...@@ -25,8 +26,9 @@ contract ERC165 is IERC165 {
* @dev A contract implementing SupportsInterfaceWithLookup * @dev A contract implementing SupportsInterfaceWithLookup
* implement ERC165 itself * implement ERC165 itself
*/ */
constructor() function initialize()
public public
initializer
{ {
_registerInterface(_InterfaceId_ERC165); _registerInterface(_InterfaceId_ERC165);
} }
......
...@@ -4,6 +4,10 @@ import "../introspection/ERC165.sol"; ...@@ -4,6 +4,10 @@ import "../introspection/ERC165.sol";
contract ERC165Mock is ERC165 { contract ERC165Mock is ERC165 {
constructor() public {
ERC165.initialize();
}
function registerInterface(bytes4 interfaceId) function registerInterface(bytes4 interfaceId)
public public
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment