LendefiGovernor
Last updated
Last updated
Inherits: GovernorUpgradeable, GovernorSettingsUpgradeable, GovernorCountingSimpleUpgradeable, GovernorVotesUpgradeable, GovernorVotesQuorumFractionUpgradeable, GovernorTimelockControlUpgradeable, AccessControlUpgradeable, UUPSUpgradeable
Standard OZUpgradeable governor with UUPS and AccessControl
Implements a secure and upgradeable DAO governor with consistent role patterns
Notes:
security-contact: security@nebula-labs.xyz
oz-upgrades:
Role identifier for addresses that can upgrade the contract
Note: security: Should be granted carefully as this is a critical permission
Default voting delay in blocks (approximately 1 day)
The period after a proposal is created during which voting cannot start
Default voting period in blocks (approximately 1 week)
The period during which voting can occur
Default proposal threshold (20,000 tokens)
The minimum number of votes needed to submit a proposal
Duration of the timelock for upgrade operations (3 days)
Time that must elapse between scheduling and executing an upgrade
Note: security: Provides time for users to respond to potentially malicious upgrades
UUPS upgrade version tracker
Incremented with each upgrade to track contract versions
Information about the currently pending upgrade
Will have exists=false if no upgrade is pending
Reserved storage space for future upgrades
Note: oz-upgrades-unsafe-allow: state-variable-immutable
Note: oz-upgrades-unsafe-allow: constructor
Initializes the UUPS contract
Parameters
_token
IVotes
IVotes token instance
_timelock
TimelockControllerUpgradeable
timelock instance
_gnosisSafe
address
multisig address for emergency functions and upgrades
Schedules an upgrade to a new implementation with timelock
Can only be called by addresses with UPGRADER_ROLE
Parameters
newImplementation
address
Address of the new implementation contract
Cancels a previously scheduled upgrade
Only callable by addresses with UPGRADER_ROLE
Returns the remaining time before a scheduled upgrade can be executed
Returns
<none>
uint256
timeRemaining The time remaining in seconds, or 0 if no upgrade is scheduled or timelock has passed
Emitted when the contract is initialized
Parameters
src
address
The address that initialized the contract
Emitted when the contract is upgraded
Parameters
src
address
The address that executed the upgrade
implementation
address
The address of the new implementation
Emitted when an upgrade is scheduled
Parameters
scheduler
address
The address scheduling the upgrade
implementation
address
The new implementation contract address
scheduledTime
uint64
The timestamp when the upgrade was scheduled
effectiveTime
uint64
The timestamp when the upgrade can be executed
Emitted when a scheduled upgrade is cancelled
Parameters
canceller
address
The address that cancelled the upgrade
implementation
address
The implementation address that was cancelled
Error thrown when a zero address is provided
Error thrown when attempting to execute an upgrade before timelock expires
Parameters
timeRemaining
uint256
The time remaining until the upgrade can be executed
Error thrown when attempting to execute an upgrade that wasn't scheduled
Error thrown when implementation address doesn't match scheduled upgrade
Parameters
scheduledImpl
address
The address that was scheduled for upgrade
attemptedImpl
address
The address that was attempted to be used
Structure to store pending upgrade details
Properties
implementation
address
Address of the new implementation contract
scheduledTime
uint64
Timestamp when the upgrade was scheduled
exists
bool
Boolean flag indicating if an upgrade is currently scheduled