ERC721WarperController
ERC721WarperController
warp
function warp(struct Assets.Asset[] assets, address warper, address to) external returns (bytes32 warpedCollectionId, struct Assets.Asset[] warpedAssets)
Needs to be called with `delegatecall` from Renting Manager, otherwise warpers will reject the call.
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. |
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 virtual returns (uint256 universePremiumTotal, uint256 listerPremiumTotal)
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 |
---|---|---|
universePremiumTotal | uint256 | |
listerPremiumTotal | uint256 |
rentalBalance
function rentalBalance(address metahub, address warper, address renter) external view returns (uint256)
Get the active rental balance for a given warper and a renter. Used in Warper->Renting Manager communication.
Name | Type | Description |
---|---|---|
metahub | address | Address of the metahub. |
warper | address | Address of the warper. |
renter | address | Address of the renter whose active rental counts we need to fetch. |
supportsInterface
function supportsInterface(bytes4 interfaceId) public view virtual 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._
isCompatibleWarper
function isCompatibleWarper(address warper) public 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. |
rentalStatus
function rentalStatus(address metahub, address warper, uint256 tokenId) public view returns (enum Rentings.RentalStatus)
Get the rental status of a specific token. Used in Warper->Renting Manager communication.
Name | Type | Description |
---|---|---|
metahub | address | Address of the metahub. |
warper | address | Address of the warper. |
tokenId | uint256 | The token ID to be checked for status. |
_rentalStatus
function _rentalStatus(contract IRentingManager rentingManager, address warper, uint256 tokenId) internal view returns (enum Rentings.RentalStatus)