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.

ERC-7787 proposes a governance token model in which voting power gradually decays over time.

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

More EIP explainers:

Overview

ERC-7787 proposes assigning governance rights through non-transferable tokens whose voting power decreases over time. This model is called Soulbound Degradable Governance (SDG).

Voting power can be renewed through continued participation in a decentralized autonomous organization (DAO), according to its contribution and governance policies.

The objective is to support governance based on contributions rather than exclusively on financial resources, particularly during the early stages of a DAO.

Motivation

Conventional DAO governance models often allocate voting power in proportion to holdings of transferable tokens.

Although this approach is useful in some contexts, it can concentrate influence among participants with substantial financial resources. Participants with less capital may have limited influence over collective decisions.

Financial incentives may also encourage participation motivated primarily by short-term returns rather than the organization's long-term objectives.

Early-stage DAOs may therefore benefit from a governance mechanism that rewards active contributions without relying exclusively on token purchases or inflationary token issuance.

SDG separates governance power from transferable economic assets. Governance tokens represent an ongoing record of participation, and their voting power decays after a period of inactivity.

Participants must continue contributing through mechanisms recognized by the DAO to maintain their voting influence.

This design can encourage engagement, but its effectiveness depends on how the organization recognizes contributions and authorizes voting-power updates. Non-transferability alone does not guarantee decentralized or democratic governance.

Specification

SDG separates governance rights from economic value.

Governance tokens must be non-transferable and their voting power must decay over time. Separate economic tokens may remain transferable and support the DAO's financial activities and liquidity. ERC-20 is recommended for this economic role where appropriate.

The governance-token implementation must prevent transfers between accounts. Overriding transfer-related functions is one way to enforce this requirement, but the restriction must cover every applicable transfer path, including inherited functions and internal hooks.

The getVotes function must account for the elapsed time since the most recent voting-power update. Linear and exponential decay are possible approaches.

Linear decay reduces voting power by a constant absolute amount per unit of time. Standard exponential decay reduces it by a constant proportion per unit of time; it does not necessarily accelerate as time passes.

Appropriate events should also record explicit voting-power updates so that applications can track changes. Voting power that decays automatically as a function of time does not itself emit an event at every moment; clients must calculate that decay from the relevant state.

Interface

js
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

interface SDG {
  /**
   * @dev Returns the grace period duration before the voting units begins decaying. This period is
   * fixed to 90 days. But it can be overridden in derived contracts.
   * @return The duration of the grace period in seconds.
   */
  function gracePeriod() public view virtual returns (uint256);

  /**
   * @dev Returns the duration of the decay period during which the voting units decreases. This
   * period is fixed to 90 days. But it can be overridden in derived contracts.
   * @return The duration of the decay period in seconds.
   */
  function decayPeriod() public view virtual returns (uint256);

  /**
   * @dev Should be implemented by derived contracts to return the current voting units of an account.
   * This function calculates the voting units based on the last time it was updated and decays it
   * over time.
   * @param account The address to check for voting units.
   * @return The current voting units of the account.
   */
  function getVotes(address account) public view virtual returns (uint256);
}

The proposal defines three functions.

gracePeriod

Returns the duration before voting power begins to decay.

The interface documentation describes a default grace period of 90 days, with the option for derived implementations to override it.

This allows participants to retain their voting power during a period of inactivity before decay begins.

decayPeriod

Returns the duration over which voting power decreases.

The documented default is also 90 days, with implementations able to customize the duration.

Voting power gradually decreases during this period according to the applicable decay function.

getVotes

Calculates and returns the current voting power of a specified account.

The calculation uses the time of the most recent voting-power update and the implementation's decay rules.

An account that has not received a qualifying voting-power update for an extended period will therefore have reduced voting power.

The code excerpt is retained from the original article. Its interface declarations use public and virtual modifiers; Solidity interface functions must be declared external and are implicitly virtual. A concrete implementation should use declarations appropriate to the chosen contract structure and compiler version.

Rationale

SDG is designed independently of any particular underlying token standard.

A DAO can implement its governance mechanism using an architecture based on ERC-20, ERC-721, ERC-1155, or another token model, provided the relevant governance units remain non-transferable and their voting power follows the required decay behavior.

Separating voting power from transferable economic assets reduces the direct relationship between financial resources and governance influence. Participants cannot simply purchase additional governance tokens through ordinary token transfers.

Because voting power also decays over time, maintaining influence requires continued participation under the DAO's rules.

This makes recent contributions an important component of governance rather than relying exclusively on long-term asset ownership.

The standard deliberately leaves several policy choices to individual DAOs. It does not prescribe a fixed contribution-assessment mechanism, a privileged founding role, or a single mandatory decay formula.

Implementations can therefore choose their own initial allocations, contribution requirements, authorization policies, and decay characteristics while following the proposed governance interface.

The grace period and decay period serve different purposes.

The grace period allows members to retain voting power during short periods of inactivity. The decay period then reduces the influence of members whose voting power has not been renewed for a longer period.

For example, in an implementation using a 90-day grace period followed by a 90-day linear decay period, an initial allocation of 100 voting units would retain its full value throughout the grace period, decrease to approximately 50 units halfway through the decay period, and reach zero when the decay period ends, subject to integer rounding.

This approach aims to balance continuity in governance with incentives for ongoing contributions.

Applications must still define how historical voting power is determined for proposals. Using only a time-dependent current getVotes result can be insufficient for voting systems that require snapshots, quorum calculations, or historical vote verification.

Reference implementation

js
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

import { SDG } from "./SDG.sol"; // SDG implementation
import { SOULERC721 } from "./ERC721/SOULERC721.sol"; // Soulbounded ERC721 implementation
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; // Oz Ownable contract

/**
 * @title Valocracy
 * @dev Implements the SDG governance model where governance power decays over time if not actively maintained.
 * Only the DAO governance contract, as the owner, can mint new tokens or grant additional governance power.
 */
contract Valocracy is SDG, SOULERC721, Ownable {
  // Event emitted when voting units are updated
  event VotingUnitsUpdated(address indexed account, uint256 oldVotingUnits, uint256 newVotingUnits);

  // Sequential ID and total supply of tokens
  uint256 public totalSupply;

  // Mapping of addresses to their token IDs
  mapping(address => uint256) private _tokens;

  /**
   * @param _name The name of the ERC721 token.
   * @param _symbol The symbols of the ERC721 token.
   */
  constructor(
    string memory _name,
    string memory _symbol
  ) Ownable(_msgSender()) SOULERC721(_name, _symbol) {}

  /**
   * @dev See {IERC721Metadata-tokenURI}.
   * @notice This function returns a static string as the token URI. In a real implementation, this
   * function should return an URI that points to a JSON file with metadata about the token. Or even
   * better, a dynamic SVG that displays the governance power of the token holder.
   */
  function tokenURI(uint256 tokenId) public pure override returns (string memory) {
    return "Custom images or Dynamic NFT that displays the governance power";
  }

  /**
   * @dev See {ISDG-getVotes}.
   */
  function getVotes(address account) public view override returns (uint256) {
    uint256 grantedTime = _lastUpdateOf(account);

    // If no voting units was granted or still in grace period, return all voting units
    if (grantedTime == 0 || block.timestamp < grantedTime + gracePeriod()) {
      return _votingUnitsOf(account);
    }

    // Calculate time passed since grace period ended
    uint256 timeSinceGracePeriod = block.timestamp - (grantedTime + gracePeriod());

    // If decay period is over, return 0
    if (timeSinceGracePeriod >= decayPeriod()) {
      return 0;
    }

    // Linear decay: Calculate remaining voting units during decay period
    uint256 decayPercentage = (timeSinceGracePeriod * 1e18) / decayPeriod(); // Percentage in 18 decimals
    uint256 remainingVotes = (_votingUnitsOf(account) * (1e18 - decayPercentage)) / 1e18;

    return remainingVotes;
  }

  /**
   * @dev Grants voting units to the specified account by `amount`. Only the contract owner can
   * mint new tokens and grant additional votings units. If the users doesn't have a token, one
   * will be minted for them.
   * @param to The address to mint the new token or grant additional voting units.
   * @param amount The amount of voting units to grant alongside the token.
   */
  function grantVotingUnits(address to, uint256 amount) public virtual onlyOwner {
    if (_tokens[to] == 0) {
      _mint(to, ++totalSupply);
      _tokens[to] = totalSupply;
    }

    uint256 votingUnits = getVotes(to);
    _setVotingUnits(to, votingUnits + amount);

    emit VotingUnitsUpdated(to, votingUnits, amount);
  }

  /**
   * @notice Burns an ERC721 token and erases the voting units associated with the token holder.
   * @dev The token must exist and be burnable by the token holder or authorized entity.
   * @param tokenId The ID of the token to burn.
   */
  function burn(uint256 tokenId) public virtual {
    address from = ownerOf(tokenId);
    uint256 votingUnits = getVotes(from);

    _tokens[from] = 0;
    _setVotingUnits(from, 0);
    _burn(tokenId);

    emit VotingUnitsUpdated(from, votingUnits, 0);
  }
}

The Valocracy example combines an SDG implementation, a soulbound ERC-721 implementation, and OpenZeppelin's Ownable access-control mechanism.

Its getVotes function calculates current voting units using three stages:

  1. Before the grace period ends, the stored voting units are returned without decay.
  2. During the decay period, voting units decrease linearly.
  3. After the decay period ends, the returned voting power is zero.

The grantVotingUnits function is restricted to the owner. It mints a token for an account that does not yet have one and adds newly granted units to the account's current, potentially decayed voting power.

The burn function clears the account's associated voting units and burns its token.

The reference code is reproduced unchanged from the original article. It has not been independently compiled or audited.

Several implementation details require particular attention:

  • The displayed burn function is public and does not explicitly check whether the caller is the token holder or an authorized party. Unless the inherited burn implementation enforces the necessary authorization, another caller could burn a member's governance token.
  • VotingUnitsUpdated describes its final argument as newVotingUnits, but grantVotingUnits emits the newly granted amount rather than the resulting total. Consumers should not interpret this event as the new total without resolving that inconsistency.
  • The variable named totalSupply is incremented when issuing tokens but is not decremented in the displayed burn function. It behaves as a sequential issuance counter rather than necessarily representing the number of currently existing tokens.
  • The security of non-transferability and voting-unit updates depends on the inherited SDG and SOULERC721 implementations, which are not shown in this excerpt.
  • The tokenURI function returns an illustrative string rather than a production metadata URI.

These details should be reviewed and corrected as appropriate before using the reference implementation in a production governance system.

Citation

Guilherme Neves (@0xneves), Rafael Castaneda rafaelcastaneda@gmail.com, "ERC-7787: Soulbound Degradable Governance [DRAFT]," Ethereum Improvement Proposals, no. 7787, October 2024. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-7787.

Conclusion

ERC-7787 proposes a governance model based on non-transferable tokens and time-dependent voting power. By separating governance rights from economic assets and allowing voting power to decay, the model aims to reward continued participation rather than passive token ownership.

Its practical security and fairness depend on contribution assessment, authorization policies, voting snapshots, and the implementation of the decay mechanism.

Questions are welcome via Twitter @cardene777.

Other publications:

https://chaldene.net/