EIPs Explained

ERC-2019 · Stagnant · ERC · 2019-05-10

ERC-2019: Fundable Token

An ERC-20 extension that lets a wallet owner request new tokens on-chain (for example in exchange for a fiat payment), with an operator who processes, executes or rejects each funding order.

What problem does it solve?

For a regulated, fiat-backed token (bank money, e-money), getting tokens into your wallet usually starts off-chain: you send a bank transfer, then the issuer mints. The request itself is invisible on the chain.

ERC-2019 moves the request on-chain. A wallet owner submits a funding order with payment instructions; the token operator works through it and records each status change. This gives a traceable, auditable lifecycle for funding, while the actual payment details stay in private channels.

It is part of a family of proposals by the same authors for e-money tokens, alongside Holdable, Clearable and the umbrella E-Money token.

How it works

Three actors: the wallet owner, an optional orderer authorised to act for them, and the token operator who mints.

Status flow for each order, identified by a string operationId:

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

Main functions:

Function Who Purpose
authorizeFundOperator(orderer) / revokeFundOperator owner Allow or stop another address ordering for you
orderFund(id, value, instructions) owner Request funding of your own wallet
orderFundFrom(id, wallet, value, instructions) orderer Request on behalf of an owner
cancelFund(id) owner/orderer Cancel before processing starts
processFund(id) / executeFund(id) / rejectFund(id, reason) operator Move the order forward; execute mints the tokens
retrieveFundData(orderer, id) view Wallet, value, instructions, status

Each step emits an event (FundOrdered, FundInProcess, FundExecuted, FundRejected, FundCancelled, ...). Rejection reasons may use ERC-1066 status codes. An operationId must not be reused.

Sample code

Ordering and watching a funding request with ethers v6:

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);
});

Things to know

  • Status is Stagnant. The interface was not finalised.
  • The spec warns against putting bank or routing details on-chain in plain text. Use an off-chain channel, or at least encrypt the instructions string.
  • operationId is a shared namespace, so use a unique prefix. Because the event indexes it as a string, logs contain only its hash.
  • The operator is fully trusted to honour or reject requests; the standard records the process, it does not enforce payment.

#token #erc20 #e-money #minting #payments

Details

Authors
Fernando Paris <[email protected]>, Julio Faura <[email protected]>, Daniel Lehrner <[email protected]>
Status
Stagnant
Type
Standards Track / ERC
Created
2019-05-10
Requires
Required by

Machine-readable: Markdown · JSON