From 253f10f448b12afdfb84f86bdff2fefdbf126012 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 31 Mar 2022 10:24:35 +0200 Subject: [PATCH 1/3] Make ERC2981:royaltyInfo public --- CHANGELOG.md | 3 +++ contracts/token/common/ERC2981.sol | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5fbf6f5cd3d..0b97f43c9f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## Unreleased + * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. + ## Unreleased * `AccessControl`: add a virtual `_checkRole(bytes32)` function that can be overridden to alter the `onlyRole` modifier behavior. ([#3137](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3137)) diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index 90d7ed34a5f..2fa82fd52d9 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -41,7 +41,7 @@ abstract contract ERC2981 is IERC2981, ERC165 { * @inheritdoc IERC2981 */ function royaltyInfo(uint256 _tokenId, uint256 _salePrice) - external + public view virtual override From c38dc616e34668c7357b541fafe26e7f8ec886fc Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 31 Mar 2022 10:25:34 +0200 Subject: [PATCH 2/3] update changelog entry --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b97f43c9f0..12af6a3800a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog ## Unreleased - * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. + * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305)) ## Unreleased From 38e5199465071ac297750555368b8b49e54e0138 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Thu, 31 Mar 2022 10:27:16 +0200 Subject: [PATCH 3/3] fix lint --- contracts/token/common/ERC2981.sol | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/contracts/token/common/ERC2981.sol b/contracts/token/common/ERC2981.sol index 2fa82fd52d9..cee7cb09faf 100644 --- a/contracts/token/common/ERC2981.sol +++ b/contracts/token/common/ERC2981.sol @@ -40,13 +40,7 @@ abstract contract ERC2981 is IERC2981, ERC165 { /** * @inheritdoc IERC2981 */ - function royaltyInfo(uint256 _tokenId, uint256 _salePrice) - public - view - virtual - override - returns (address, uint256) - { + function royaltyInfo(uint256 _tokenId, uint256 _salePrice) public view virtual override returns (address, uint256) { RoyaltyInfo memory royalty = _tokenRoyaltyInfo[_tokenId]; if (royalty.receiver == address(0)) {