Skip to content

IWarperController

IWarperController

IncompatibleWarperInterface

error IncompatibleWarperInterface()

Thrown if warper interface is not compatible with the controller.

InvalidAssetForWarper

error InvalidAssetForWarper(address warper, address asset)

Thrown upon attempting to use the warper with an asset different from the one expected by the warper.

AlreadyRented

error AlreadyRented()

Thrown upon attempting to rent a warped asset which is already rented.

warp

function warp(struct Assets.Asset[] assets, address warper, address to) external returns (bytes32 warpedCollectionId, struct Assets.Asset[] warpedAssets)

Takes an existing asset and then mints a warper token representing it. Used in Renting Manager->Warper communication.

Name Type Description
assets struct Assets.Asset[] The asset(s) that must be warped.
warper address Warper contract to be used for warping.
to address The account which will receive the warped asset.
Name Type Description
warpedCollectionId bytes32 The warped collection ID.
warpedAssets struct Assets.Asset[] The warped Assets.

executeRentingHooks

function executeRentingHooks(uint256 rentalId, struct Rentings.Agreement rentalAgreement, struct Accounts.RentalEarnings rentalEarnings) external

Executes warper rental hook.

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

isCompatibleWarper

function isCompatibleWarper(address warper) external view returns (bool)

Validates that the warper interface is supported by the current WarperController.

Name Type Description
warper address Warper whose interface we must validate.
Name Type Description
[0] bool bool - `true` if warper is supported.

checkCompatibleWarper

function checkCompatibleWarper(address warper) external view

Reverts if provided warper is not compatible with the controller.

validateRentingParams

function validateRentingParams(struct Warpers.Warper warper, struct Assets.Asset[] assets, struct Rentings.Params rentingParams) external view

Validates renting params taking into account various warper mechanics and warper data. Throws an error if the specified asset cannot be rented with particular renting parameters.

Name Type Description
warper struct Warpers.Warper Registered warper data.
assets struct Assets.Asset[] The listing asset(s) to validate for.
rentingParams struct Rentings.Params Renting parameters.

calculatePremiums

function calculatePremiums(struct Assets.Asset[] assets, struct Rentings.Params rentingParams, uint256 universeFee, uint256 listerFee) external view returns (uint256 universePremium, uint256 listerPremium)

Calculates the universe and/or lister premiums. Those are extra amounts that should be added the the resulting rental fee paid by renter.

Name Type Description
assets struct Assets.Asset[] Assets being rented.
rentingParams struct Rentings.Params Renting parameters.
universeFee uint256 The current value of the Universe fee component.
listerFee uint256 The current value of the lister fee component.
Name Type Description
universePremium uint256 The universe premium amount.
listerPremium uint256 The lister premium amount.