I need help building a Timelock DAO.
- When deploying the time lock contract, should you include the Governor address as proposer?
- Was wondering if it should be address 0 or not.
- when including the Timelock contract, should it be GuildTimelockController or the OZ TimelockController?
For question 3:
Extension of Governor that binds the execution process to an instance of TimelockController..
Should I use the GuildTimelockController
or this TimelockController
. Since the documentation state the instance of TimelockController.
GovernorTimelockControl(GuildTimelockController (payable(_timelock)))
or
GovernorTimelockControl(TimelockController(payable(_timelock)))
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.13;
import {CoreRef} from "@src/core/CoreRef.sol";
import {CoreRoles} from "@src/core/CoreRoles.sol";
import {TimelockController} from "@openzeppelin/contracts/governance/TimelockController.sol";
/// @title An override of the regular OZ governance/TimelockController to allow uniform
/// access control in the ECG system based on roles defined in Core.
/// @dev The roles and roles management from OZ access/AccessControl.sol are ignored, we
/// chose not to fork TimelockController and just bypass its access control system, to
/// introduce as few code changes as possible on top of OpenZeppelin's governance code.
/// @author eswak
contract GuildTimelockController is TimelockController, CoreRef {
constructor(
address _core,
uint256 _minDelay
)
CoreRef(_core)
TimelockController(
_minDelay,
new address[](0), //should this be 0?
new address[](0),
address(0)
)
{}
// SPDX-License-Identifier: GPL-3.0-or-later
pragma solidity 0.8.13;
import {Governor, IGovernor} from "@openzeppelin/contracts/governance/Governor.sol";
import {GovernorSettings} from "@openzeppelin/contracts/governance/extensions/GovernorSettings.sol";
import {GovernorTimelockControl} from "@openzeppelin/contracts/governance/extensions/GovernorTimelockControl.sol";
import {GovernorVotes, IERC165} from "@openzeppelin/contracts/governance/extensions/GovernorVotes.sol";
import {GovernorCountingSimple} from "@openzeppelin/contracts/governance/extensions/GovernorCountingSimple.sol";
import {IVotes} from "@openzeppelin/contracts/governance/utils/IVotes.sol";
import {TimelockController} from "@openzeppelin/contracts/governance/TimelockController.sol";
import {CoreRef} from "@src/core/CoreRef.sol";
import {CoreRoles} from "@src/core/CoreRoles.sol";
/// @title Governor for on-chain governance of Ethereum Credit Guild, based on the OZ implementation.
/// @author eswak
contract GuildGovernor is
CoreRef,
Governor,
GovernorVotes,
GovernorTimelockControl,
GovernorSettings,
GovernorCountingSimple
{
/// @notice Private storage variable for quorum (the minimum number of votes needed for a vote to pass).
uint256 private _quorum;
/// @notice Emitted when quorum is updated.
event QuorumUpdated(uint256 oldQuorum, uint256 newQuorum);
constructor(
address _core,
address _timelock,
address _token,
uint256 initialVotingDelay,
uint256 initialVotingPeriod,
uint256 initialProposalThreshold,
uint256 initialQuorum
)
CoreRef(_core)
Governor("ECG Governor")
GovernorVotes(IVotes(_token))
// fShould I use OZ library instead of GuildTImelockController.sol and does it need to be payable
GovernorTimelockControl(TimelockController(payable(_timelock)))
GovernorSettings(
initialVotingDelay,
initialVotingPeriod,
initialProposalThreshold
)
{
_setQuorum(initialQuorum);
}
The Proposer role is in charge of queueing operations: this is the role the Governor instance should be granted, and it should likely be the only proposer in the system.