Functions

Create rental offer

/**
 * @notice Create a new on-chain rental offer.
 * @notice In order to create a private offer, specify the `taker` address, otherwise use the `0x0` address
 * @dev When using pre-signed order, pass `SignatureType.PRE_SIGNED` as the `signatureType` for `rent`
 * @param offer the rental offer to store on-chain
 */
function preSignRentalOffer(RentalOffer calldata offer) external;

This function advertises new rental offers.

circle-exclamation

Cancel rental offer

/**
 * @notice Cancel an on-chain rental offer.
 * @param nonce the nonce of the rental offer to cancel
 */
function cancelRentalOffer(uint256 nonce) external;

A previously advertised offer can be cancelled by summited its nonce to this function.

Begin rental(s)

In order to accept a rental offer, this function has to be called with the details of the offer and the signatureType (only PRE_SIGNED and EIP_712 signature types are supported at this stage).

signature is only needed when using the signature type EIP_712.

circle-info

A rental offer can be a bundle of more than 1 NFT.

Each NFT in the rental offer is a rental by itself when the offer is accepted.

Said differently a rental offer of 3 spaceships will start 3 rentals when the offer is accepted through this function.

End rental

A rental can only be ended when its duration is complete.

circle-info

If a rental has ended but still has ongoing sublet, the lender can still terminate the rent and automatically end the sublet through this function.

End rental prematurely

When the first party (either lender or tenant) makes this call, a blockchain event is emitted and indexed in order to send notifications to the other involved party.

The other party can then either ignore it, or accept it by making the same call.

circle-info

Agreement to end rental prematurely has to be done in a P2P manner.

Sublet

Sublet a rental to a designated party (subtenant).

A sublet is completely controlled by the tenant.

End sublet

Fees table

Fees tables are used in order to expose how many rewards (percentages in basis points) are kept by each involved party.

In practice, Cometh relies on two levels: one for the lender, one for the tenant (if there is a sublet). The last party involved (either the tenant if no sublet or the subtenant if sublet) keeps the rest of the rewards.

Last updated