#
GovernanceFacet
Inherits: Modifiers
#
Functions
#
isDiamondInitialized
Check if the diamond has been initialized.
This will get the value from AppStorage.diamondInitialized.
function isDiamondInitialized() external view returns (bool);
#
calculateUpgradeId
Calcuate upgrade hash: id
calucate the upgrade hash by hashing all the inputs
function calculateUpgradeId(IDiamondCut.FacetCut[] calldata _diamondCut, address _init, bytes calldata _calldata)
external
pure
returns (bytes32);
Parameters
#
createUpgrade
Approve the following upgrade hash: id
The diamondCut() has been modified to check if the upgrade has been scheduled. This method needs to be called in order for an upgrade to be executed.
function createUpgrade(bytes32 id) external assertPrivilege(LibAdmin._getSystemId(), LC.GROUP_SYSTEM_ADMINS);
Parameters
#
updateUpgradeExpiration
Update the diamond cut upgrade expiration period.
When createUpgrade() is called, it allows a diamondCut() upgrade to be executed. This upgrade must be executed before the upgrade expires. The upgrade expires based on when the upgrade was scheduled (when createUpgrade() was called) + AppStorage.upgradeExpiration.
function updateUpgradeExpiration(uint256 duration)
external
assertPrivilege(LibAdmin._getSystemId(), LC.GROUP_SYSTEM_ADMINS);
Parameters
#
cancelUpgrade
Cancel the following upgrade hash: id
This will set the mapping AppStorage.upgradeScheduled back to 0.
function cancelUpgrade(bytes32 id) external assertPrivilege(LibAdmin._getSystemId(), LC.GROUP_SYSTEM_ADMINS);
Parameters
#
getUpgrade
Get the expiry date for provided upgrade hash.
This will get the value from AppStorage.upgradeScheduled mapping.
function getUpgrade(bytes32 id) external view returns (uint256 expiry);
Parameters
#
getUpgradeExpiration
Get the upgrade expiration period.
This will get the value from AppStorage.upgradeExpiration. AppStorage.upgradeExpiration is added to the block.timestamp to create the upgrade expiration date.
function getUpgradeExpiration() external view returns (uint256 upgradeExpiration);
#
Events
#
CreateUpgrade
event CreateUpgrade(bytes32 id, address indexed who);
#
UpdateUpgradeExpiration
event UpdateUpgradeExpiration(uint256 duration);
#
UpgradeCancelled
event UpgradeCancelled(bytes32 id, address indexed who);