RentalMarket
A rental marketplace allowing instant daily rentals for Rentable or any other NFT which implements the EIP4907 standard.
Token owners can list their NFT tokens for rent, specify the desired fees and terms, and the marketplace takes care of designating users as well as collecting and distributing rental fees to token owners.
In addition, RentalMarket supports EIP2981 and distributes a royalty fee on all rentals back to the creator.
Getting Started Module Methods Smart Contract Methods
Getting Started
To begin we'll import the FrostySDK, chain configurations, and the RentalMarket module.
Then we'll setup our signer (via wagmi/ethers) and create a new instance of the FrostySDK.
Module Methods
getContract Get an ethers contract instance of the RentalMarket contract.
getContract
Get an ethers contract instance of the RentalMarket contract.
sdk (SDK) An instance of the FrostySDK, configured with a chain and signer.
Smart Contract Methods
setRentable Set the listing status, fees, and terms for a specified token.
getRentable Get the listing status, fees, and terms for a specified token.
toggleListed Toggle the listing status for a specified token.
rent Rent a listed token for a specified number of days.
setRentable
Set the listing status, fees, and terms for a specified token.
_nft (address) The address of an NFT which implements the EIP4907 standard.
_tokenId (uint256) The id of the token.
_isListed (bool) A flag indicating whether the token is currently listed for rentals.
_pricePerDay (uint256) The price (in Wei) per day to rent the token.
_minDays (uint16) The minimum acceptable number of days which a renter may specify for rental duration.
_maxDays (uint16) The maxium acceptable number of days which a renter may specify for rental duration.
getRentable
Get the listing status, fees, and terms for a specified token.
_nft (address) The address of the NFT.
_tokenId (uint256) The id of the token.
toggleListed
Toggle the listing status for a specified token.
rent
Rent a listed token for a specified number of days.
_nft (address) The address of the NFT.
_tokenId (uint256) The id of the token.
_days (uint16) The number of days to rent the specified token.
Last updated