diff --git a/src/Core.sol b/src/Core.sol index 5c229acf..74180a6e 100644 --- a/src/Core.sol +++ b/src/Core.sol @@ -150,6 +150,10 @@ abstract contract Core is ICore, OwnableRoles, ReentrancyGuard { if (interfaceId == 0xffffffff) { return false; } + if (interfaceId == 0x01ffc9a7) { + // ERC165 Interface ID for ERC165 + return true; + } if (supportedInterfaceRefCounter[interfaceId] > 0) { return true; } diff --git a/src/module/token/royalty/RoyaltyERC1155.sol b/src/module/token/royalty/RoyaltyERC1155.sol index 60b5a68a..befdd601 100644 --- a/src/module/token/royalty/RoyaltyERC1155.sol +++ b/src/module/token/royalty/RoyaltyERC1155.sol @@ -45,7 +45,8 @@ contract RoyaltyERC1155 is Module, IInstallationCallback, BeforeTransferCallbackERC1155, - BeforeBatchTransferCallbackERC1155 + BeforeBatchTransferCallbackERC1155, + ICreatorToken { /*////////////////////////////////////////////////////////////// @@ -78,9 +79,6 @@ contract RoyaltyERC1155 is /// @notice Emitted when the royalty info for a specific NFT is updated. event TokenRoyaltyUpdated(uint256 indexed tokenId, address indexed recipient, uint16 bps); - /// @notice Emitted when the transfer validator is updated. - event TransferValidatorUpdated(address oldValidator, address newValidator); - /*////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ @@ -126,8 +124,10 @@ contract RoyaltyERC1155 is config.requiredInterfaces = new bytes4[](1); config.requiredInterfaces[0] = 0xd9b67a26; // ERC1155 - config.supportedInterfaces = new bytes4[](1); + config.supportedInterfaces = new bytes4[](3); config.supportedInterfaces[0] = 0x2a55205a; // IERC2981. + config.supportedInterfaces[1] = 0xad0d7f6c; // ICreatorToken + config.supportedInterfaces[2] = 0xa07d229a; // ICreatorTokenLegacy config.registerInstallationCallback = true; } @@ -245,7 +245,7 @@ contract RoyaltyERC1155 is /// @notice Returns the transfer validator contract address for this token contract. function getTransferValidator() public view returns (address validator) { - return _royaltyStorage().transferValidator; + validator = _royaltyStorage().transferValidator; } /** diff --git a/src/module/token/royalty/RoyaltyERC721.sol b/src/module/token/royalty/RoyaltyERC721.sol index 3ece0b49..ea785620 100644 --- a/src/module/token/royalty/RoyaltyERC721.sol +++ b/src/module/token/royalty/RoyaltyERC721.sol @@ -40,7 +40,13 @@ library RoyaltyStorage { } -contract RoyaltyERC721 is Module, IInstallationCallback, BeforeTransferCallbackERC721 { +contract RoyaltyERC721 is Module, IInstallationCallback, BeforeTransferCallbackERC721, ICreatorToken { + + /*////////////////////////////////////////////////////////////// + CONSTANTS + //////////////////////////////////////////////////////////////*/ + + bytes32 private constant DEFAULT_ACCESS_CONTROL_ADMIN_ROLE = 0x00; /*////////////////////////////////////////////////////////////// CONSTANTS @@ -72,9 +78,6 @@ contract RoyaltyERC721 is Module, IInstallationCallback, BeforeTransferCallbackE /// @notice Emitted when the royalty info for a specific NFT is updated. event TokenRoyaltyUpdated(uint256 indexed tokenId, address indexed recipient, uint16 bps); - /// @notice Emitted when the transfer validator is updated. - event TransferValidatorUpdated(address oldValidator, address newValidator); - /*////////////////////////////////////////////////////////////// ERRORS //////////////////////////////////////////////////////////////*/ @@ -119,8 +122,10 @@ contract RoyaltyERC721 is Module, IInstallationCallback, BeforeTransferCallbackE config.requiredInterfaces = new bytes4[](1); config.requiredInterfaces[0] = 0x80ac58cd; // ERC721. - config.supportedInterfaces = new bytes4[](1); + config.supportedInterfaces = new bytes4[](3); config.supportedInterfaces[0] = 0x2a55205a; // IERC2981. + config.supportedInterfaces[1] = 0xad0d7f6c; // ICreatorToken + config.supportedInterfaces[2] = 0xa07d229a; // ICreatorTokenLegacy config.registerInstallationCallback = true; } @@ -223,7 +228,7 @@ contract RoyaltyERC721 is Module, IInstallationCallback, BeforeTransferCallbackE /// @notice Returns the transfer validator contract address for this token contract. function getTransferValidator() public view returns (address validator) { - return _royaltyStorage().transferValidator; + validator = _royaltyStorage().transferValidator; } /** diff --git a/src/module/token/transferable/CreatorTokenERC20.sol b/src/module/token/transferable/CreatorTokenERC20.sol index 1f04a4a3..93bb56a3 100644 --- a/src/module/token/transferable/CreatorTokenERC20.sol +++ b/src/module/token/transferable/CreatorTokenERC20.sol @@ -83,7 +83,7 @@ contract CreatorTokenERC20 is Module, BeforeTransferCallbackERC20, ICreatorToken /// @notice Returns the transfer validator contract address for this token contract. function getTransferValidator() public view returns (address validator) { - return _creatorTokenStorage().transferValidator; + validator = _creatorTokenStorage().transferValidator; } /** @@ -91,7 +91,7 @@ contract CreatorTokenERC20 is Module, BeforeTransferCallbackERC20, ICreatorToken * @notice for transaction simulation. */ function getTransferValidationFunction() external pure returns (bytes4 functionSignature, bool isViewFunction) { - functionSignature = bytes4(keccak256("validateTransfer(address,address,address,uint256, uint256)")); + functionSignature = bytes4(keccak256("validateTransfer(address,address,address,uint256,uint256)")); isViewFunction = true; }