Last updated
Last updated
Inherits: CommonValidation, ModifiedOwnable2StepUpgradeable, DelayedUUPSUpgradeable, IMezzHub
Author: Daniel Yamagata & Jerry Qi & Naveen Ailawadi
The central contract of the Mezzanine protocol. It manages the protocol state and whitelists and is used by 'core' contracts to query 'non-core' contracts
The addresses of the 'non-core' contracts can only be updated via an upgrade, which must be proposed and executed by the 'owner'. Upgrades require a delay before they can be executed. Similarly, the transfer of ownership requires a delay before it can be accepted. The renouncement of ownership is disabled to prevent griefing by a compromised 'owner'. The re-enablement of this functionality must be done via an upgrade
Reverts if the caller is not the 'owner' or a 'defender'
Returns the snapshot of the ownership transfer. This snapshot must pass before a pending ownership transfer can occur. If there is no pending ownership transfer, this will will return zero
Returns the snapshot of the protocol freeze. This snapshot must pass before the protocol can
Returns the address of the Mezz Hub owner
Initializes the Mezz Hub state. Can only be called once
Parameters
Overridden 'transferOwnership' such that a snapshot is taken upon the transfer of ownership
Overridden '_acceptOwnership' such that the snapshot is validated before the ownership transfer is accepted
Cancels a pending ownership transfer. Only callable by the 'owner' or a 'defender' Deletes the snapshot of the ownership transfer and the pending owner
Deprecation of 'renounceOwnership' from OwnableUpgradeable to prevent griefing by a compromised 'owner'
Freezes the protocol for 'freezeDuration', which can be up to 14 days. Only callable by the 'owner' or a 'defender' The protocol can be re-frozen at any point while it is frozen.
Parameters
Sets the protocol state. Only callabe by the owner.
Protocol state is defined by the following enum:
0: Active
1: Paused
2: Frozen
If protocol state is set by this function, it will be permanently set until this function is called again to change state.
Parameters
Proposes an upgrade to the contract's implementation
The caller must be authorized to propose an upgrade. This authorization is determined by inheriting contracts
Parameters
Returns
Cancels the pending upgrade, deleting the 'pendingUpgrade' and 'pendingUpgradeSnapshot' in storage
The caller must be authorized to cancel a pending upgrade. This authorization is determined by inheriting contracts
Sets the 'implementationToSet' to 'setting'. If true and 'implementationToSet' is StateAware, the implementation's pausable and freezable functions will revert Only callable by the 'owner'
Sets the 'deploymentToSet' to 'setting'. If true, the deployment's pausable and freezable functions will revert Only callable by the 'owner' or a 'defender'
Adds 'denominationAssetToAdd' to the denomination asset whitelist. Only callable by the 'owner'
The owner should be cautious to never add ERC777s to the whitelist to prevent possible reentrancy attacks
Removes 'denominationAssetToRemove' from the denomination asset whitelist. Only callable by the 'owner'
Adds 'defenderToAdd' to the set of defenders. Only callable by the 'owner'
Removes 'defenderToRemove' from the set of defenders. Only callable by the 'owner'
Returns true if 'defenderToCheck' is a defender, false otherwise
Returns true 'denominationAssetToCheck' is whitelisted, false otherwise
Returns true if 'deploymentToCheck' is frozen, false otherwise
Returns true if 'implementationToCheck' is frozen, false otherwise
Returns the set of defenders as an array of addresses
Returns the set of denomination assets in no specific order
Returns the address of the Document Registry
Used by core contracts
Returns the address of the fee controller
Used by core contracts
Returns the address of the Mezz Deployer
Used by the core contracts
Returns the Protocol State as an enum, DataTypes.ProtocolState
*The protocol state is defined by the following enum:
0: Active
1: Paused
2: Frozen
The protocol can be frozen in two ways:
(1) The protocol's state was set to 'Frozen' by the owner via 'setProtocolState()'. If this is the case, it can be unfrozen at any point in time
(2) The 'owner' or a 'defender' set the protocol's state to 'Frozen' via 'freezeProtocol()', which freezes the protocol for a period of time. It cannot be unfrozen until this time passes*
Reverts if the caller is not the 'owner' or a 'defender'
Overridden '_authorizeUpgrade()' from DelayedUUPSUpgradeable such that only the 'owner' can execute an upgrade