Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(protocol): add GovernorSettingsUpgradeable #16687

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions packages/protocol/contracts/L1/gov/TaikoGovernor.sol
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import
"@openzeppelin/contracts-upgradeable/governance/extensions/GovernorVotesQuorumFractionUpgradeable.sol";
import
"@openzeppelin/contracts-upgradeable/governance/extensions/GovernorTimelockControlUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/governance/extensions/GovernorSettingsUpgradeable.sol";
import "@openzeppelin/contracts-upgradeable/access/Ownable2StepUpgradeable.sol";

/// @title TaikoGovernor
/// @custom:security-contact [email protected]
contract TaikoGovernor is
Ownable2StepUpgradeable,
GovernorCompatibilityBravoUpgradeable,
GovernorSettingsUpgradeable,
GovernorVotesQuorumFractionUpgradeable,
GovernorTimelockControlUpgradeable
{
Expand All @@ -34,6 +36,8 @@ contract TaikoGovernor is
_transferOwnership(_owner == address(0) ? msg.sender : _owner);
__Governor_init("TaikoGovernor");
__GovernorVotes_init(_token);
__GovernorSettings_init(7200, 50_400, 100_000 ether); // Values respectively: 1day, 1week,
// 0.01% of Taiko Token;
__GovernorVotesQuorumFraction_init(4);
__GovernorTimelockControl_init(_timelock);
}
Expand Down Expand Up @@ -75,20 +79,35 @@ contract TaikoGovernor is
/// @notice How long after a proposal is created should voting power be fixed. A
/// large voting delay gives users time to unstake tokens if necessary.
/// @return The duration of the voting delay.
function votingDelay() public pure override returns (uint256) {
return 7200; // 1 day
function votingDelay()
public
view
override(IGovernorUpgradeable, GovernorSettingsUpgradeable)
returns (uint256)
{
return super.votingDelay();
}

/// @notice How long does a proposal remain open to votes.
/// @return The duration of the voting period.
function votingPeriod() public pure override returns (uint256) {
return 50_400; // 1 week
function votingPeriod()
public
view
override(IGovernorUpgradeable, GovernorSettingsUpgradeable)
returns (uint256)
{
return super.votingPeriod();
}

/// @notice The number of votes required in order for a voter to become a proposer.
/// @return The number of votes required.
function proposalThreshold() public pure override returns (uint256) {
return 100_000 ether; // 0.01% of Taiko Token
function proposalThreshold()
public
view
override(GovernorUpgradeable, GovernorSettingsUpgradeable)
returns (uint256)
{
return super.proposalThreshold();
}

/// @dev Cancel a proposal with GovernorBravo logic.
Expand Down
Loading