From cfd02c3f37a8b991405240ae30ddd3c5873202ca Mon Sep 17 00:00:00 2001 From: Schlagonia Date: Fri, 20 Sep 2024 11:14:46 -0600 Subject: [PATCH] build: init gov --- contracts/Managers/InitGov.sol | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 contracts/Managers/InitGov.sol diff --git a/contracts/Managers/InitGov.sol b/contracts/Managers/InitGov.sol new file mode 100644 index 0000000..4f4af14 --- /dev/null +++ b/contracts/Managers/InitGov.sol @@ -0,0 +1,32 @@ +// SPDX-License-Identifier: AGPL-3.0 +pragma solidity ^0.8.18; + +import {Governance} from "@periphery/utils/Governance.sol"; + +contract InitGov { + address public constant multisig = + 0x33333333D5eFb92f19a5F94a43456b3cec2797AE; + + address public constant EOA = 0xD7392bcc3D3611adF1793fDdaAAB4770772AC35A; + + modifier onlyGov() { + _checkGov(); + _; + } + + // Default to 0x33 ms as gov if deployed. But backs up to an EOA if not. + function _checkGov() internal view { + if (multiSig.code.length != 0) { + require(msg.sender == multisig, "!gov"); + } else { + require(msg.sender == eoa, "!gov"); + } + } + + function transferGovernance( + address _contract, + address _newOwner + ) external onlyGov { + Governance(_contract).transferGovernance(_newOwner); + } +}