---
eip: 2019
label: ERC-2019
title: Fundable Token
status: Stagnant
type: Standards Track
category: ERC
created: 2019-05-10
requires: 20
official: https://eips.ethereum.org/EIPS/eip-2019
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-2019.md
canonical: https://eips.huatuo.xyz/ja/eip-2019/
lang: ja
tldr: ウォレット所有者がオンチェーンで新規トークンを要求（たとえば法定通貨の支払いと引き換えに）できる ERC-20 拡張。オペレーターが各入金注文を処理・実行・拒否する。
tags: [token, erc20, e-money, minting, payments]
---

# ERC-2019: Fundable Token

> An extension to the [ERC-20] standard token that allows Token wallet owners to request a wallet to be funded, by calling the smart contract and attaching a fund instruction string.

**TL;DR:** ウォレット所有者がオンチェーンで新規トークンを要求（たとえば法定通貨の支払いと引き換えに）できる ERC-20 拡張。オペレーターが各入金注文を処理・実行・拒否する。

## 何を解決するのか

規制対象の法定通貨裏付けトークン（銀行マネー、電子マネー）では、ウォレットにトークンを入れる手続きは通常オフチェーンで始まります。銀行振込を送り、その後に発行者がミントします。要求そのものはチェーン上から見えません。

ERC-2019 は*要求*をオンチェーンに移します。ウォレット所有者が支払い指示を添えて入金注文を提出し、トークンのオペレーターが処理を進めて各ステータスの変化を記録します。これにより入金のライフサイクルを追跡・監査でき、実際の支払い詳細は非公開のチャネルに残ります。

これは同じ著者による電子マネートークン向け提案群の一部で、[Holdable](/eip-1996/)、[Clearable](/eip-2018/)、そして包括的な [E-Money](/eip-2020/) トークンと並びます。

## 仕組み

関係者は 3 者です。**ウォレット所有者**、所有者に代わって動く権限を与えられた任意の **orderer**、そしてミントを行うトークンの**オペレーター**です。

各注文は文字列の `operationId` で識別され、ステータスは次のように遷移します。

```
Ordered ──processFund──▶ InProcess ──executeFund──▶ Executed (tokens minted)
   │                         └──────rejectFund────▶ Rejected
   └──cancelFund──▶ Cancelled   (only before InProcess)
```

主な関数:

| 関数 | 実行者 | 役割 |
| --- | --- | --- |
| `authorizeFundOperator(orderer)` / `revokeFundOperator` | 所有者 | 別のアドレスに自分の代わりの注文を許可、または停止する |
| `orderFund(id, value, instructions)` | 所有者 | 自分のウォレットへの入金を要求する |
| `orderFundFrom(id, wallet, value, instructions)` | orderer | 所有者に代わって要求する |
| `cancelFund(id)` | 所有者/orderer | 処理開始前にキャンセルする |
| `processFund(id)` / `executeFund(id)` / `rejectFund(id, reason)` | オペレーター | 注文を前に進める。execute でトークンがミントされる |
| `retrieveFundData(orderer, id)` | view | ウォレット、金額、指示、ステータス |

各ステップでイベント（`FundOrdered`、`FundInProcess`、`FundExecuted`、`FundRejected`、`FundCancelled` など）が発行されます。拒否理由には [ERC-1066](/eip-1066/) のステータスコードを使えます。`operationId` は再利用できません。

## サンプルコード

ethers v6 で入金要求を注文して監視する例:

```ts
import { Contract, parseUnits } from "ethers";

const abi = [
  "function orderFund(string operationId, uint256 value, string instructions) returns (bool)",
  "event FundExecuted(address indexed orderer, string indexed operationId)",
];
const token = new Contract(tokenAddress, abi, signer);

const opId = `acme-${crypto.randomUUID()}`;          // prefix to avoid collisions
await token.orderFund(opId, parseUnits("250", decimals), "ref:INV-2041"); // keep sensitive data off-chain

token.on("FundExecuted", (orderer, _opIdHash, ev) => {
  if (orderer === signer.address) console.log("funded in", ev.log.transactionHash);
});
```

## 知っておくべきこと

- ステータスは **Stagnant** です。インターフェースは確定しませんでした。
- 仕様は、銀行情報やルーティング情報を平文でオンチェーンに載せないよう警告しています。オフチェーンのチャネルを使うか、少なくとも `instructions` 文字列を暗号化してください。
- `operationId` は共有の名前空間なので、一意なプレフィックスを使ってください。イベントでは `string` としてインデックスされるため、ログにはそのハッシュしか含まれません。
- オペレーターは要求を受け入れるか拒否するかについて完全に信頼されます。この標準はプロセスを記録するだけで、支払いを強制するものではありません。


---

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