npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@tallyxyz/super-quorum

v1.0.5

Published

### NOTE: This contract is currently not audited. Do not use in production without an Audit.

Downloads

8

Readme

SuperQuorumGovernor Smart Contract

NOTE: This contract is currently not audited. Do not use in production without an Audit.

General Overview

The SuperQuorumGovernor smart contract is an innovative extension of the standard governance model provided by OpenZeppelin. It introduces the concept of "Super Quorum" in governance proposals. This higher quorum threshold is designed to ensure that only proposals with substantial backing and consensus are approved, particularly in critical decision-making scenarios. The contract is developed in Solidity ^0.8.20 and is an integration of OpenZeppelin's governance contracts, including Governor, GovernorSettings, GovernorCountingSimple, GovernorStorage, GovernorVotes, GovernorVotesQuorumFraction, and GovernorTimelockControl.

Upgradeable Verision included

There are two folders for both a regular version that deploys with a constructore function, and a second version designed to be used in a clone factory that utilizes an initializer.

Goal of the New Addition

The GovernorVotesSuperQuorumFraction module adds a robust layer to the governance process by implementing a super quorum threshold, which is significantly higher than the standard quorum. This addition is crucial for enhancing governance security and decision-making quality, especially for critical or sensitive proposals within decentralized organizations or protocols. By setting a higher consensus requirement, it ensures that critical decisions are made with a broader agreement among stakeholders, adding an extra layer of security and stability to the governance process.

Usage Examples and Why to Use It

Scenario: Critical Protocol Changes

In decentralized finance (DeFi) projects or other blockchain-based organizations, modifying core protocol parameters or upgrading smart contract logic are decisions that significantly impact the ecosystem. The SuperQuorumGovernor is particularly useful in these scenarios as it ensures such critical proposals are approved only when there is an overwhelming consensus among the token holders, reflecting a wide and strong support.

Scenario: Emergency Decisions

In situations that require emergency measures, it is crucial that decisions are made swiftly but also have strong backing from the community to ensure they are in the collective interest of the stakeholders. The super quorum mechanism is ideal for these situations as it helps measure and ensure overwhelming support for such emergency actions.

Changes to the Code

The SuperQuorumGovernor introduces several key modifications to the standard governance structure:

  1. Super Quorum Threshold: A new variable _superQuorumThreshold is introduced to set the minimum votes required for a proposal to be considered successful under super quorum rules.

  2. State Function Override: The state function is overridden to include super quorum logic. Proposals now need to be not just active but also meet or exceed the super quorum threshold to be considered successful.

  3. New Events and Error Handling: The contract includes the SuperQuorumNumeratorUpdated event and the GovernorInvalidSuperQuorumFraction error for handling updates and validations related to the super quorum threshold.

Conclusion

The SuperQuorumGovernor contract is a significant enhancement to the governance process in decentralized systems. It introduces a mechanism that requires higher consensus for critical decisions, ensuring that major changes are made with broad community support. This approach adds an extra layer of security and stability, making it an essential tool for robust decentralized governance.

Tests

npx hardhat compile
npx hardhat test

Use it as package

npm add @tallyxyz/super-quorum

Import the standard contract:

import "@tallyxyz/contracts/standard/SuperQuorumGovernor.sol";
// as extension:
import "@tallyxyz/contracts/standard/extension/GovernorVotesSuperQuorumFraction.sol";

Using the upgradeable version:

import "@tallyxyz/contracts/upgradeable/SuperQuorumGovernorUpgradeable.sol";
// as extension:
import "@tallyxyz/contracts/upgradeable/extension/GovernorVotesSuperQuorumFractionUpgradeable.sol";

import the super governor !