{"eip":7837,"title":"Diffusive Tokens","description":"A fungible token that mints new tokens on transfer, charges a per-token native fee, and enforces a capped supply.","authors":["Cheng Qian (@jamesavechives) \u003cjames.walstonn@gmail.com\u003e"],"status":"Final","type":"Standards Track","category":"ERC","created":"2024-12-07","discussionsTo":"https://ethereum-magicians.org/t/erc-7837-diffusive-tokens/21989","repo":"ERCs","label":"ERC-7837","officialUrl":"https://eips.ethereum.org/EIPS/eip-7837","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7837.md","url":"https://eips.huatuo.xyz/eip-7837/","tldr":{"en":"A fungible token where transfer mints new tokens to the recipient instead of moving the sender's, with a per-token ETH fee paid to the issuer and an owner-set supply cap.","ja":"transfer が送信者のトークンを移す代わりに、受信者に新しいトークンをミントする代替可能トークン。トークンごとの ETH 手数料が発行者に支払われ、供給上限はオーナーが設定する。","ko":"transfer가 발신자의 토큰을 옮기는 대신 수신자에게 새 토큰을 민팅하는 대체 가능 토큰. 토큰당 ETH 수수료를 발행자에게 내며, 공급 상한은 소유자가 설정한다.","zh":"一种同质化代币：transfer 不是转移发送者的代币，而是向接收者铸造新代币，按每个代币收取 ETH 费用支付给发行者，供应上限由所有者设定。"},"tags":["token","fungible","minting","erc-20","fees"],"explainers":{"en":{"lang":"en","tldr":"A fungible token where transfer mints new tokens to the recipient instead of moving the sender's, with a per-token ETH fee paid to the issuer and an owner-set supply cap.","tags":["token","fungible","minting","erc-20","fees"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7837/","markdown":"## What problem does it solve?\n\nIn an [ERC-20](/eip-20/) token, total supply is redistributed by transfers: if A sends 10 tokens to B, A has 10 fewer. ERC-7837 describes a different economic model, **Diffusive Tokens (DIFF)**, aimed at cases where an issuer wants tokens to spread out on demand rather than be pre-minted and passed around.\n\nThe spec's example is a manufacturer issuing tokens for a batch of physical products: each token can later be burned to redeem one item. Holders \"pass on\" tokens by minting new ones to others, paying the issuer a fee for each, until a maximum supply is reached.\n\n## How it works\n\n- **Transfer mints.** `transfer(to, amount)` does not reduce the sender's balance. It mints `amount` new tokens to `to` and increases `totalSupply`.\n- **Native fee.** The sender must pay `transferFee * amount` in the chain's native currency via `msg.value`; otherwise the call reverts. Fees accumulate in the contract.\n- **Supply cap.** A transfer that would push `totalSupply` above `maxSupply` reverts.\n- **Burn.** Holders can `burn(amount)` to reduce their balance and the total supply, for example to redeem the underlying good.\n- **Owner controls.** The owner can `setTransferFee`, `setMaxSupply` (not below current supply) and `withdrawFees(recipient)`.\n- **Optional approvals.** `approve`/`transferFrom` exist for compatibility; `transferFrom` consumes allowance but still mints to `to` without debiting `from`.\n\nEvents: `Transfer`, `Burn`, `FeeUpdated`, `MaxSupplyUpdated`.\n\nBecause `transfer` and `transferFrom` are `payable` and behave differently, DIFF is ERC-20 compatible only at the interface level, not in behavior.\n\n## Sample code\n\nCore logic, condensed from the spec's reference implementation:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ncontract DiffusiveToken {\n    uint256 public totalSupply;\n    uint256 public maxSupply;\n    uint256 public transferFee;          // wei per token\n    address public owner;\n    mapping(address =\u003e uint256) public balanceOf;\n\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n    event Burn(address indexed burner, uint256 amount);\n\n    constructor(uint256 _maxSupply, uint256 _fee) {\n        maxSupply = _maxSupply;\n        transferFee = _fee;\n        owner = msg.sender;\n    }\n\n    function transfer(address to, uint256 amount) external payable returns (bool) {\n        require(to != address(0) \u0026\u0026 amount \u003e 0, \"bad args\");\n        require(msg.value \u003e= transferFee * amount, \"insufficient fee\");\n        require(totalSupply + amount \u003c= maxSupply, \"cap\");\n        balanceOf[to] += amount;          // sender keeps their balance\n        totalSupply += amount;\n        emit Transfer(msg.sender, to, amount);\n        return true;\n    }\n\n    function burn(uint256 amount) external {\n        balanceOf[msg.sender] -= amount;  // reverts on underflow\n        totalSupply -= amount;\n        emit Burn(msg.sender, amount);\n    }\n\n    function withdrawFees(address payable to) external {\n        require(msg.sender == owner, \"owner\");\n        (bool ok, ) = to.call{value: address(this).balance}(\"\");\n        require(ok, \"withdraw failed\");\n    }\n}\n```\n\n## Things to know\n\n- Status is **Final**.\n- Anyone can call `transfer` regardless of their own balance. As written in the spec, holding tokens is not required to mint them to others; the fee and the cap are the only limits.\n- DEXs, lending protocols and wallets assume ERC-20 transfers conserve supply. Integrating a DIFF token with them can produce wrong prices, accounting or balances, and `payable` transfers will fail in callers that send no value.\n- The owner can change the fee and raise the cap at any time, which is a significant trust assumption for holders.\n- The spec's reference contract has bugs if copied literally (for example it reads `balances` and `allowances` mappings it never declares); review and test before using any implementation.\n"},"ja":{"lang":"ja","tldr":"transfer が送信者のトークンを移す代わりに、受信者に新しいトークンをミントする代替可能トークン。トークンごとの ETH 手数料が発行者に支払われ、供給上限はオーナーが設定する。","tags":["token","fungible","minting","erc-20","fees"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7837/","markdown":"## 何を解決するのか\n\n[ERC-20](/eip-20/) トークンでは、総供給量は転送によって再分配されます。A が B に 10 トークン送ると、A の残高は 10 減ります。ERC-7837 は、**Diffusive Tokens（DIFF）** という別の経済モデルを記述します。発行者が、トークンをあらかじめミントして回すのではなく、需要に応じて広がるようにしたい場合を想定しています。\n\n仕様の例は、製造業者が物理的な製品のロットに対してトークンを発行するケースです。各トークンは後でバーンして、製品 1 つと引き換えられます。保有者は、他の人に新しいトークンをミントすることでトークンを「引き継ぎ」、そのたびに発行者へ手数料を支払い、最大供給量に達するまで続きます。\n\n## 仕組み\n\n- **transfer がミントする。** `transfer(to, amount)` は送信者の残高を減らしません。`to` に `amount` の新しいトークンをミントし、`totalSupply` を増やします。\n- **ネイティブ通貨の手数料。** 送信者は `msg.value` でチェーンのネイティブ通貨を `transferFee * amount` だけ支払う必要があり、そうでなければ呼び出しは revert します。手数料はコントラクトに蓄積されます。\n- **供給上限。** `totalSupply` が `maxSupply` を超えることになる転送は revert します。\n- **バーン。** 保有者は `burn(amount)` で自分の残高と総供給量を減らせます。たとえば裏付けとなる商品との引き換えに使います。\n- **オーナーの権限。** オーナーは `setTransferFee`、`setMaxSupply`（現在の供給量を下回る値は不可）、`withdrawFees(recipient)` を実行できます。\n- **任意の承認。** 互換性のために `approve`/`transferFrom` が用意されています。`transferFrom` は allowance を消費しますが、`from` の残高は減らさずに `to` へミントします。\n\nイベント: `Transfer`、`Burn`、`FeeUpdated`、`MaxSupplyUpdated`。\n\n`transfer` と `transferFrom` は `payable` で、動作も異なるため、DIFF が ERC-20 と互換なのはインターフェースのレベルだけで、動作は互換ではありません。\n\n## サンプルコード\n\n仕様のリファレンス実装から要点をまとめたコアロジック:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ncontract DiffusiveToken {\n    uint256 public totalSupply;\n    uint256 public maxSupply;\n    uint256 public transferFee;          // wei per token\n    address public owner;\n    mapping(address =\u003e uint256) public balanceOf;\n\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n    event Burn(address indexed burner, uint256 amount);\n\n    constructor(uint256 _maxSupply, uint256 _fee) {\n        maxSupply = _maxSupply;\n        transferFee = _fee;\n        owner = msg.sender;\n    }\n\n    function transfer(address to, uint256 amount) external payable returns (bool) {\n        require(to != address(0) \u0026\u0026 amount \u003e 0, \"bad args\");\n        require(msg.value \u003e= transferFee * amount, \"insufficient fee\");\n        require(totalSupply + amount \u003c= maxSupply, \"cap\");\n        balanceOf[to] += amount;          // sender keeps their balance\n        totalSupply += amount;\n        emit Transfer(msg.sender, to, amount);\n        return true;\n    }\n\n    function burn(uint256 amount) external {\n        balanceOf[msg.sender] -= amount;  // reverts on underflow\n        totalSupply -= amount;\n        emit Burn(msg.sender, amount);\n    }\n\n    function withdrawFees(address payable to) external {\n        require(msg.sender == owner, \"owner\");\n        (bool ok, ) = to.call{value: address(this).balance}(\"\");\n        require(ok, \"withdraw failed\");\n    }\n}\n```\n\n## 知っておくべきこと\n\n- ステータスは **Final** です。\n- 自分の残高に関係なく、誰でも `transfer` を呼べます。仕様に書かれているとおり、他の人にミントするためにトークンを保有している必要はなく、制限は手数料と上限だけです。\n- DEX、レンディングプロトコル、ウォレットは、ERC-20 の転送が供給量を保存することを前提としています。DIFF トークンをこれらと統合すると、価格、会計、残高が誤る可能性があり、`payable` な転送は、value を送らない呼び出し側では失敗します。\n- オーナーは手数料をいつでも変更でき、上限も引き上げられます。これは保有者にとって重大な信頼の前提です。\n- 仕様のリファレンスコントラクトは、そのままコピーするとバグがあります（たとえば、宣言されていない `balances` と `allowances` マッピングを読み取っています）。どの実装を使う場合も、レビューとテストを行ってください。\n"},"ko":{"lang":"ko","tldr":"transfer가 발신자의 토큰을 옮기는 대신 수신자에게 새 토큰을 민팅하는 대체 가능 토큰. 토큰당 ETH 수수료를 발행자에게 내며, 공급 상한은 소유자가 설정한다.","tags":["token","fungible","minting","erc-20","fees"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7837/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-20](/eip-20/) 토큰에서는 총 공급량이 전송을 통해 재분배됩니다. A가 B에게 10개를 보내면 A는 10개가 줄어듭니다. ERC-7837은 **Diffusive Tokens(DIFF)**라는 다른 경제 모델을 설명합니다. 발행자가 토큰을 미리 민팅해 돌리는 대신 수요에 따라 퍼져 나가게 하고 싶은 경우를 겨냥합니다.\n\n스펙의 예시는 제조사가 실물 제품 한 묶음에 대해 토큰을 발행하는 경우입니다. 각 토큰은 나중에 소각해 제품 하나로 교환할 수 있습니다. 보유자는 다른 사람에게 새 토큰을 민팅하는 방식으로 토큰을 \"넘겨주고\", 그때마다 발행자에게 수수료를 내며, 최대 공급량에 도달할 때까지 이어집니다.\n\n## 어떻게 동작하나요?\n\n- **transfer가 민팅한다.** `transfer(to, amount)`는 발신자의 잔액을 줄이지 않습니다. `to`에게 `amount`만큼의 새 토큰을 민팅하고 `totalSupply`를 늘립니다.\n- **네이티브 수수료.** 발신자는 `msg.value`를 통해 체인의 네이티브 통화로 `transferFee * amount`를 내야 하며, 그렇지 않으면 호출이 revert됩니다. 수수료는 컨트랙트에 쌓입니다.\n- **공급 상한.** `totalSupply`가 `maxSupply`를 넘기게 되는 전송은 revert됩니다.\n- **소각.** 보유자는 `burn(amount)`로 자신의 잔액과 총 공급량을 줄일 수 있습니다. 예를 들어 기초 상품으로 교환할 때 씁니다.\n- **소유자 권한.** 소유자는 `setTransferFee`, `setMaxSupply`(현재 공급량 미만으로는 불가), `withdrawFees(recipient)`를 실행할 수 있습니다.\n- **선택적 승인.** 호환성을 위해 `approve`/`transferFrom`이 있습니다. `transferFrom`은 allowance를 소모하지만, `from`의 잔액을 차감하지 않고 `to`에게 민팅합니다.\n\n이벤트: `Transfer`, `Burn`, `FeeUpdated`, `MaxSupplyUpdated`.\n\n`transfer`와 `transferFrom`은 `payable`이고 동작도 다르므로, DIFF는 인터페이스 수준에서만 ERC-20과 호환되고 동작은 호환되지 않습니다.\n\n## 샘플 코드\n\n스펙의 참조 구현에서 핵심 로직만 간추린 것:\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ncontract DiffusiveToken {\n    uint256 public totalSupply;\n    uint256 public maxSupply;\n    uint256 public transferFee;          // wei per token\n    address public owner;\n    mapping(address =\u003e uint256) public balanceOf;\n\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n    event Burn(address indexed burner, uint256 amount);\n\n    constructor(uint256 _maxSupply, uint256 _fee) {\n        maxSupply = _maxSupply;\n        transferFee = _fee;\n        owner = msg.sender;\n    }\n\n    function transfer(address to, uint256 amount) external payable returns (bool) {\n        require(to != address(0) \u0026\u0026 amount \u003e 0, \"bad args\");\n        require(msg.value \u003e= transferFee * amount, \"insufficient fee\");\n        require(totalSupply + amount \u003c= maxSupply, \"cap\");\n        balanceOf[to] += amount;          // sender keeps their balance\n        totalSupply += amount;\n        emit Transfer(msg.sender, to, amount);\n        return true;\n    }\n\n    function burn(uint256 amount) external {\n        balanceOf[msg.sender] -= amount;  // reverts on underflow\n        totalSupply -= amount;\n        emit Burn(msg.sender, amount);\n    }\n\n    function withdrawFees(address payable to) external {\n        require(msg.sender == owner, \"owner\");\n        (bool ok, ) = to.call{value: address(this).balance}(\"\");\n        require(ok, \"withdraw failed\");\n    }\n}\n```\n\n## 알아둘 점\n\n- 상태는 **Final**입니다.\n- 누구나 자신의 잔액과 무관하게 `transfer`를 호출할 수 있습니다. 스펙에 쓰인 대로, 다른 사람에게 민팅하기 위해 토큰을 보유할 필요는 없으며 수수료와 상한만이 제약입니다.\n- DEX, 대출 프로토콜, 지갑은 ERC-20 전송이 공급량을 보존한다고 가정합니다. DIFF 토큰을 이들과 연동하면 가격, 회계, 잔액이 잘못될 수 있고, `payable` 전송은 value를 보내지 않는 호출자에서는 실패합니다.\n- 소유자는 언제든 수수료를 바꾸고 상한을 올릴 수 있으며, 이는 보유자에게 상당한 신뢰 가정입니다.\n- 스펙의 참조 컨트랙트는 글자 그대로 복사하면 버그가 있습니다(예: 선언한 적 없는 `balances`와 `allowances` 매핑을 읽습니다). 어떤 구현이든 사용하기 전에 검토하고 테스트하세요.\n"},"zh":{"lang":"zh","tldr":"一种同质化代币：transfer 不是转移发送者的代币，而是向接收者铸造新代币，按每个代币收取 ETH 费用支付给发行者，供应上限由所有者设定。","tags":["token","fungible","minting","erc-20","fees"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7837/","markdown":"## 它解决什么问题？\n\n在 [ERC-20](/eip-20/) 代币中，总供应量通过转账重新分配：A 向 B 发送 10 个代币，A 就少了 10 个。ERC-7837 描述了另一种经济模型，即 **Diffusive Tokens（DIFF）**，面向这样的场景：发行者希望代币按需扩散，而不是预先铸造再来回传递。\n\n规范中的例子是制造商为一批实体产品发行代币：每个代币之后可以销毁，以兑换一件商品。持有者通过向他人铸造新代币来\"传递\"代币，每次都要向发行者支付费用，直到达到最大供应量。\n\n## 它如何运作\n\n- **transfer 即铸造。** `transfer(to, amount)` 不会减少发送者的余额，而是向 `to` 铸造 `amount` 个新代币并增加 `totalSupply`。\n- **原生币费用。** 发送者必须通过 `msg.value` 以该链的原生货币支付 `transferFee * amount`，否则调用会 revert。费用累积在合约中。\n- **供应上限。** 会使 `totalSupply` 超过 `maxSupply` 的转账会 revert。\n- **销毁。** 持有者可以 `burn(amount)` 来减少自己的余额和总供应量，例如用来兑换对应的商品。\n- **所有者权限。** 所有者可以执行 `setTransferFee`、`setMaxSupply`（不得低于当前供应量）和 `withdrawFees(recipient)`。\n- **可选授权。** 为兼容而提供 `approve`/`transferFrom`；`transferFrom` 会消耗额度，但仍然向 `to` 铸造，而不扣减 `from`。\n\n事件：`Transfer`、`Burn`、`FeeUpdated`、`MaxSupplyUpdated`。\n\n由于 `transfer` 和 `transferFrom` 是 `payable` 且行为不同，DIFF 仅在接口层面与 ERC-20 兼容，行为上并不兼容。\n\n## 示例代码\n\n核心逻辑，从规范的参考实现中精简而来：\n\n```solidity\n// SPDX-License-Identifier: CC0-1.0\npragma solidity ^0.8.20;\n\ncontract DiffusiveToken {\n    uint256 public totalSupply;\n    uint256 public maxSupply;\n    uint256 public transferFee;          // wei per token\n    address public owner;\n    mapping(address =\u003e uint256) public balanceOf;\n\n    event Transfer(address indexed from, address indexed to, uint256 amount);\n    event Burn(address indexed burner, uint256 amount);\n\n    constructor(uint256 _maxSupply, uint256 _fee) {\n        maxSupply = _maxSupply;\n        transferFee = _fee;\n        owner = msg.sender;\n    }\n\n    function transfer(address to, uint256 amount) external payable returns (bool) {\n        require(to != address(0) \u0026\u0026 amount \u003e 0, \"bad args\");\n        require(msg.value \u003e= transferFee * amount, \"insufficient fee\");\n        require(totalSupply + amount \u003c= maxSupply, \"cap\");\n        balanceOf[to] += amount;          // sender keeps their balance\n        totalSupply += amount;\n        emit Transfer(msg.sender, to, amount);\n        return true;\n    }\n\n    function burn(uint256 amount) external {\n        balanceOf[msg.sender] -= amount;  // reverts on underflow\n        totalSupply -= amount;\n        emit Burn(msg.sender, amount);\n    }\n\n    function withdrawFees(address payable to) external {\n        require(msg.sender == owner, \"owner\");\n        (bool ok, ) = to.call{value: address(this).balance}(\"\");\n        require(ok, \"withdraw failed\");\n    }\n}\n```\n\n## 需要注意\n\n- 状态为 **Final**。\n- 任何人都可以调用 `transfer`，与自己的余额无关。按规范的写法，向他人铸造代币并不要求持有代币；费用和上限是仅有的限制。\n- DEX、借贷协议和钱包都假定 ERC-20 转账会保持供应量守恒。把 DIFF 代币与它们集成可能产生错误的价格、记账或余额，而且 `payable` 的转账在不发送 value 的调用方中会失败。\n- 所有者可以随时更改费用并提高上限，这对持有者来说是一个重大的信任假设。\n- 规范中的参考合约若照搬会有 bug（例如它读取了从未声明的 `balances` 和 `allowances` 映射）；使用任何实现之前都要审查并测试。\n"}}}
