IERC4907
Author: mortimr @ Kiln
Allows NFT owners to rent without changing the NFT ownership, only renting the utility of the NFT
Functions
setUser
Set the user and expires of an NFT. Once the rent is defined, only the rentee can edit or revoke the rent
function setUser(uint256 tokenId, address user, uint64 expires) external;
Parameters
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The id of the token to rent |
user | address | The new user of the NFT |
expires | uint64 | UNIX timestamp, The new user could use the NFT before expires |
userOf
Get the user address of an NFT
The zero address indicates that there is no user or the user is expired
function userOf(uint256 tokenId) external view returns (address);
Parameters
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The NFT to get the user address for |
Returns
| Name | Type | Description |
|---|---|---|
<none> | address | The user address for this NFT |
userExpires
Get the user expires of an NFT
The zero value indicates that there is no user
function userExpires(uint256 tokenId) external view returns (uint256);
Parameters
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The NFT to get the user expires for |
Returns
| Name | Type | Description |
|---|---|---|
<none> | uint256 | The user expires for this NFT |
Events
UpdateUser
Emitted when the user of an NFT or the expires of the user is changed
event UpdateUser(uint256 indexed tokenId, address indexed user, uint64 expires);
Parameters
| Name | Type | Description |
|---|---|---|
tokenId | uint256 | The ID of the token |
user | address | The new user of the token |
expires | uint64 | The expiration timestamp of the rental |