ERC-2019 Token funding request standard (Fundable Token)

Stagnant · Vaults & DeFi · created 2019-05-10

This standard adds to ERC-20 a procedure by which a token wallet owner can directly request funding on the blockchain, and the issuer approves or rejects the request and issues the tokens.

Why it is needed

Issuing tokens based on fiat-currency payment usually requires a centralized step first, such as a bank transfer, and it is difficult to track how that payment connects to the on-chain issuance. Without this standard, the wallet owner has to notify the issuer of the payment through a separate channel, and the issuer manually verifies it before minting the tokens. Because the records of this process are scattered off-chain, it is hard to track or audit state changes such as requested, processing, and rejected, and there is a risk that the same request gets processed twice or lost. There is also no standardized way to manage who has permission to request funding on someone's behalf.

What to implement

In depth

Three roles

This standard distinguishes three roles: the token wallet owner, the token contract operator (the issuer or its delegate), and the orderer. The wallet owner is the party requesting funding for their own wallet, the operator reads all funding requests and decides to approve or reject them by comparing against actual payment records, and the orderer is a third party who can request funding on behalf of the wallet owner with delegated authority.

Managing delegated authority

authorizeFundOperator is the function by which a wallet owner designates a specific address as their proxy orderer, and revokeFundOperator withdraws that authorization. isFundOperatorFor lets you query whether a specific address has authorization for a specific wallet. The FundOperatorAuthorized and FundOperatorRevoked events fire whenever authorization is granted or revoked, respectively.

Creating a funding request and operationId

orderFund is used for one's own wallet, while orderFundFrom is used when an authorized orderer requests funding on behalf of another wallet owner. Both functions take an operationId, a value, and an instructions string. If a request is made again with an operationId that has already been used, the function must revert.

State transitions

FundStatusCode defines six states: Nonexistent, Ordered, InProcess, Executed, Rejected, and Cancelled. A request begins with orderFund (Ordered), moves through processFund (InProcess), and ends with executeFund (Executed) or is turned down with rejectFund (Rejected). cancelFund (Cancelled) can only be used by the token holder or orderer before the operator moves the request into the in-process state.

Restricting access to data retrieval

retrieveFundData returns the wallet, amount, instructions, and status of a funding request given its operationId, but it can only be called by the operator, the token holder, or the corresponding orderer. This design restricts read access so that sensitive payment-related information is not exposed to just anyone.

Why operationId is a string

operationId is defined as a string rather than a more gas-efficient format. This choice favors a human-readable identifier for better traceability, and implementers can choose whether to store the full string on-chain or just its hash. Since operationId is a contested resource, requesters are recommended to use a unique prefix to avoid collisions.

How payment instructions are handled

The format of the instructions field is not fixed, and formats such as ISO payment standards can be referenced. However, writing concrete routing information that specifies where funds should actually be withdrawn directly on-chain in plaintext is not recommended; instead, off-chain means such as private channels or encrypted storage are recommended, or if it must be written on-chain, it should be entered in encrypted form.

Proposal status

This ERC is in Stagnant status, meaning it is a proposal that is no longer actively discussed and has stalled. Its content may change or may never be adopted.

Original ERC · ← ERCs