---
eip: 7787
label: ERC-7787
title: Soulbound Degradable Governance
status: Draft
type: Standards Track
category: ERC
created: 2024-10-15
requires: 20
official: https://eips.ethereum.org/EIPS/eip-7787
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7787.md
canonical: https://eips.huatuo.xyz/zh/eip-7787/
lang: zh
tldr: 一种 DAO 治理模式：投票权是不可转让的代币，宽限期过后会衰减，除非通过贡献来续期，从而把政治权力与金钱分开。
tags: [governance, dao, soulbound, voting]
---

# ERC-7787: Soulbound Degradable Governance

> DAO governance where voting power is non-transferable and decays over time without active contributions.

**TL;DR:** 一种 DAO 治理模式：投票权是不可转让的代币，宽限期过后会衰减，除非通过贡献来续期，从而把政治权力与金钱分开。

## 它解决什么问题？

大多数 DAO 采用一币一票。由于代币可以购买，投票权会随财富而走：大户占据主导，小贡献者逐渐疏离，文化也偏向金库而不是实际工作。

灵魂绑定可衰减治理（Soulbound Degradable Governance，SDG）提议把两种权力分开，尤其适合年轻的 DAO：

- **经济权力**：用于流动性和融资的普通可交易代币（通常是 [ERC-20](/eip-20/)）。
- **政治权力**：授予投票权的不可转让代币，通过贡献获得，停止贡献就会逐渐消退。

## 它如何运作

实现必须：

1. 重写治理代币的 `transfer`，使其无法在地址之间移动（soulbound）。
2. 重写 `getVotes(account)`，使投票权**随时间衰减**；建议使用线性或指数衰减。
3. 每当某个地址的投票权发生变化时触发事件。

该接口增加了两个时间参数，默认均为 90 天，可被重写：

- `gracePeriod()`：投票单位被授予后，在这段时间内保持全部投票权。
- `decayPeriod()`：宽限期之后，投票权在这段时间内降至零。

授予新的投票单位（例如通过 DAO 投票奖励某项贡献）会重置计时，因此活跃成员保留影响力，不活跃的成员则自然淡出。该标准与代币类型无关：参考实现“Valocracy”为每位成员使用一个 soulbound 的 [ERC-721](/eip-721/)，其中存储投票单位。

## 示例代码

参考实现中 `getVotes` 内部的线性衰减：

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

abstract contract DecayingVotes {
    mapping(address => uint256) internal units;
    mapping(address => uint256) internal lastGrant;

    function gracePeriod() public view virtual returns (uint256) { return 90 days; }
    function decayPeriod() public view virtual returns (uint256) { return 90 days; }

    function getVotes(address a) public view virtual returns (uint256) {
        uint256 t = lastGrant[a];
        if (t == 0 || block.timestamp < t + gracePeriod()) return units[a];
        uint256 elapsed = block.timestamp - (t + gracePeriod());
        if (elapsed >= decayPeriod()) return 0;
        return units[a] * (decayPeriod() - elapsed) / decayPeriod();
    }

    function _grant(address a, uint256 amount) internal {
        uint256 old = getVotes(a);
        units[a] = old + amount;       // remaining power + new grant
        lastGrant[a] = block.timestamp; // restart grace period
    }
}
```

## 需要注意

- 状态：**Draft**。安全注意事项仍是 TODO。
- 规范中的接口在 `interface` 内部写成了 `public view virtual` 函数，直接编译会失败；请把它当作对所需函数的描述。
- 在 `getVotes` 中惰性计算的衰减投票权，必须与基于快照的治理器（例如带检查点的 `getPastVotes`）良好配合；请确认你的治理器是如何读取票数的。
- 能够授予投票单位的人实际上控制着 DAO，因此这个角色（通常就是治理器本身）需要谨慎设计。
- 相关想法：灵魂绑定 NFT（[ERC-5192](/eip-5192/)）和委托投票（[ERC-5805](/eip-5805/)）。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7787
