Skip to content

Commit

Permalink
fix: two step gov
Browse files Browse the repository at this point in the history
  • Loading branch information
Schlagonia committed Nov 14, 2023
1 parent ea51590 commit 288d6c8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/utils/Clonable.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity 0.8.18;

contract Clonable {
// Set to the address to auto clone from.
/// @notice Set to the address to auto clone from.
address public original;

/**
Expand Down
4 changes: 3 additions & 1 deletion src/utils/Governance.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
pragma solidity 0.8.18;

contract Governance {
/// @notice Emitted when the governance address is updated.
event GovernanceTransferred(
address indexed previousGovernance,
address indexed newGovernance
Expand All @@ -12,11 +13,12 @@ contract Governance {
_;
}

/// @notice Checks if the msg sender is the governance.
function _checkGovernance() internal view virtual {
require(governance == msg.sender, "!governance");
}

// Address that can set the default base fee and provider
/// @notice Address that can set the default base fee and provider
address public governance;

constructor(address _governance) {
Expand Down
9 changes: 3 additions & 6 deletions src/utils/Governance2Step.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,13 @@ pragma solidity 0.8.18;
import {Governance} from "./Governance.sol";

contract Governance2Step is Governance {
/// @notice Emitted when the pending governance address is set.
event UpdatePendingGovernance(address indexed newPendingGovernance);

// Address that is set to take over governance.
/// @notice Address that is set to take over governance.
address public pendingGovernance;

constructor(address _governance) {
governance = _governance;

emit GovernanceTransferred(address(0), _governance);
}
constructor(address _governance) Governance(_governance) {}

/**
* @notice Sets a new address as the `pendingGovernance` of the contract.
Expand Down

0 comments on commit 288d6c8

Please sign in to comment.