Skip to content

Commit

Permalink
Add virtual keyword to functions in L2Governor to easily inherit this…
Browse files Browse the repository at this point in the history
… contract in case of an upgrade
  • Loading branch information
matjazv committed Feb 26, 2024
1 parent fe1c46e commit 7b82e7f
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/L2/L2Governor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,21 @@ contract L2Governor is
}

/// @notice Returns the quorum required for a proposal to be successful.
function quorum(uint256) public pure override returns (uint256) {
function quorum(uint256) public pure virtual override returns (uint256) {
return QUORUM_THRESHOLD;
}

/// @notice Ensures that only the owner can authorize a contract upgrade. It reverts if called by any address other
/// than the contract owner.
/// @param _newImplementation The address of the new contract implementation to which the proxy will be upgraded.
function _authorizeUpgrade(address _newImplementation) internal override onlyOwner { }
function _authorizeUpgrade(address _newImplementation) internal virtual override onlyOwner { }

// The below functions are overrides required by Solidity.

function state(uint256 proposalId)
public
view
virtual
override(GovernorUpgradeable, GovernorTimelockControlUpgradeable)
returns (ProposalState)
{
Expand All @@ -97,6 +98,7 @@ contract L2Governor is
function proposalNeedsQueuing(uint256 proposalId)
public
view
virtual
override(GovernorUpgradeable, GovernorTimelockControlUpgradeable)
returns (bool)
{
Expand All @@ -106,6 +108,7 @@ contract L2Governor is
function proposalThreshold()
public
view
virtual
override(GovernorUpgradeable, GovernorSettingsUpgradeable)
returns (uint256)
{
Expand All @@ -120,6 +123,7 @@ contract L2Governor is
bytes32 descriptionHash
)
internal
virtual
override(GovernorUpgradeable, GovernorTimelockControlUpgradeable)
returns (uint48)
{
Expand All @@ -134,6 +138,7 @@ contract L2Governor is
bytes32 descriptionHash
)
internal
virtual
override(GovernorUpgradeable, GovernorTimelockControlUpgradeable)
{
super._executeOperations(proposalId, targets, values, calldatas, descriptionHash);
Expand All @@ -146,6 +151,7 @@ contract L2Governor is
bytes32 descriptionHash
)
internal
virtual
override(GovernorUpgradeable, GovernorTimelockControlUpgradeable)
returns (uint256)
{
Expand All @@ -155,6 +161,7 @@ contract L2Governor is
function _executor()
internal
view
virtual
override(GovernorUpgradeable, GovernorTimelockControlUpgradeable)
returns (address)
{
Expand Down

0 comments on commit 7b82e7f

Please sign in to comment.