From 265c7071bcbde79afb2ba83731e8b7e8992aac27 Mon Sep 17 00:00:00 2001 From: Vectorized Date: Sun, 31 Jul 2022 14:37:08 +0000 Subject: [PATCH 1/2] Add overrides to ERC4907 --- contracts/extensions/ERC4907A.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/extensions/ERC4907A.sol b/contracts/extensions/ERC4907A.sol index 33294a470..e11f6c281 100644 --- a/contracts/extensions/ERC4907A.sol +++ b/contracts/extensions/ERC4907A.sol @@ -37,7 +37,7 @@ abstract contract ERC4907A is ERC721A, IERC4907A { uint256 tokenId, address user, uint64 expires - ) public virtual { + ) public override virtual { // Require the caller to be either the token owner or an approved operator. address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) @@ -53,7 +53,7 @@ abstract contract ERC4907A is ERC721A, IERC4907A { * @dev Returns the user address for `tokenId`. * The zero address indicates that there is no user or if the user is expired. */ - function userOf(uint256 tokenId) public view virtual returns (address) { + function userOf(uint256 tokenId) public view override virtual returns (address) { uint256 packed = _packedUserInfo[tokenId]; assembly { // Branchless `packed *= (block.timestamp <= expires ? 1 : 0)`. @@ -71,7 +71,7 @@ abstract contract ERC4907A is ERC721A, IERC4907A { /** * @dev Returns the user's expires of `tokenId`. */ - function userExpires(uint256 tokenId) public view virtual returns (uint256) { + function userExpires(uint256 tokenId) public view override virtual returns (uint256) { return _packedUserInfo[tokenId] >> _BITPOS_EXPIRES; } From 257d371ab70d19e6ba90ea26d8382e0ce3560893 Mon Sep 17 00:00:00 2001 From: Vectorized Date: Sun, 31 Jul 2022 14:46:50 +0000 Subject: [PATCH 2/2] Swap order of modifiers --- contracts/extensions/ERC4907A.sol | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/extensions/ERC4907A.sol b/contracts/extensions/ERC4907A.sol index e11f6c281..f8af14025 100644 --- a/contracts/extensions/ERC4907A.sol +++ b/contracts/extensions/ERC4907A.sol @@ -37,7 +37,7 @@ abstract contract ERC4907A is ERC721A, IERC4907A { uint256 tokenId, address user, uint64 expires - ) public override virtual { + ) public virtual override { // Require the caller to be either the token owner or an approved operator. address owner = ownerOf(tokenId); if (_msgSenderERC721A() != owner) @@ -53,7 +53,7 @@ abstract contract ERC4907A is ERC721A, IERC4907A { * @dev Returns the user address for `tokenId`. * The zero address indicates that there is no user or if the user is expired. */ - function userOf(uint256 tokenId) public view override virtual returns (address) { + function userOf(uint256 tokenId) public view virtual override returns (address) { uint256 packed = _packedUserInfo[tokenId]; assembly { // Branchless `packed *= (block.timestamp <= expires ? 1 : 0)`. @@ -71,7 +71,7 @@ abstract contract ERC4907A is ERC721A, IERC4907A { /** * @dev Returns the user's expires of `tokenId`. */ - function userExpires(uint256 tokenId) public view override virtual returns (uint256) { + function userExpires(uint256 tokenId) public view virtual override returns (uint256) { return _packedUserInfo[tokenId] >> _BITPOS_EXPIRES; }