Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC2767, a proposal for decentralized, vote-based governance using ERC20 tokens.

This article translates, summarizes, and expands on the proposal below.

I also cover other EIPs.

Overview

ERC2767 proposes an API for governance smart contracts that distribute voting power using ERC20 tokens. A governance contract is designed to hold administrative authority (ownership) over other smart contracts. Existing contracts that support ERC173, the contract ownership standard, can therefore move from ownership by a private-key-based wallet to ownership by a governance contract.

For background on ERC173, see the following article.

[ERC173] How Contract Ownership Is Managed

Motivation

Many smart contracts have traditionally relied on ownership standards such as ERC173 for administrative operations and fund withdrawals. The following code illustrates a typical example.

js
contract dApp {
  function doSomethingAdministrative() external onlyOwner {
    // 単一のウォレットによって行われる管理ロジック
  }
}

However, this design has several drawbacks.

  • The project's decentralization depends on trust; in practice, authority is concentrated in the administrator of a single wallet.
  • Compromise of the administrator's private key poses a significant security risk.
  • Emergency actions such as rescue operations depend on an individual's judgment rather than governance.

Furthermore, many existing governance implementations (such as Compound, Uniswap, and SushiSwap) expose their own APIs, requiring users to visit each project's dedicated UI to inspect governance activity. It is as if ERC20 did not exist and every token required a different block explorer.

A standard governance API would allow general-purpose tools such as Etherscan to display governance information consistently, improving transparency and user confidence. Existing ERC20 tokens can also serve directly as governance tokens, making integration easier and maintaining compatibility with existing tooling.

The proposal aims to accelerate the transition from private-key-based ownership to standardized contract-based governance.

Specification

ERC2767 defines a standard interface for governance smart contracts. The contract distributes voting power through ERC20 tokens and can hold administrative authority (ownership) over other smart contracts.

Implementing this specification provides a common governance API across projects, allowing tools to detect governance contracts and retrieve information automatically. This improves transparency and makes the system easier for users to understand.

Interface

ERC2767.sol
/// @title ERC-2767 Governance
/// @dev ERC-165 InterfaceID: 0xd8b04e0e
interface ERC2767 is ERC165 {
    /// @notice Gets number votes required for achieving consensus
    /// @dev Should cost less than 30000 gas
    /// @return Required number of votes for achieving consensus
    function quorumVotes() external view returns (uint256);

    /// @notice The address of the Governance ERC20 token
    function token() external view returns (address);
}

quorumVotes

javascript
function quorumVotes() external view returns (uint256);

Returns the number of votes required to reach consensus in governance. For decisions made through voting, it retrieves the minimum number of votes (quorum) required to pass a proposal. This value can be fixed or dynamic (for example, 51% of total supply). The gas cost should be less than 30,000.

Return value

  • uint256
    • The number of votes required to reach consensus.

token

javascript
function token() external view returns (address);

Returns the address of the ERC20 token used by the governance contract. Specifically, it returns the address of the ERC20 token contract used to distribute voting power. If token functionality is built into the governance contract itself, it may return address(this). A design that accommodates changes in the quorum calculation as the ERC20 token supply fluctuates is recommended.

Return value

  • address
    • The ERC20 token contract address.

Governance token integration

The specification explicitly identifies the ERC20 token on which voting power is based and makes its address available through token(). If the governance contract itself incorporates ERC20 functionality, token() may return address(this).

An upgradeable architecture such as the Diamond Standard (ERC2535) can help optimize code size when governance and token functionality are combined.

For background on ERC2535, see the following article.

[ERC2535] 💎 Understanding the Diamond Pattern

Flexible quorum calculation

quorumVotes() can return a fixed value, but if the ERC20 token's totalSupply() fluctuates, it is preferable to calculate quorum as a proportion of the total. For example, a threshold of 51% of total supply is possible and helps preserve fairness in the voting system.

Interface detection through ERC165

For background on ERC165, see the following article.

[ERC165] Checking Whether a Contract Supports an Interface

supportsInterface

javascript
function supportsInterface(bytes4 interfaceID) external view returns (bool);

Determines whether a contract implements a particular interface (in this case, ERC2767). Under the ERC165 specification, it accepts an interfaceID and determines whether the ID is supported. The ERC2767 interface ID is 0xd8b04e0e. Reporting support for this ID allows tools to recognize the contract automatically as a governance-compatible contract.

Parameters

  • interfaceID
    • The interface ID to check (type bytes4).

Return value

  • bool
    • Returns true if the target interface is supported, or false otherwise.

ERC165

javascript
interface ERC165 {
    function supportsInterface(bytes4 interfaceID) external view returns (bool);
}

An interface for querying which interfaces a contract supports. ERC165 is a standard that lets tools check interface compatibility dynamically. Implementing it makes governance-compatible contracts explicitly discoverable by external tools.

Parameters

  • interfaceID
    • The interface ID to query (type bytes4).

Additional considerations

ERC2767 aims to standardize governance functionality so that more projects can operate under transparent administrative structures. Its objectives include the following.

  • Standardize governance contract APIs to simplify the development of analytics tools and dashboards.
  • Encourage ERC20-based weighted governance for large projects rather than multisignature arrangements that can accommodate only around 50 owners.
  • Help existing ERC173-compatible contracts transition to governance without building a custom UI.
  • Promote the public use of audited governance contracts so that anyone can use secure implementations, as with ERC20.
  • Enable existing ERC20 analytics tools to analyze governance tokens as well.
  • Make future protocols that integrate governance information from multiple projects possible.
  • Keep ERC2767 deliberately minimal so that other EIPs can standardize specific functionality.

Compatibility

Existing smart contracts that comply with ERC173 can transition to governance control simply by transferring ownership to an ERC2767-compliant governance contract.

Many governance systems already in operation at the time of writing (such as Compound, Uniswap, and SushiSwap) have their own APIs. In the absence of standardization, tools must support each project individually.

The following approaches can be used to achieve ERC2767 compliance.

One option is to deploy a new ERC2767-compliant governance contract and transfer ownership of existing contracts to it. This is particularly suitable for projects that previously used a multisig for governance.

Where redeployment is difficult, or existing governance uses a weighted voting structure similar to ERC20, a forwarder contract offers another approach. An ERC2767-compliant wrapper can transparently call the existing nonstandard API. By targeting the forwarder contract, analytics tools can retrieve information without custom code.

The specification for such a forwarder contract is outside the scope of this EIP and may be defined in a separate EIP if needed.

The central goals of ERC2767 are greater decentralization and transparency in governance. The design also offers the following security benefits.

  • Administration without reliance on a single private key
    • Under a single-owner model such as ERC173, a compromised key could be catastrophic. ERC2767 enables administration through distributed voting.
  • Detection through a known interface
    • Integration with ERC165 allows external tools to identify governance contracts, making it easier to distinguish them from fraudulent or disguised contracts.
  • Reusable audited implementations
    • Standardized governance contracts are easier for third parties to review and audit, and reuse can reduce security risks.
  • Less dependence on project-specific implementations
    • Avoiding bespoke governance implementations reduces the risk of bugs and vulnerabilities caused by implementation errors or excessive complexity.

In this way, ERC2767 offers a design that is attractive to modern projects from both a functional and a security perspective.

Security

ERC2767 leaves it to implementers to decide whether governance consensus takes place on-chain or off-chain, without defining a concrete implementation. Each approach has its own considerations.

On-chain governance

In the on-chain approach, community members create transaction proposals and vote on them on-chain. Its primary advantages are transparency and immediate verifiability.

To prevent double voting, implementations can use OpenZeppelin's voting snapshots. These fix token holdings at a particular block so that subsequent token transfers do not affect that vote.

Off-chain governance

In the off-chain approach, participants cast votes or express their intentions using signatures, which are subsequently submitted on-chain for execution. This reduces gas costs and allows flexible designs, but requires signature verification and replay protection.

Following recommended signature formats such as ERC191 and ERC712 helps maintain security and compatibility.

For background on ERC191, see the following article.

[ERC191] Using Signed Data Securely

For background on ERC712, see the following article.

[EIP712] Hashing and Signing Typed Structured Data

To prevent replay attacks (the reuse of previous signatures), the proposal recommends processing signatures sorted by signer address. This reduces the risk of unauthorized execution caused by resubmitting the same set of signatures in a different order.

The security considerations therefore depend on the chosen governance approach, and each requires appropriate implementation measures. Because the standard does not specify a concrete implementation, further details may be standardized through separate EIPs.

References

Soham Zemse (@zemse), Nick Mudge (@mudgen), "ERC-2767: Contract Ownership Governance [DRAFT]," Ethereum Improvement Proposals, no. 2767, July 2020. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2767.

Conclusion

This article covered ERC2767, a proposal for decentralized, vote-based governance using ERC20 tokens. I hope it was useful.

If you have questions, feel free to contact me via Twitter DM.

Twitter @cardene777

I also publish on other platforms.

https://chaldene.net/