Introduction

Hi, I'm cardene, a software engineer and technical writer focused on blockchain and AI.

I've also authored Japanese technical books on specification-driven development with LLMs and decentralized application (DApp) development.

I also build and publish a variety of tools, libraries, and open-source projects.

This article examines ERC-2019, which proposes a mechanism that enables token holders to request token issuance through smart contracts.

This article translates, summarizes, and expands on the specification linked below.

I also cover a variety of other EIPs.

Overview

ERC-2019 extends ERC20 tokens with fund requests, allowing token wallet owners to request token issuance through a smart contract. A fund request starts when the wallet owner or an authorized representative calls the orderFund or orderFundFrom function to request funding.

The request must include funding instructions for the issuer. Using these instructions, the token issuer or its representative checks the request against funding information verified off-chain and transfers tokens to the requested wallet, typically by minting them.

Importantly, the specification recommends handling these funding instructions through confidential off-chain mechanisms, such as private channels or encrypted storage, rather than recording them in plaintext on-chain. If the instructions must be recorded on-chain, the recommendation is to encrypt the instructions field first.

Motivation

When issuing fiat-backed tokens today, the issuance process usually begins with a centralized procedure, such as a bank transfer, before the tokens are issued. This conflicts with the decentralized and open nature of blockchains and raises concerns about the consistency and transparency of the overall process.

ERC-2019 seeks to bring more of the token lifecycle on-chain, particularly the issuance request phase. The expected benefits include the following.

  • Recording funding requests on-chain improves transparency and traceability.
  • Users can request issuance directly from their wallets, improving the consistency of the overall process.
  • Although some off-chain interactions, such as payment verification, remain necessary, on-chain records can complement them and contribute to a more decentralized operational model.

Reducing reliance on centralized issuance procedures in this way makes it possible to establish a more transparent and consistent operational model suitable for areas such as decentralized finance (DeFi) and decentralized securities (security tokens).

Specification

js
interface IFundable /* is ERC-20 */ {
    enum FundStatusCode {
        Nonexistent,
        Ordered,
        InProcess,
        Executed,
        Rejected,
        Cancelled
    }
    function authorizeFundOperator(address orderer) external returns (bool);
    function revokeFundOperator(address orderer) external returns (bool) ;
    function orderFund(string calldata operationId, uint256 value, string calldata instructions) external returns (bool);
    function orderFundFrom(string calldata operationId, address walletToFund, uint256 value, string calldata instructions) external returns (bool);
    function cancelFund(string calldata operationId) external returns (bool);
    function processFund(string calldata operationId) external returns (bool);
    function executeFund(string calldata operationId) external returns (bool);
    function rejectFund(string calldata operationId, string calldata reason) external returns (bool);

    function isFundOperatorFor(address walletToFund, address orderer) external view returns (bool);
    function retrieveFundData(address orderer, string calldata operationId) external view returns (address walletToFund,       uint256 value, string memory instructions, FundStatusCode status);

    event FundOrdered(address indexed orderer, string indexed operationId, address indexed , uint256 value,         string instructions);
    event FundInProcess(address indexed orderer, string indexed operationId);
    event FundExecuted(address indexed orderer, string indexed operationId);
    event FundRejected(address indexed orderer, string indexed operationId, string reason);
    event FundCancelled(address indexed orderer, string indexed operationId);
    event FundOperatorAuthorized(address indexed walletToFund, address indexed orderer);
    event FundOperatorRevoked(address indexed walletToFund, address indexed orderer);
}

Enumeration

FundStatusCode

javascript
enum FundStatusCode {
    Nonexistent,
    Ordered,
    InProcess,
    Executed,
    Rejected,
    Cancelled
}

An enumeration representing the current status of a fund request. Each status corresponds to a stage in the fund request lifecycle. It manages six states: nonexistent, ordered, in process, executed, rejected, and cancelled.

Parameters

  • Nonexistent
    • The request does not exist.
  • Ordered
    • The request has just been created.
  • InProcess
    • The request is being processed.
  • Executed
    • The request has been processed successfully and the tokens issued.
  • Rejected
    • The request has been rejected.
  • Cancelled
    • The request has been cancelled.

Functions

authorizeFundOperator

javascript
function authorizeFundOperator(address orderer) external returns (bool);

Allows a wallet owner to authorize an orderer to submit fund requests on their behalf. It grants the specified address permission to create requests as a fund operator.

Parameters

  • orderer
    • The address authorized to submit fund requests on the wallet owner's behalf.

Return value

  • bool
    • Indicates whether the authorization succeeded.

revokeFundOperator

javascript
function revokeFundOperator(address orderer) external returns (bool);

Allows a wallet owner to revoke a fund operator's authorization. It removes a previously authorized operator's permission to submit fund requests.

Parameters

  • orderer
    • The address whose authorization is to be revoked.

Return value

  • bool
    • Indicates whether the revocation succeeded.

orderFund

javascript
function orderFund(string calldata operationId, uint256 value, string calldata instructions) external returns (bool);

Creates a fund request. The caller submits a request to issue tokens to their own wallet. A previously used operationId cannot be reused.

Parameters

  • operationId
    • An ID that uniquely identifies the request.
  • value
    • The amount of tokens requested for issuance.
  • instructions
    • Funding instructions for off-chain processing, such as bank details.

Return value

  • bool
    • Indicates whether the request was created successfully.

orderFundFrom

javascript
function orderFundFrom(string calldata operationId, address walletToFund, uint256 value, string calldata instructions) external returns (bool);

Creates a fund request for another wallet. An authorized operator can request token issuance on behalf of another wallet.

Parameters

  • operationId
    • An ID that uniquely identifies the request.
  • walletToFund
    • The wallet that will receive the tokens.
  • value
    • The amount of tokens requested for issuance.
  • instructions
    • Funding instructions.

Return value

  • bool
    • Indicates whether the request was created successfully.

cancelFund

javascript
function cancelFund(string calldata operationId) external returns (bool);

Cancels an existing fund request. The orderer or wallet owner can cancel the request before it enters the in-process state.

Parameters

  • operationId
    • The identifier of the request to cancel.

Return value

  • bool
    • Indicates whether cancellation succeeded.

processFund

javascript
function processFund(string calldata operationId) external returns (bool);

Updates the request to the in-process state. The token operator calls this function when processing begins after the instructions have been checked.

Parameters

  • operationId
    • The ID of the request to process.

Return value

  • bool
    • Indicates whether the status update succeeded.

executeFund

javascript
function executeFund(string calldata operationId) external returns (bool);

Issues tokens and marks the request as completed. After verifying the request, the token operator mints tokens to the specified wallet and completes the request.

Parameters

  • operationId
    • The ID of the request to complete.

Return value

  • bool
    • Indicates whether execution succeeded.

rejectFund

javascript
function rejectFund(string calldata operationId, string calldata reason) external returns (bool);

Rejects a request. If the instructions are inaccurate or inappropriate, for example, the request can be rejected with an explanation. The specification recommends using standardized reason codes, such as ERC-1066 codes, for reason.

For more information about ERC-1066, see the following article.

[ERC1066] Retrieving Detailed Smart Contract Execution Results

Parameters

  • operationId
    • The ID of the request to reject.
  • reason
    • The reason for rejection.

Return value

  • bool
    • Indicates whether rejection succeeded.

isFundOperatorFor

javascript
function isFundOperatorFor(address walletToFund, address orderer) external view returns (bool);

Checks whether a specified orderer can submit requests for the target wallet. It determines whether the orderer has been granted fund operator authorization.

Parameters

  • walletToFund
    • The target wallet.
  • orderer
    • The operator to check.

Return value

  • bool
    • Indicates whether the operator is authorized.

retrieveFundData

javascript
function retrieveFundData(address orderer, string calldata operationId) external view returns (
  address walletToFund,
  uint256 value,
  string memory instructions,
  FundStatusCode status
);

Retrieves detailed information about a specified request. Only the orderer, the target wallet owner, or the operator can call this function.

Parameters

  • orderer
    • The address that submitted the request.
  • operationId
    • The ID of the request to retrieve.

Return values

  • walletToFund
    • The target wallet.
  • value
    • The amount of tokens to be issued.
  • instructions
    • The funding instructions.
  • status
    • The current status of the request.

Events

FundOrdered

javascript
event FundOrdered(
    address indexed orderer,
    string indexed operationId,
    address indexed walletToFund,
    uint256 value,
    string instructions
);

Emitted when a fund request is created. The event is emitted when the orderer creates the request and records its identifying information and funding instructions.

Parameters

  • orderer
    • The address that created the fund request.
  • operationId
    • The unique identifier of the request.
  • walletToFund
    • The wallet that will receive the tokens.
  • value
    • The amount of tokens requested for issuance.
  • instructions
    • Funding instructions.

FundInProcess

javascript
event FundInProcess(
    address indexed orderer,
    string indexed operationId
);

Emitted when a fund request enters the in-process state. The event indicates that the token operator has started processing the request and that cancellation is no longer possible.

Parameters

  • orderer
    • The address of the orderer that submitted the request.
  • operationId
    • The identifier of the fund request.

FundExecuted

javascript
event FundExecuted(
    address indexed orderer,
    string indexed operationId
);

Emitted when the fund request has been completed and tokens have been issued. It indicates that the operator processed the request and minted the tokens.

Parameters

  • orderer
    • The orderer that submitted the request.
  • operationId
    • The identifier of the executed request.

FundRejected

javascript
event FundRejected(
    address indexed orderer,
    string indexed operationId,
    string reason
);

Emitted when a fund request is rejected. When the operator rejects the request, the event records the rejection and its reason. The reason may use a code compliant with ERC-1066.

Parameters

  • orderer
    • The orderer of the rejected request.
  • operationId
    • The identifier of the request.
  • reason
    • The reason for rejection.

FundCancelled

javascript
event FundCancelled(
    address indexed orderer,
    string indexed operationId
);

Emitted when a fund request is cancelled. It records a cancellation by the orderer or wallet owner before the request enters the in-process state.

Parameters

  • orderer
    • The orderer that performed the cancellation.
  • operationId
    • The identifier of the request.

FundOperatorAuthorized

javascript
event FundOperatorAuthorized(
    address indexed walletToFund,
    address indexed orderer
);

Emitted when an orderer is authorized to submit fund requests.

Details

It indicates that a specified address has been authorized as a fund operator for a particular wallet.

Parameters

  • walletToFund
    • The wallet for which authorization was granted.
  • orderer
    • The address authorized as a fund operator.

FundOperatorRevoked

javascript
event FundOperatorRevoked(
    address indexed walletToFund,
    address indexed orderer
);

Emitted when an orderer's fund operator authorization is revoked. It records the wallet owner's revocation of a previously authorized orderer's permissions.

Parameters

  • walletToFund
    • The relevant wallet.
  • orderer
    • The address of the orderer whose authorization was revoked.

Additional details

The purpose of enabling decentralized funding requests

ERC-2019 aims to let users holding ERC20 tokens initiate token issuance requests, or fund requests, on the blockchain without relying on a centralized administrator to initiate them. Traditional token issuance requires an off-chain payment, such as a bank transfer, which an administrator verifies before issuing tokens. ERC-2019 makes the intention to request funding explicit on-chain, providing transparency and traceability.

Operator responsibilities and status management

Fund requests are not completed automatically. The token operator must verify off-chain that payment has actually been completed and then update the request status. These updates enable state transitions from Ordered to InProcess, followed by Executed or Rejected, for example.

Flexible instruction formats and possible standardization

The specification does not strictly define the format of the instructions supplied with a fund request. The format is flexible, but for future interoperability, it is preferable to use a format based on an international payment messaging standard such as ISO 20022. This facilitates integration with external systems.

Designing and handling operationId

The operationId that uniquely identifies a fund request is designed as a string. A string is used rather than the more gas-efficient bytes32 type so that people can read the identifier and easily trace it in logs. An implementation can store the string itself on-chain or store only its hash if the hash is sufficient for identification.

Recommendations for avoiding operationId collisions

The operationId must be globally unique, but the specification does not provide a mandatory mechanism to prevent collisions. Each request issuer is therefore encouraged to use a unique prefix, such as KYC123_ or CLIENT01_, so that its identifiers do not overlap with those of other issuers. This makes it easier to avoid identifier collisions even when multiple organizations use the same smart contract.

Compatibility

The IFundable interface is designed as an extension of the existing ERC20 standard and maintains full compatibility with it.

Citation

Fernando Paris fer@io.builders, Julio Faura julio@adhara.io, Daniel Lehrner daniel@io.builders, "ERC-2019: Fundable Token [DRAFT]," Ethereum Improvement Proposals, no. 2019, May 2019. [Online serial]. Available: https://eips.ethereum.org/EIPS/eip-2019.

Conclusion

This article covered ERC-2019, which proposes a mechanism that enables token holders to request token issuance through smart contracts. I hope this explanation was helpful.

If you have questions, feel free to reach out via direct message on Twitter.

Twitter @cardene777

I also publish content on other platforms, which you can find below.

https://chaldene.net/