ERC-2767 · Stagnant · ERC · 2020-07-04
ERC-2767: Contract Ownership Governance
A minimal interface for governance contracts that own other contracts, with voting power held as an ERC-20 token, so explorers and tools can read any project's governance setup the same way.
What problem does it solve?
Many contracts have an admin role defined by ERC-173: a single owner() address that can withdraw funds, pause, or upgrade. Often that owner is one private key, which users must trust and which can be stolen.
Projects that moved to token-based governance (the spec cites Compound, Uniswap and SushiSwap's GovernorAlpha contracts) each built their own API. As a result, a generic tool such as a block explorer can't show "who governs this contract and how many votes are needed" without custom code for every project, much like token support before ERC-20 existed.
How it works
A governance contract compliant with ERC-2767 is set as the ERC-173 owner of the contracts it controls, and exposes two read functions:
| Function | Meaning |
|---|---|
quorumVotes() |
Number of votes needed to reach consensus |
token() |
Address of the ERC-20 token that represents voting power |
Details from the spec:
- Voting power is ERC-20 balances, so existing token tools already show who the voters are.
token()may return the governance contract's own address if it implements ERC-20 itself.- If the token's supply changes,
quorumVotes()may compute its value dynamically, for example 51 % oftotalSupply(). - The contract must also implement ERC-165; the interface ID is
0xd8b04e0e. - How proposals are created and voted on (on-chain voting or off-chain signatures, for example with EIP-712) is intentionally left out of scope.
Sample code
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
interface IERC165 {
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
/// @dev ERC-165 interface ID: 0xd8b04e0e
interface IERC2767 is IERC165 {
function quorumVotes() external view returns (uint256);
function token() external view returns (address);
}
interface IERC20Supply {
function totalSupply() external view returns (uint256);
}
contract SimpleGovernance is IERC2767 {
address public immutable token;
constructor(address governanceToken) {
token = governanceToken;
}
/// Quorum is a simple majority of the current supply.
function quorumVotes() external view returns (uint256) {
return IERC20Supply(token).totalSupply() / 2 + 1;
}
function supportsInterface(bytes4 id) external pure returns (bool) {
return id == type(IERC2767).interfaceId || id == type(IERC165).interfaceId;
}
// Proposal / voting / execution logic goes here (out of scope for ERC-2767).
}
Things to know
- Status: Stagnant. The standard was not finalized. In practice the ecosystem converged on the OpenZeppelin Governor / Compound Governor Bravo family of contracts, which expose much richer (and different) interfaces.
- The interface says nothing about voting periods, proposal thresholds, timelocks or delegation; those are what actually make governance safe and must be designed separately.
- Existing governance systems could add compatibility through a forwarder contract that implements these two functions, as the spec suggests.