As part of AGIP-94, this PR aims to enable Aavegotchi Wearable Rentals using a role-based delegation feature. In this implementation, users intending to rent wearables would go through the following flow:
NFT owner calls the grantRoleFrom function to delegate their wearables to a given user (Borrower). The NFTs are deposited in the Aavegotchi Diamond contract with no association with any given Aavegotchi.
The Borrower calls the new equipDelegatedWearables function to equip delegated wearables on an Aavegotchi they own. Since the NFT is already deposited, this step only creates the Wearable<>Aavegotchi association.
After the expiration date, the owner can withdraw the wearables back, or delegate to a new user.
As part of AGIP-94, this PR aims to enable Aavegotchi Wearable Rentals using a role-based delegation feature. In this implementation, users intending to rent wearables would go through the following flow:
grantRoleFrom
function to delegate their wearables to a given user (Borrower). The NFTs are deposited in the Aavegotchi Diamond contract with no association with any given Aavegotchi.equipDelegatedWearables
function to equip delegated wearables on an Aavegotchi they own. Since the NFT is already deposited, this step only creates the Wearable<>Aavegotchi association.After the expiration date, the owner can withdraw the wearables back, or delegate to a new user.
The Implementation features:
ItemsRolesRegistryFacet.sol
).equipDelegatedWearables
function, responsible to allow borrowers to equip rented wearables.revokeRolefrom
function that allows NFT Owners to withdraw rented wearables.