Governor_v1.sol
Last updated
Last updated
Inherits: , ,
Author: Inverter Network
This contract manages various administrative functions that can be executed only by specified multisig addresses. It supports upgrades to contracts through role-based permissions, enabling a timelocked upgrade process and emergency procedures.
Inherits from for interface detection, for role-based access control, and implements the interface for governance functionalities, i.e. setting the fee manager, setting the timelock, upgrading the beacons and exposing the emergency shutdown.
Role of the community multisig.
Role of the team multisig.
contract.
Length of each timelock.
Storage gap for future upgrades.
Modifier to guarantee the given address is valid.
Modifier to guarantee the given timelock period is valid.
Modifier to guarantee only the community or team multisig can call the function.
The module's initializer function.
Parameters
_communityMultisig
address
The address of the community multisig.
_teamMultisig
address
The address of the team multisig.
_timelockPeriod
uint256
_feeManager
address
_moduleFactory
address
Parameters
registeredBeacons
IInverterBeacon_v1[]
Parameters
beacon
address
Returns
<none>
Timelock
Returns
<none>
IInverterBeacon_v1[]
Returns
<none>
address
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
newFeeManager
address
Returns
<none>
address
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
newModuleFactory
address
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
maxFee
uint256
The max Fee in relation to the BPS.
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
_defaultProtocolTreasury
address
The address of the default protocol treasury.
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
workflow
address
The address of the workflow.
treasury
address
The address of the protocol treasury for that specific workflow.
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
_defaultCollateralFee
uint256
The default collateral fee of the protocol in relation to the BPS.
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
_defaultIssuanceFee
uint256
The default issuance fee of the protocol in relation to the BPS.
Can only be accessed by either the COMMUNITY_MULTISIG_ROLE
or the TEAM_MULTISIG_ROLE
.
Parameters
workflow
address
The address of the workflow that contains the module function.
module
address
The address of the module that contains the function.
functionSelector
bytes4
The function selector of the target function.
set
bool
Boolean that determines if the fee is actually used or not.
fee
uint256
The collateral fee in relation to the BPS.
Can only be accessed by either the COMMUNITY_MULTISIG_ROLE
or the TEAM_MULTISIG_ROLE
.
Parameters
workflow
address
The address of the workflow that contains the module function.
module
address
The address of the module that contains the function.
functionSelector
bytes4
The function selector of the target function.
set
bool
Boolean that determines if the fee is actually used or not.
fee
uint256
The issuance fee in relation to the BPS.
Can only be accessed by either the COMMUNITY_MULTISIG_ROLE
or the TEAM_MULTISIG_ROLE
.
Parameters
metadata
IModule_v1.Metadata
The metadata that will be registered.
beacon
IInverterBeacon_v1
This function will override previous timelocks even if they are active.
Parameters
beacon
address
newImplementation
address
newMinorVersion
uint256
newPatchVersion
uint256
Can only be accessed by either the COMMUNITY_MULTISIG_ROLE
or the TEAM_MULTISIG_ROLE
.
Parameters
beacon
address
Can only be accessed by either the COMMUNITY_MULTISIG_ROLE
or the TEAM_MULTISIG_ROLE
.
Parameters
beacon
address
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
newTimelockPeriod
uint256
Can only be accessed by either the COMMUNITY_MULTISIG_ROLE
or the TEAM_MULTISIG_ROLE
.
Parameters
beacon
address
Can only be accessed by either the COMMUNITY_MULTISIG_ROLE
or the TEAM_MULTISIG_ROLE
.
This function forces the upgrade of a beacon and restarts the implementation afterwards.
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
beacon
address
newImplementation
address
newMinorVersion
uint256
newPatchVersion
uint256
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
.
Parameters
beacon
address
Accepts the ownership over the target address.
Can only be accessed by the COMMUNITY_MULTISIG_ROLE
or TEAM_MULTISIG_ROLE
.
Parameters
adr
address
The address of target that wants to hand over the ownership.
Parameters
newFeeManager
address
sets the internal timelock period.
Parameters
newTimelockPeriod
uint256
the new timelock period.
Parameters
newModuleFactory
address
contract.
Array of s that are linked to this , populated via moduleFactoryInitCallback
.
Struct to store timelock information for each .
See .
Modifier to guarantee function is only callable by the linked
Modifier to guarantee linked s are not empty.
Modifier to guarantee the given is accessible.
Modifier to check if the upgrade process for the given is already started.
Modifier to check if the timelock period for the given is exceeded.
The timelock period needed to upgrade a .
The address of the initial .
The address of the initial .
Callback function that is called by during initialization.
The array of s that will be registered.
Returns the current timelock of a address.
The address of the .
The timelock of the address.
Returns the list of currently linked s.
LinkedBeacons The array of s that are currently linked to the {Governor_v1}.
Returns the address.
Address of the .
Sets the address of the .
The address of the new .
Returns the address.
Address of the .
Sets the address of the .
The address of the new .
Sets the maximum fee percentage that can be assigned in the linked .
Sets the default protocol treasury address in the linked .
Sets the protocol treasury address for a specific workflow in the linked .
Sets the default collateral fee of the protocol in the linked .
Sets the default issuance fee of the protocol in the linked .
Sets the collateral fee for a specific workflow module function in the linked .
Sets the issuance fee for a specific workflow module function in the linked .
Registers a with the provided metadata
in the target .
The that will be registered.
Starts the upgrade process of a by creating a timelock period after which the can be upgraded via triggerUpgradeBeaconWithTimelock()
.
The address of the that is intended to be upgraded.
The address of the intended new Implementation of the .
The intended new minor version of the .
The intended new patch version of the .
Upgrades a with the data provided by the active timelock.
The address of the that is intended to be upgraded.
Cancels an upgrade of by setting the active timelock to inactive.
The address of the for which the timelock should be canceled.
Sets the timelock period of a upgrade process.
Initiates the shutdown of a .
The address of the that should be shut down.
Initiates the shutdown of all linked s.
The address of the that is intended to be upgraded and restarted.
The address of the intended new Implementation of the .
The intended new minor version of the .
The intended new patch version of the .
Restarts the implementation.
The address of the that should restarted.
sets the internal address.
the address of the new .
sets the internal address.
the address of the new .
Internal function that checks if target address is a and this contract has the ownership of it.