From ae5e874d5b4881c040e92f3de64c88933a08a59b Mon Sep 17 00:00:00 2001 From: Anders Date: Sun, 1 May 2022 14:37:46 +0800 Subject: [PATCH 1/5] Mark ERC-4907 for Review --- EIPS/eip-4907.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-4907.md b/EIPS/eip-4907.md index 7e8729e83d5983..5322b9b3e6ee0b 100755 --- a/EIPS/eip-4907.md +++ b/EIPS/eip-4907.md @@ -4,7 +4,7 @@ title: Rental NFT, ERC-721 User And Expires Extension description: Add a time-limited role with restricted permissions to ERC-721 tokens. author: Anders (@0xanders), Lance (@LanceSnow), Shrug discussions-to: https://ethereum-magicians.org/t/idea-erc-721-user-and-expires-extension/8572 -status: Draft +status: Review type: Standards Track category: ERC created: 2022-03-11 From 8b0e18bbb3ab66c134bbea541fdc4852e91dacdc Mon Sep 17 00:00:00 2001 From: Anders Date: Tue, 17 May 2022 12:14:40 +0800 Subject: [PATCH 2/5] optimize for gas saving --- EIPS/eip-4907.md | 5 ++--- assets/eip-4907/.gitignore | 2 ++ assets/eip-4907/contracts/ERC4907.sol | 7 +++---- 3 files changed, 7 insertions(+), 7 deletions(-) create mode 100644 assets/eip-4907/.gitignore diff --git a/EIPS/eip-4907.md b/EIPS/eip-4907.md index dd38f96f1c9f5b..5bcb02faf7b91c 100755 --- a/EIPS/eip-4907.md +++ b/EIPS/eip-4907.md @@ -232,9 +232,8 @@ contract ERC4907 is ERC721, IERC4907 { ) internal virtual override{ super._beforeTokenTransfer(from, to, tokenId); - if (from != to) { - _users[tokenId].user = address(0); - _users[tokenId].expires = 0; + if (from != to && _users[tokenId].user != address(0)) { + delete _users[tokenId]; emit UpdateUser(tokenId, address(0), 0); } } diff --git a/assets/eip-4907/.gitignore b/assets/eip-4907/.gitignore new file mode 100644 index 00000000000000..504afef81fbadc --- /dev/null +++ b/assets/eip-4907/.gitignore @@ -0,0 +1,2 @@ +node_modules/ +package-lock.json diff --git a/assets/eip-4907/contracts/ERC4907.sol b/assets/eip-4907/contracts/ERC4907.sol index 707cf0f63b9c62..ad65ae4ca844f9 100644 --- a/assets/eip-4907/contracts/ERC4907.sol +++ b/assets/eip-4907/contracts/ERC4907.sol @@ -64,10 +64,9 @@ contract ERC4907 is ERC721, IERC4907 { ) internal virtual override{ super._beforeTokenTransfer(from, to, tokenId); - if (from != to) { - _users[tokenId].user = address(0); - _users[tokenId].expires = 0; - emit UpdateUser(tokenId,address(0),0); + if (from != to && _users[tokenId].user != address(0)) { + delete _users[tokenId]; + emit UpdateUser(tokenId, address(0), 0); } } } From 8bc2306f7d495167c482d9d7c21a12446cb315f4 Mon Sep 17 00:00:00 2001 From: Anders Date: Tue, 17 May 2022 12:37:45 +0800 Subject: [PATCH 3/5] Change status to Last Call --- EIPS/eip-4907.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/EIPS/eip-4907.md b/EIPS/eip-4907.md index 5bcb02faf7b91c..7f1f5caa33d085 100755 --- a/EIPS/eip-4907.md +++ b/EIPS/eip-4907.md @@ -4,7 +4,7 @@ title: Rental NFT, ERC-721 User And Expires Extension description: Add a time-limited role with restricted permissions to ERC-721 tokens. author: Anders (@0xanders), Lance (@LanceSnow), Shrug discussions-to: https://ethereum-magicians.org/t/idea-erc-721-user-and-expires-extension/8572 -status: Review +status: Last Call type: Standards Track category: ERC created: 2022-03-11 From 95f269ae7f9d48425f3b7ad1c8c9be37f26dd5fa Mon Sep 17 00:00:00 2001 From: Anders Date: Tue, 17 May 2022 23:34:21 +0800 Subject: [PATCH 4/5] Change ERC721 to ERC-721 --- EIPS/eip-4907.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/EIPS/eip-4907.md b/EIPS/eip-4907.md index 7f1f5caa33d085..b6aa7b06298ff0 100755 --- a/EIPS/eip-4907.md +++ b/EIPS/eip-4907.md @@ -87,9 +87,9 @@ In the spirit of permission less interoperability, this standard makes it easier ## Backwards Compatibility -As mentioned in the specifications section, this standard can be fully ERC721 compatible by adding an extension function set. +As mentioned in the specifications section, this standard can be fully ERC-721 compatible by adding an extension function set. -In addition, new functions introduced in this standard have many similarities with the existing functions in ERC721. This allows developers to easily adopt the standard quickly. +In addition, new functions introduced in this standard have many similarities with the existing functions in ERC-721. This allows developers to easily adopt the standard quickly. ## Test Cases From fbd686b963229689bc19815dd459d8dd43daf7fa Mon Sep 17 00:00:00 2001 From: Anders Date: Thu, 26 May 2022 21:48:26 +0800 Subject: [PATCH 5/5] add last-call-deadline --- EIPS/eip-4907.md | 1 + 1 file changed, 1 insertion(+) diff --git a/EIPS/eip-4907.md b/EIPS/eip-4907.md index b6aa7b06298ff0..6e322b2b70e447 100755 --- a/EIPS/eip-4907.md +++ b/EIPS/eip-4907.md @@ -5,6 +5,7 @@ description: Add a time-limited role with restricted permissions to ERC-721 toke author: Anders (@0xanders), Lance (@LanceSnow), Shrug discussions-to: https://ethereum-magicians.org/t/idea-erc-721-user-and-expires-extension/8572 status: Last Call +last-call-deadline: 2022-06-14 type: Standards Track category: ERC created: 2022-03-11