浏览代码

make ERC2981:royaltyInfo public (#3305)

(cherry picked from commit d2832ca7a9096afa77a7c5b669292c0ca5f3ddb7)
Signed-off-by: Hadrien Croubois <hadrien.croubois@gmail.com>
Hadrien Croubois 3 年之前
父节点
当前提交
ab54fcb70b
共有 2 个文件被更改,包括 2 次插入7 次删除
  1. 1 0
      CHANGELOG.md
  2. 1 7
      contracts/token/common/ERC2981.sol

+ 1 - 0
CHANGELOG.md

@@ -21,6 +21,7 @@
  * `TimelockController`: Add a separate canceller role for the ability to cancel. ([#3165](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3165))
  * `Initializable`: add a reinitializer modifier that enables the initialization of new modules, added to already initialized contracts through upgradeability. ([#3232](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3232))
  * `Initializable`: add an Initialized event that tracks initialized version numbers. ([#3294](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3294))
+ * `ERC2981`: make `royaltiInfo` public to allow super call in overrides. ([#3305](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3305))
 
 ### Breaking changes
 

+ 1 - 7
contracts/token/common/ERC2981.sol

@@ -40,13 +40,7 @@ abstract contract ERC2981 is IERC2981, ERC165 {
     /**
      * @inheritdoc IERC2981
      */
-    function royaltyInfo(uint256 _tokenId, uint256 _salePrice)
-        external
-        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)) {