WarperManager
WarperManager
WarperManagerInitParams
struct WarperManagerInitParams {
contract IACL acl;
contract IMetahub metahub;
}
onlyIsAuthorizedWizardForWarperManagement
modifier onlyIsAuthorizedWizardForWarperManagement()
Modifier to make sure the function is called by the authorized Wizard for Warper Management.
onlyIsAuthorizedOperatorForWarperManagement
modifier onlyIsAuthorizedOperatorForWarperManagement(address warper)
Modifier to make sure the function is called by the authorized Warper Operator.
onlyRegisteredWarper
modifier onlyRegisteredWarper(address warper)
Modifier to make sure that the warper has been registered beforehand.
initialize
function initialize(struct WarperManager.WarperManagerInitParams params) external
Metahub initializer.
Name | Type | Description |
---|---|---|
params | struct WarperManager.WarperManagerInitParams | Initialization params. |
registerWarper
function registerWarper(address warper, struct IWarperManager.WarperRegistrationParams params) external
Registers a new warper. The warper must be deployed and configured prior to registration, since it becomes available for renting immediately.
Name | Type | Description |
---|---|---|
warper | address | Warper address. |
params | struct IWarperManager.WarperRegistrationParams | Warper registration params. |
deregisterWarper
function deregisterWarper(address warper) external
Deletes warper registration information. All current rental agreements with the warper will stay intact, but the new rentals won't be possible.
Name | Type | Description |
---|---|---|
warper | address | Warper address. |
pauseWarper
function pauseWarper(address warper) external
Puts the warper on pause. Emits a {WarperPaused} event.
Name | Type | Description |
---|---|---|
warper | address | Address. |
unpauseWarper
function unpauseWarper(address warper) external
Lifts the warper pause. Emits a {WarperUnpaused} event.
Name | Type | Description |
---|---|---|
warper | address | Address. |
setWarperController
function setWarperController(address[] warpers, address controller) external
Sets the new controller address for one or multiple registered warpers.
Name | Type | Description |
---|---|---|
warpers | address[] | A list of registered warper addresses which controller will be changed. |
controller | address | Warper controller address. |
metahub
function metahub() external view returns (address)
Returns the Metahub address.
universeWarperCount
function universeWarperCount(uint256 universeId) external view returns (uint256)
Returns the number of warpers belonging to the particular universe.
Name | Type | Description |
---|---|---|
universeId | uint256 | The universe ID. |
Name | Type | Description |
---|---|---|
[0] | uint256 | Warper count. |
universeWarpers
function universeWarpers(uint256 universeId, uint256 offset, uint256 limit) external view returns (address[], struct Warpers.Warper[])
Returns the list of warpers belonging to the particular universe.
Name | Type | Description |
---|---|---|
universeId | uint256 | The universe ID. |
offset | uint256 | Starting index. |
limit | uint256 | Max number of items. |
Name | Type | Description |
---|---|---|
[0] | address[] | List of warper addresses. |
[1] | struct Warpers.Warper[] | List of warpers. |
universeAssetWarperCount
function universeAssetWarperCount(uint256 universeId, address asset) external view returns (uint256)
Returns the number of warpers registered for certain asset in universe.
Name | Type | Description |
---|---|---|
universeId | uint256 | Universe ID. |
asset | address | Original asset address. |
Name | Type | Description |
---|---|---|
[0] | uint256 | Warper count. |
universeAssetWarpers
function universeAssetWarpers(uint256 universeId, address asset, uint256 offset, uint256 limit) external view returns (address[], struct Warpers.Warper[])
Returns the list of warpers belonging to the particular asset in universe.
Name | Type | Description |
---|---|---|
universeId | uint256 | The universe ID. |
asset | address | Original asset. |
offset | uint256 | Starting index. |
limit | uint256 | Max number of items. |
Name | Type | Description |
---|---|---|
[0] | address[] | List of warper addresses. |
[1] | struct Warpers.Warper[] | List of warpers. |
isWarperAdmin
function isWarperAdmin(address warper, address account) external view returns (bool)
Checks whether `account` is the `warper` admin.
Name | Type | Description |
---|---|---|
warper | address | Warper address. |
account | address | Account address. |
Name | Type | Description |
---|---|---|
[0] | bool | True if the `account` is the admin of the `warper` and false otherwise. |
warperInfo
function warperInfo(address warper) external view returns (struct Warpers.Warper)
Returns registered warper details.
Name | Type | Description |
---|---|---|
warper | address | Warper address. |
Name | Type | Description |
---|---|---|
[0] | struct Warpers.Warper | Warper details. |
checkWarperAdmin
function checkWarperAdmin(address warper, address account) external view
Reverts if the warpers universe owner is not the provided account address.
Name | Type | Description |
---|---|---|
warper | address | Warpers address. |
account | address | The address that's expected to be the warpers universe owner. |
checkRegisteredWarper
function checkRegisteredWarper(address warper) external view
Reverts if warper is not registered.
checkUniverseHasWarper
function checkUniverseHasWarper(uint256 universeId) external view
Reverts if no warpers are registered for the universe.
checkUniverseHasWarperForAsset
function checkUniverseHasWarperForAsset(uint256 universeId, address asset) external view
Reverts if no warpers are registered for asset in the certain universe.
warperController
function warperController(address warper) external view returns (address)
Returns warper controller address.
Name | Type | Description |
---|---|---|
warper | address | Warper address. |
Name | Type | Description |
---|---|---|
[0] | address | Current controller. |
contractKey
function contractKey() external pure returns (bytes4)
Returns implemented contract key.
Name | Type | Description |
---|---|---|
[0] | bytes4 | Contract key; |
checkIsAuthorizedWizardForWarperManagement
function checkIsAuthorizedWizardForWarperManagement(address account) public view
Reverts if the provided `account` is not a Wizard authorized for Warper Management.
Name | Type | Description |
---|---|---|
account | address | The account to check for. |
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._
_authorizeUpgrade
function _authorizeUpgrade(address newImplementation) internal
Checks whether the caller is authorized to upgrade the Metahub implementation.
_isAuthorizedWizardForWarperManagement
function _isAuthorizedWizardForWarperManagement(address account) internal view returns (bool)
_isWarperAdmin
function _isWarperAdmin(address warper, address account) internal view returns (bool)
_checkRegisteredWarper
function _checkRegisteredWarper(address warper) internal view
_acl
function _acl() internal view returns (contract IACL)
return the IACL address