Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overrides to ERC4907 #397

Merged
merged 2 commits into from
Aug 1, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions contracts/extensions/ERC4907A.sol
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ abstract contract ERC4907A is ERC721A, IERC4907A {
uint256 tokenId,
address user,
uint64 expires
) public virtual {
) public virtual override {
// Require the caller to be either the token owner or an approved operator.
address owner = ownerOf(tokenId);
if (_msgSenderERC721A() != owner)
Expand All @@ -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 virtual override returns (address) {
uint256 packed = _packedUserInfo[tokenId];
assembly {
// Branchless `packed *= (block.timestamp <= expires ? 1 : 0)`.
Expand All @@ -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 virtual override returns (uint256) {
return _packedUserInfo[tokenId] >> _BITPOS_EXPIRES;
}

Expand Down