This repository was archived by the owner on Apr 24, 2025. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Introducing 2 new interfaces
IERC721Roles
andIERC721RolesManager
inspired from the feedbacks from ERC-4400: ERC-721 Consumer Extension and ERC721 extension to enable rental.This aims to provide a general framework to define token roles with on-chain guarantees that roles attribution terms are fulfilled.
IERC721Roles
bytes4(keccak256("ERC721Roles::Renter"))
.roleGranted
to check whether a user has been granted a specific role.IERC721RolesManager
contract, that is set at the tokenId level. Note that we could have implementations where the role manager contract is defined at the ERC721 contract level to guarantee that roles definitions are consistent across each token.owner
is never changed and can be updated independently from the rolesIERC721RolesManager
afterRoleRevoked
andafterRoleGranted
when someone tries to update a role.IERC721RolesManager.afterRolesManagerRemoved
so that the manager can revert if a role agreement is ongoing.Examples:
See
ERC721Roles
andERC721RolesRentalAgreement
for examples of implementation.The later is a simple contract to allow NFT rental by granting Renter role
IERC721Roles & IERC721RolesManager interactions
