---
eip: 2018
label: ERC-2018
title: Clearable Token
status: Stagnant
type: Standards Track
category: ERC
created: 2019-04-30
requires: 1996
official: https://eips.ethereum.org/EIPS/eip-2018
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-2018.md
canonical: https://eips.huatuo.xyz/eip-2018/
lang: en
tldr: A token extension for regulated assets where transfers are first ordered and held, then executed or rejected by a clearing agent after checks such as KYC/AML that may happen off-chain.
tags: [token, regulated, compliance, clearing, hold]
---

# ERC-2018: Clearable Token

> > "In banking and finance, clearing denotes all activities from the time a commitment is made for a transaction until it is settled." [[1]][Clearing-Wikipedia]

**TL;DR:** A token extension for regulated assets where transfers are first ordered and held, then executed or rejected by a clearing agent after checks such as KYC/AML that may happen off-chain.

## What problem does it solve?

A regulated token (for example tokenised money or securities) must often check every transfer against rules such as KYC or anti-money-laundering requirements. Some of those checks cannot be done on-chain, so a transfer cannot simply succeed or fail in one call.

ERC-2018 borrows the banking idea of **clearing**: the time between committing to a payment and actually settling it. A user *orders* a transfer, the funds are reserved, and a **clearing agent** reviews it and then executes or rejects it. Because the amount is held, the payer cannot spend it elsewhere in the meantime, so an approved transfer is guaranteed to go through.

## How it works

It builds on the hold mechanism of [ERC-1996](/eip-1996/). Roles:

- **Orderer**: the account owner, or an approved **operator**, who orders the transfer.
- **Clearing agent**: the account that processes, executes or rejects it.

Each transfer is identified by a string `operationId` (unique; ordering with a reused id must revert) and moves through these statuses:

`Ordered` → (optional) `InProcess` → `Executed` or `Rejected`, or `Cancelled` by the orderer.

| Function | Who | Effect |
| --- | --- | --- |
| `orderTransfer` / `orderTransferFrom` | orderer | Creates the order and holds the amount |
| `cancelTransfer` | orderer | Cancels, but not once `InProcess` |
| `processClearableTransfer` | clearing agent | Marks `InProcess`, locking out cancellation |
| `executeClearableTransfer` | clearing agent | Moves the held tokens to the payee |
| `rejectClearableTransfer` | clearing agent | Releases the hold, with a `reason` |
| `retrieveClearableTransferData` | anyone | Returns from, to, value and status |

Operators are managed with `authorizeClearableTransferOperator`, `revokeClearableTransferOperator` and `isClearableTransferOperatorFor`, named after [ERC-777](/eip-777/)'s operator functions. Every step emits an event. Whether plain ERC-20 `transfer`/`transferFrom` still work is left to the implementer.

## Sample code

Ordering a transfer and following it with ethers v6:

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

const abi = [
  "function orderTransfer(string operationId, address to, uint256 value) returns (bool)",
  "function retrieveClearableTransferData(string operationId) view returns (address from, address to, uint256 value, uint8 status)",
  "event ClearableTransferExecuted(address indexed orderer, string operationId)",
  "event ClearableTransferRejected(address indexed orderer, string operationId, string reason)",
];
const provider = new JsonRpcProvider(process.env.RPC_URL);
const user = new Wallet(process.env.PRIVATE_KEY!, provider);
const token = new Contract(process.env.TOKEN!, abi, user);

const opId = `acme-${Date.now()}`; // a unique prefix avoids collisions
await (await token.orderTransfer(opId, payee, parseUnits("100", 18))).wait();

const STATUS = ["Nonexistent", "Ordered", "InProcess", "Executed", "Rejected", "Cancelled"];
const [, , , status] = await token.retrieveClearableTransferData(opId);
console.log(STATUS[Number(status)]); // "Ordered" until the clearing agent acts
```

## Things to know

- Status: **Stagnant**, as is the [ERC-1996](/eip-1996/) hold standard it depends on.
- How the clearing agent is chosen and what it checks are outside the standard.
- `operationId` is a shared namespace; the spec recommends a unique prefix per issuer.
- Without the optional `InProcess` step, the orderer can cancel at any time, even while the agent is reviewing.


---

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