A standard for Governance contracts that holds the administrative ownership of other smart contracts with voting power distributed as ERC-20
tokens.
The following standard defines the implementation of a standard API for a Governance smart contract based on ERC-20
. Existing ERC-173
compatible contracts can upgrade from private key wallet ownership to a Governance smart contract. Adhering to a standard API enables general tools to populate governance information of various projects, thus increasing transparency.
Traditionally, many contracts that require that they be owned or controlled in some way use ERC-173
which standardized the use of ownership in the smart contracts. For example to withdraw funds or perform administrative actions.
contract dApp {
function doSomethingAdministrative() external onlyOwner {
// admin logic that can be performed by a single wallet
}
}
Often, such administrative rights for a contract are written for maintenance purpose but users need to trust the owner. Rescue operations by an owner have raised questions on decentralised nature of the projects. Also, there is a possibility of compromise of an owner's private key.
At present, many governance implementations by ambitious projects need users to visit a specific UI to see governance information about their project. Some examples of live implementations having different API that does the same thing are Compound Governance, Uniswap Governance and Sushiswap Governance. It's just like if the ERC-20 standard wasn't finalized, then token projects would have their own block explorer. Adhering to a standard API would enable general tools (like Etherscan) to populate governance information, thus increasing transparency to users. Using widely popular ERC-20
token as a governance token, existing tools built to work with ERC-20
can already display voters. This can result in a wide adoption for contract governance over private key based ownership.
A Governance contract that is compliant with ERC-2767
shall implement the following interfaces:
/// @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);
}
ERC-20
Governance TokenAn ERC-2767
Governance Contract should reference an address through token()
that implements ERC-20
interface. token()
is allowed to return self address (address(this)
), if ERC-20
functionalities are implemented in the same contract (one can consider checking out Diamond Standard ERC-2535
to optimise contract size).
Implementations are allowed to have varying ERC-20
's totalSupply()
(through any standard of minting or burning). But having a fixed quorumVotes()
return value in this case would cause required votes consensus in %
with respect to totalSupply()
to change. To automatically account for this, any custom logic under quorumVotes()
is allowed to return for e.g. 51%
of totalSupply()
.
ERC-165
Interface IdentificationAn ERC-2767
Governance Contract should also implement ERC-165
. This helps general tools to identify whether a contract is a ERC-2767
Governance contract.
interface ERC165 {
/// @notice Query if a contract implements an interface
/// @param interfaceID The interface identifier, as specified in ERC-165
/// @dev Interface identification is specified in ERC-165. This function
/// uses less than 30,000 gas.
/// @return `true` if the contract implements `interfaceID` and
/// `interfaceID` is not 0xffffffff, `false` otherwise
function supportsInterface(bytes4 interfaceID) external view returns (bool);
}
The goals of this EIP have been the following:
ERC-20
based weighted governance over existing multi-sig (generally limited to 50 max owners) for big projects.ERC-173
ownership smart contracts / projects to move to Governance based ownership by removing the effort needed to host custom UI for their project.ERC-20
which anyone can use.ERC-20
tools for owners of governance token analysis.Smart contracts that are ERC-173
compliant can transfer their ownership to a Governance contract. This enables such contracts to become compatible with ERC-2767
Governance.
However, there are some existing projects with governance implementations and most of them have custom APIs (Compound Governance, Uniswap Governance and Sushiswap Governance), since a standard did not exist. Not having an ERC-2767
compatible governance contract means only that general tools might not be able to populate their governance information without including some special code for the project.
For existing governance contracts to get compatible with ERC-2767
:
ERC-2767
compatible. This is suitable for those who use Multi-sig wallets for Governance.ERC-20
based (weighted votes) have a bit advanced way to avoid it. Basically, they can create a forwarder contract implements ERC-2767
and forwards all calls to the actual non-standard methods. Projects can list the forwarder contract to display the information project's governance info without requiring any custom code in analysys tool, but this might have certain limitations depending on the project's existing governance implementation. Specification of forwarder contract is out of scope for this EIP and it may be addressed in another EIP if required.The reference implementations are available in this repository. Publicly audited implementations will be included in future.
Implementers are free to choose between On-chain and Off-chain consensus. Exact specification is out of scope for this standard (open for other EIPs to standardize). However, this section mentions points that implementers can consider.
In such implementations, community can create transaction proposals and vote on it by sending on-chain transactions.
ERC-191
or ERC-712
.Copyright and related rights waived via CC0.