LandWorks
Search…
⌃K

Marketplace

Functions

List

function list(
uint256 _metaverseId,
address _metaverseRegistry,
uint256 _metaverseAssetId,
uint256 _minPeriod,
uint256 _maxPeriod,
uint256 _maxFutureTime,
address _paymentToken,
uint256 _pricePerSecond
) external returns (uint256)
Provides assets of the given metaverse registry for rental. Transfers and locks the provided metaverse asset to the contract and mints an asset, representing the locked asset.
Params
Name
Type
Description
_metaverseId
uint256
The id of the metaverse
_metaverseRegistry
address
The registry of the metaverse
_metaverseAssetId
uint256
The id from the metaverse registry
_minPeriod
uint256
The minimum number of time (in seconds) the asset can be rented
_maxPeriod
uint256
The maximum number of time (in seconds) the asset can be rented
_maxFutureTime
uint256
The timestmap delta after which the protocol will not allow the asset to be rented at any given moment
_paymentToken
address
The token which will be accepted as a form of payment. Provide 0x0000000000000000000000000000000000000001 for ETH
_pricePerSecond
uint256
The price for rental per second

Update Conditions

function updateConditions(
uint256 _assetId,
uint256 _minPeriod,
uint256 _maxPeriod,
uint256 _maxFutureTime,
address _paymentToken,
uint256 _pricePerSecond
) external payout(_assetId)
Updates the lending conditions for a given asset. Pays out any unclaimed rent to the consumer if set, otherwise it is paid to the owner of the LandWorks NFT. Updated conditions apply the next time the asset is rented. Does not affect previous and queued rents. If any of the properties should not be modified, the current values for them must be provided.
Params
Name
Type
Description
_assetId
uint256
The target asset
_minPeriod
uint256
The minimum number in seconds the asset can be rented
_maxPeriod
uint256
The maximum number in seconds the asset can be rented
_maxFutureTime
uint256
The timestamp delta after which the protocol will not allow the asset to be rented at any given moment
_paymentToken
address
The toen which will be accepted as a form of payment. Provide 0x0000000000000000000000000000000000000001 for ETH
_pricePerSecond
uint256
The price for rental per second

Delist

function delist(uint256 _assetId) external
Delists the asset from the marketplace. Pays out the current unclaimed rent fees to the consumer if set, otherwise it is paid to the owner of the LandWorks NFT. If there are no active rents -> Burns the asset and transfers the original metaverse asset represented by the LandWorks NFT to the asset owner.
Params
Name
Type
Description
_assetId
uint256
The target asset

Withdraw

function withdraw(uint256 _assetId) public
Withdraws the already delisted from the marketplace asset. Burns the asset and transfers the original metaverse asset represented by the LandWorks NFT to the owner. Pays out any unclaimed rent to the consumer if set, otherwise it is paid to the owner of the LandWorks NFT.
Params
Name
Type
Description
_assetId
uint256
The target asset

Rent

function rent(uint256 _assetId, uint256 _period) external payable
returns (uint256, bool)
Rents an asset for a given period. Charges msg.sender for the rent upfront. Rent starts from the last rented timestamp or from the current timestamp of the transaction if the property is available right now.
Params
Name
Type
Description
_assetId
uint256
The target asset
_period
uint256
The target rental period in seconds