IERC4907

Git Source

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

NameTypeDescription
tokenIduint256The id of the token to rent
useraddressThe new user of the NFT
expiresuint64UNIX 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

NameTypeDescription
tokenIduint256The NFT to get the user address for

Returns

NameTypeDescription
<none>addressThe 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

NameTypeDescription
tokenIduint256The NFT to get the user expires for

Returns

NameTypeDescription
<none>uint256The 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

NameTypeDescription
tokenIduint256The ID of the token
useraddressThe new user of the token
expiresuint64The expiration timestamp of the rental