Skip to content

RentingManager

RentingManager

RentingManagerInitParams

struct RentingManagerInitParams {
  contract IACL acl;
  contract IMetahub metahub;
}

initialize

function initialize(struct RentingManager.RentingManagerInitParams params) external

Renting Manager initializer.

Name Type Description
params struct RentingManager.RentingManagerInitParams Initialization params.

rent

function rent(struct Rentings.Params rentingParams, bytes tokenQuote, bytes tokenQuoteSignature, uint256 maxPaymentAmount) external returns (uint256 rentalId)

Performs renting operation.

Name Type Description
rentingParams struct Rentings.Params Renting parameters.
tokenQuote bytes
tokenQuoteSignature bytes
maxPaymentAmount uint256 Maximal payment amount the renter is willing to pay.
Name Type Description
rentalId uint256 New rental ID.

rentalAgreementInfo

function rentalAgreementInfo(uint256 rentalId) external view returns (struct Rentings.Agreement)

Returns the Rental Agreement details by the `rentalId`. Performs a look up among both present (contains active and inactive, but not yet deleted Rental Agreements) and historical ones (inactive and deleted Rental Agreements only).

Name Type Description
rentalId uint256 Rental agreement ID.
Name Type Description
[0] struct Rentings.Agreement Rental agreement details.

userRentalCount

function userRentalCount(address renter) external view returns (uint256)

Returns the number of currently registered rental agreements for particular renter account.

Name Type Description
renter address Renter address.
Name Type Description
[0] uint256 Rental agreement count.

userRentalAgreements

function userRentalAgreements(address renter, uint256 offset, uint256 limit) external view returns (uint256[], struct Rentings.Agreement[])

Returns the paginated list of currently registered rental agreements for particular renter account.

Name Type Description
renter address Renter address.
offset uint256 Starting index.
limit uint256 Max number of items.
Name Type Description
[0] uint256[] Rental agreement IDs.
[1] struct Rentings.Agreement[] Rental agreements.

estimateRent

function estimateRent(struct Rentings.Params rentingParams) external view returns (struct Rentings.RentalFees)

Evaluates renting params and returns rental fee breakdown.

Name Type Description
rentingParams struct Rentings.Params Renting parameters.
Name Type Description
[0] struct Rentings.RentalFees Rental fee breakdown.

collectionRentedValue

function collectionRentedValue(bytes32 warpedCollectionId, address renter) external view returns (uint256)

Returns token amount from specific collection rented by particular account.

Name Type Description
warpedCollectionId bytes32 Warped collection ID.
renter address The renter account address.
Name Type Description
[0] uint256 Rented value.

assetRentalStatus

function assetRentalStatus(struct Assets.AssetId warpedAssetId) external view returns (enum Rentings.RentalStatus)

Returns the rental status of a given warped asset.

Name Type Description
warpedAssetId struct Assets.AssetId Warped asset ID.
Name Type Description
[0] enum Rentings.RentalStatus The asset rental status.

contractKey

function contractKey() external pure returns (bytes4)

Returns implemented contract key.

Name Type Description
[0] bytes4 Contract key;

supportsInterface

function supportsInterface(bytes4 interfaceId) public view returns (bool)

_Returns true if this contract implements the interface defined by `interfaceId`. See the corresponding https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] to learn more about how these ids are created.

This function call must use less than 30 000 gas._

_warpListedAssets

function _warpListedAssets(uint256 listingId, address warper, address renter) internal returns (bytes32 collectionId, struct Assets.Asset[] warpedAssets)

Finds the listed asset and warps it, using corresponding warper controller.

Name Type Description
listingId uint256 Listing ID.
warper address Warper address.
renter address Renter address.
Name Type Description
collectionId bytes32 Warped collection ID.
warpedAssets struct Assets.Asset[] Warped asset structure.

_executeWarperRentalHook

function _executeWarperRentalHook(address warper, uint256 rentalId, struct Rentings.Agreement rentalAgreement, struct Accounts.RentalEarnings rentalEarnings) internal

Executes warper rental hook using the corresponding controller.

Name Type Description
warper address Warper address.
rentalId uint256 Rental Agreement ID.
rentalAgreement struct Rentings.Agreement Newly registered rental agreement details.
rentalEarnings struct Accounts.RentalEarnings The rental earnings breakdown.

_handleRentalPaymentAndExecuteWarperHook

function _handleRentalPaymentAndExecuteWarperHook(struct Rentings.Agreement rentalAgreement, struct Rentings.Params rentingParams, address payer, uint256 maxPaymentAmount, uint256 rentalId, bytes tokenQuote, bytes tokenQuoteSignature) internal

Handles all rental payments.

_authorizeUpgrade

function _authorizeUpgrade(address newImplementation) internal

Checks whether the caller is authorized to upgrade the Metahub implementation.

_acl

function _acl() internal view returns (contract IACL)

return the IACL address

_emptyListingTerms

function _emptyListingTerms() internal pure returns (struct IListingTermsRegistry.ListingTerms listingTerms)

Returns empty listing terms.

Name Type Description
listingTerms struct IListingTermsRegistry.ListingTerms Empty listing terms structure.

_emptyTaxTerms

function _emptyTaxTerms() internal pure returns (struct ITaxTermsRegistry.TaxTerms taxTerms)

Returns empty tax terms.

Name Type Description
taxTerms struct ITaxTermsRegistry.TaxTerms Empty tax terms structure.