{"eip":7720,"title":"Deferred Token Transfer","description":"Allows users to schedule ERC-20 token transfers for withdrawal at a specified future time, enabling deferred payments.","authors":["Chen Liaoyuan (@chenly) \u003ccly@kip.pro\u003e"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2024-06-09","requires":[20],"discussionsTo":"https://ethereum-magicians.org/t/erc-7720-deferred-token-transfer/20245","repo":"ERCs","label":"ERC-7720","officialUrl":"https://eips.ethereum.org/EIPS/eip-7720","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7720.md","url":"https://eips.huatuo.xyz/eip-7720/","tldr":{"en":"A standard escrow interface for time-locked ERC-20 payments: deposit tokens for a recipient now, and they can be withdrawn only after a chosen unlock time.","ja":"時間ロック付き ERC-20 支払いのための標準エスクローインターフェース。受取人のために今トークンを預け入れ、選んだアンロック時刻以降にのみ引き出せる。","ko":"시간 잠금이 걸린 ERC-20 결제를 위한 표준 에스크로 인터페이스. 수령인을 위해 지금 토큰을 예치하면, 정해 둔 잠금 해제 시각 이후에만 인출할 수 있다.","zh":"面向带时间锁的 ERC-20 支付的标准托管接口：现在为收款方存入代币，只有到了选定的解锁时间之后才能提取。"},"tags":["token","erc20","escrow","vesting","timelock"],"explainers":{"en":{"lang":"en","tldr":"A standard escrow interface for time-locked ERC-20 payments: deposit tokens for a recipient now, and they can be withdrawn only after a chosen unlock time.","tags":["token","erc20","escrow","vesting","timelock"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7720/","markdown":"## What problem does it solve?\n\nVesting schedules, escrow, delayed payroll and timed rewards all need the same thing: lock tokens for someone now, release them later. Today each project writes its own time-lock contract with its own function names and events, which makes them hard for wallets, explorers and accounting tools to understand.\n\nERC-7720 proposes one small interface for \"deferred transfers\". It works as a separate contract that sits beside any existing [ERC-20](/eip-20/) token, so tokens do not need to change.\n\n## How it works\n\nThe deferred-transfer contract exposes three functions:\n\n| Function | Purpose |\n| --- | --- |\n| `transferFrom(token, from, to, amount, unlockTime, reference)` | Pull `amount` of `token` from `from` into the contract, record it for `to`, and return a new `txnId` |\n| `withdraw(txnId)` | After `unlockTime`, send the tokens to the recorded `to` |\n| `getTransaction(txnId)` | Read the stored details: token, from, to, amount, unlock time, reference, withdrawn flag |\n\nFlow:\n\n1. The payer `approve`s the deferred-transfer contract on the token.\n2. Someone calls `transferFrom(...)` with a `uint40` unlock timestamp and an arbitrary `bytes32` reference (an invoice number, for example). Tokens move into the contract and a `Transfer` event (with the `txnId`) is emitted.\n3. Once `block.timestamp \u003e= unlockTime`, `withdraw(txnId)` pays out to the recorded recipient and emits `Withdraw`. Each `txnId` can be withdrawn only once.\n\nThe reference implementation lets anyone call `withdraw`, but tokens always go to the recipient fixed at deposit time. The security section asks that the contract have no owner, so nobody can redirect locked funds.\n\n## Sample code\n\nLocking 1,000 tokens for 30 days with ethers v6:\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, parseUnits, encodeBytes32String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst payer = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst token = new Contract(TOKEN, [\"function approve(address,uint256) returns (bool)\"], payer);\nconst deferred = new Contract(DEFERRED, [\n  \"function transferFrom(address,address,address,uint256,uint40,bytes32) returns (uint256)\",\n  \"function withdraw(uint256)\",\n  \"function getTransaction(uint256) view returns (address,address,address,uint256,uint40,bytes32,bool)\",\n  \"event Transfer(uint256 txnId, address indexed token, address indexed from, address indexed to, uint256 amount, uint40 unlockTime, bytes32 referenceNo)\",\n], payer);\n\nconst amount = parseUnits(\"1000\", 18);\nconst unlock = Math.floor(Date.now() / 1000) + 30 * 24 * 3600;\n\nawait (await token.approve(DEFERRED, amount)).wait();\nconst tx = await deferred.transferFrom(TOKEN, payer.address, recipient, amount, unlock, encodeBytes32String(\"INV-0042\"));\nconst receipt = await tx.wait();\nconst txnId = deferred.interface.parseLog(receipt!.logs.find((l) =\u003e l.address === DEFERRED)!)!.args.txnId;\n\n// 30 days later, anyone can trigger the payout to `recipient`\nawait deferred.withdraw(txnId);\n```\n\n## Things to know\n\n- Status is **Draft**; function names and events may still change.\n- The interface's `transferFrom` takes an explicit `from`. In the reference implementation, anyone can call it for any `from` that has approved the contract, so an approval to a shared deferred-transfer contract can be used by third parties to lock your tokens for someone else. Implementations should restrict `from` (for example to `msg.sender`) or users should approve only exact amounts right before use.\n- The event is also named `Transfer`, but its signature differs from ERC-20's `Transfer`, so indexers will not confuse them by topic, but humans reading logs might.\n- There is no cancel or clawback: once deposited, funds go only to the recipient after the unlock time.\n- Fee-on-transfer or rebasing tokens can make the recorded `amount` differ from what the contract actually holds.\n"},"ja":{"lang":"ja","tldr":"時間ロック付き ERC-20 支払いのための標準エスクローインターフェース。受取人のために今トークンを預け入れ、選んだアンロック時刻以降にのみ引き出せる。","tags":["token","erc20","escrow","vesting","timelock"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7720/","markdown":"## 何を解決するのか\n\nベスティングスケジュール、エスクロー、遅延給与支払い、時限報酬はいずれも同じことを必要とします。今、誰かのためにトークンをロックし、後で解放することです。現状では、プロジェクトごとに独自の関数名とイベントを持つ独自のタイムロックコントラクトを書いているため、ウォレット、エクスプローラー、会計ツールが理解しにくくなっています。\n\nERC-7720 は「繰延送金」のための小さなインターフェースを 1 つ提案します。既存の [ERC-20](/eip-20/) トークンの隣に置く別のコントラクトとして機能するため、トークン側を変更する必要はありません。\n\n## 仕組み\n\n繰延送金コントラクトは 3 つの関数を公開します。\n\n| 関数 | 役割 |\n| --- | --- |\n| `transferFrom(token, from, to, amount, unlockTime, reference)` | `from` から `token` を `amount` 分コントラクトに引き込み、`to` 向けに記録して、新しい `txnId` を返す |\n| `withdraw(txnId)` | `unlockTime` 以降に、記録された `to` へトークンを送る |\n| `getTransaction(txnId)` | 保存された詳細（token、from、to、amount、unlock time、reference、引き出し済みフラグ）を読む |\n\nフロー:\n\n1. 支払者がトークン上で繰延送金コントラクトを `approve` します。\n2. 誰かが、`uint40` のアンロックタイムスタンプと任意の `bytes32` の reference（たとえば請求書番号）を指定して `transferFrom(...)` を呼びます。トークンがコントラクトに移動し、（`txnId` を含む）`Transfer` イベントが発行されます。\n3. `block.timestamp \u003e= unlockTime` になったら、`withdraw(txnId)` が記録された受取人に支払い、`Withdraw` を発行します。各 `txnId` は 1 回しか引き出せません。\n\nリファレンス実装では誰でも `withdraw` を呼べますが、トークンは常に預け入れ時に確定した受取人へ送られます。セキュリティの節では、ロックされた資金を誰も別の宛先へ変更できないよう、コントラクトに owner を持たせないことを求めています。\n\n## サンプルコード\n\nethers v6 で 1,000 トークンを 30 日間ロックする例:\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, parseUnits, encodeBytes32String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst payer = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst token = new Contract(TOKEN, [\"function approve(address,uint256) returns (bool)\"], payer);\nconst deferred = new Contract(DEFERRED, [\n  \"function transferFrom(address,address,address,uint256,uint40,bytes32) returns (uint256)\",\n  \"function withdraw(uint256)\",\n  \"function getTransaction(uint256) view returns (address,address,address,uint256,uint40,bytes32,bool)\",\n  \"event Transfer(uint256 txnId, address indexed token, address indexed from, address indexed to, uint256 amount, uint40 unlockTime, bytes32 referenceNo)\",\n], payer);\n\nconst amount = parseUnits(\"1000\", 18);\nconst unlock = Math.floor(Date.now() / 1000) + 30 * 24 * 3600;\n\nawait (await token.approve(DEFERRED, amount)).wait();\nconst tx = await deferred.transferFrom(TOKEN, payer.address, recipient, amount, unlock, encodeBytes32String(\"INV-0042\"));\nconst receipt = await tx.wait();\nconst txnId = deferred.interface.parseLog(receipt!.logs.find((l) =\u003e l.address === DEFERRED)!)!.args.txnId;\n\n// 30 days later, anyone can trigger the payout to `recipient`\nawait deferred.withdraw(txnId);\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。関数名やイベントはまだ変更される可能性があります。\n- インターフェースの `transferFrom` は明示的な `from` を取ります。リファレンス実装では、コントラクトを承認済みの任意の `from` に対して誰でも呼び出せるため、共有の繰延送金コントラクトへの承認は、第三者があなたのトークンを他人のためにロックするのに使われる可能性があります。実装は `from` を制限する（たとえば `msg.sender` に限定する）か、ユーザーが使用の直前に正確な額だけを承認するべきです。\n- イベントの名前も `Transfer` ですが、シグネチャは ERC-20 の `Transfer` と異なります。そのためインデクサーがトピックで取り違えることはありませんが、ログを読む人間は混同するかもしれません。\n- キャンセルや回収の仕組みはありません。いったん預け入れられた資金は、アンロック時刻の後に受取人にのみ渡されます。\n- 送金時手数料型やリベース型のトークンでは、記録された `amount` がコントラクトの実際の保有量と一致しなくなる可能性があります。\n"},"ko":{"lang":"ko","tldr":"시간 잠금이 걸린 ERC-20 결제를 위한 표준 에스크로 인터페이스. 수령인을 위해 지금 토큰을 예치하면, 정해 둔 잠금 해제 시각 이후에만 인출할 수 있다.","tags":["token","erc20","escrow","vesting","timelock"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7720/","markdown":"## 어떤 문제를 해결하나요?\n\n베스팅 일정, 에스크로, 지연 급여 지급, 시간 제한 보상은 모두 같은 것을 필요로 합니다. 지금 누군가를 위해 토큰을 잠가 두었다가 나중에 풀어 주는 것입니다. 지금은 프로젝트마다 자기만의 함수 이름과 이벤트를 가진 타임락 컨트랙트를 따로 작성하고 있어, 지갑, 탐색기, 회계 도구가 이를 이해하기 어렵습니다.\n\nERC-7720은 \"지연 전송\"을 위한 작은 인터페이스 하나를 제안합니다. 기존 [ERC-20](/eip-20/) 토큰 옆에 놓는 별도 컨트랙트로 동작하므로 토큰을 바꿀 필요가 없습니다.\n\n## 어떻게 동작하나요?\n\n지연 전송 컨트랙트는 세 개의 함수를 노출합니다.\n\n| 함수 | 역할 |\n| --- | --- |\n| `transferFrom(token, from, to, amount, unlockTime, reference)` | `from`에서 `token`을 `amount`만큼 컨트랙트로 가져오고, `to` 앞으로 기록한 뒤 새 `txnId`를 반환 |\n| `withdraw(txnId)` | `unlockTime` 이후에 기록된 `to`로 토큰을 전송 |\n| `getTransaction(txnId)` | 저장된 상세 정보(token, from, to, amount, 잠금 해제 시각, reference, 인출 여부 플래그)를 읽음 |\n\n흐름:\n\n1. 지급자가 토큰에서 지연 전송 컨트랙트를 `approve`합니다.\n2. 누군가 `uint40` 잠금 해제 타임스탬프와 임의의 `bytes32` reference(예: 청구서 번호)를 넣어 `transferFrom(...)`을 호출합니다. 토큰이 컨트랙트로 이동하고 (`txnId`가 담긴) `Transfer` 이벤트가 발생합니다.\n3. `block.timestamp \u003e= unlockTime`이 되면 `withdraw(txnId)`가 기록된 수령인에게 지급하고 `Withdraw`를 발생시킵니다. 각 `txnId`는 한 번만 인출할 수 있습니다.\n\n참조 구현은 누구나 `withdraw`를 호출할 수 있게 하지만, 토큰은 항상 예치 시점에 정해진 수령인에게 갑니다. 보안 절에서는 잠긴 자금의 행선지를 아무도 바꿀 수 없도록 컨트랙트에 owner가 없어야 한다고 요구합니다.\n\n## 샘플 코드\n\nethers v6로 토큰 1,000개를 30일간 잠그는 예:\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, parseUnits, encodeBytes32String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst payer = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst token = new Contract(TOKEN, [\"function approve(address,uint256) returns (bool)\"], payer);\nconst deferred = new Contract(DEFERRED, [\n  \"function transferFrom(address,address,address,uint256,uint40,bytes32) returns (uint256)\",\n  \"function withdraw(uint256)\",\n  \"function getTransaction(uint256) view returns (address,address,address,uint256,uint40,bytes32,bool)\",\n  \"event Transfer(uint256 txnId, address indexed token, address indexed from, address indexed to, uint256 amount, uint40 unlockTime, bytes32 referenceNo)\",\n], payer);\n\nconst amount = parseUnits(\"1000\", 18);\nconst unlock = Math.floor(Date.now() / 1000) + 30 * 24 * 3600;\n\nawait (await token.approve(DEFERRED, amount)).wait();\nconst tx = await deferred.transferFrom(TOKEN, payer.address, recipient, amount, unlock, encodeBytes32String(\"INV-0042\"));\nconst receipt = await tx.wait();\nconst txnId = deferred.interface.parseLog(receipt!.logs.find((l) =\u003e l.address === DEFERRED)!)!.args.txnId;\n\n// 30 days later, anyone can trigger the payout to `recipient`\nawait deferred.withdraw(txnId);\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다. 함수 이름과 이벤트는 아직 바뀔 수 있습니다.\n- 인터페이스의 `transferFrom`은 명시적인 `from`을 받습니다. 참조 구현에서는 컨트랙트를 승인한 어떤 `from`에 대해서도 누구나 호출할 수 있으므로, 공용 지연 전송 컨트랙트에 대한 승인이 제3자에게 악용되어 여러분의 토큰이 다른 사람 앞으로 잠길 수 있습니다. 구현은 `from`을 제한하거나(예: `msg.sender`로), 사용자가 사용 직전에 정확한 금액만 승인해야 합니다.\n- 이벤트 이름도 `Transfer`이지만 시그니처가 ERC-20의 `Transfer`와 달라서 인덱서가 토픽으로 혼동하지는 않습니다. 다만 로그를 읽는 사람은 헷갈릴 수 있습니다.\n- 취소나 회수 기능은 없습니다. 한 번 예치된 자금은 잠금 해제 시각 이후에 수령인에게만 갑니다.\n- 전송 수수료형 토큰이나 리베이스 토큰은 기록된 `amount`가 컨트랙트가 실제로 보유한 양과 달라질 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"面向带时间锁的 ERC-20 支付的标准托管接口：现在为收款方存入代币，只有到了选定的解锁时间之后才能提取。","tags":["token","erc20","escrow","vesting","timelock"],"related":[20],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7720/","markdown":"## 它解决什么问题？\n\n归属（vesting）计划、托管、延迟发薪和定时奖励都需要同一件事：现在为某人锁定代币，之后再释放。如今每个项目都编写自己的时间锁合约，函数名和事件各不相同，钱包、区块浏览器和记账工具很难理解它们。\n\nERC-7720 提出了一个用于\"延期转账\"的小型接口。它是放在任何现有 [ERC-20](/eip-20/) 代币旁边的一个独立合约，因此代币本身无需改动。\n\n## 它如何运作\n\n延期转账合约公开三个函数：\n\n| 函数 | 用途 |\n| --- | --- |\n| `transferFrom(token, from, to, amount, unlockTime, reference)` | 从 `from` 将 `amount` 数量的 `token` 拉入合约，为 `to` 记账，并返回新的 `txnId` |\n| `withdraw(txnId)` | 在 `unlockTime` 之后，将代币发送给记录的 `to` |\n| `getTransaction(txnId)` | 读取存储的详情：token、from、to、amount、解锁时间、reference、是否已提取 |\n\n流程：\n\n1. 付款方在代币上对延期转账合约执行 `approve`。\n2. 有人以一个 `uint40` 解锁时间戳和一个任意的 `bytes32` reference（例如发票编号）调用 `transferFrom(...)`。代币转入合约，并发出带有 `txnId` 的 `Transfer` 事件。\n3. 当 `block.timestamp \u003e= unlockTime` 后，`withdraw(txnId)` 向记录的收款方付款并发出 `Withdraw`。每个 `txnId` 只能提取一次。\n\n参考实现允许任何人调用 `withdraw`，但代币始终发送给存入时确定的收款方。安全部分要求合约没有 owner，这样没有人能改变被锁资金的去向。\n\n## 示例代码\n\n使用 ethers v6 将 1,000 个代币锁定 30 天：\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, parseUnits, encodeBytes32String } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst payer = new Wallet(process.env.PRIVATE_KEY!, provider);\n\nconst token = new Contract(TOKEN, [\"function approve(address,uint256) returns (bool)\"], payer);\nconst deferred = new Contract(DEFERRED, [\n  \"function transferFrom(address,address,address,uint256,uint40,bytes32) returns (uint256)\",\n  \"function withdraw(uint256)\",\n  \"function getTransaction(uint256) view returns (address,address,address,uint256,uint40,bytes32,bool)\",\n  \"event Transfer(uint256 txnId, address indexed token, address indexed from, address indexed to, uint256 amount, uint40 unlockTime, bytes32 referenceNo)\",\n], payer);\n\nconst amount = parseUnits(\"1000\", 18);\nconst unlock = Math.floor(Date.now() / 1000) + 30 * 24 * 3600;\n\nawait (await token.approve(DEFERRED, amount)).wait();\nconst tx = await deferred.transferFrom(TOKEN, payer.address, recipient, amount, unlock, encodeBytes32String(\"INV-0042\"));\nconst receipt = await tx.wait();\nconst txnId = deferred.interface.parseLog(receipt!.logs.find((l) =\u003e l.address === DEFERRED)!)!.args.txnId;\n\n// 30 days later, anyone can trigger the payout to `recipient`\nawait deferred.withdraw(txnId);\n```\n\n## 需要注意\n\n- 状态为 **Draft**；函数名和事件仍可能变化。\n- 接口中的 `transferFrom` 接受显式的 `from`。在参考实现中，任何人都可以针对任何已授权该合约的 `from` 调用它，因此对共享的延期转账合约的授权，可能被第三方用来把你的代币锁给别人。实现应该限制 `from`（例如限定为 `msg.sender`），或者用户应当只在使用前授权精确的数额。\n- 该事件同样叫 `Transfer`，但签名与 ERC-20 的 `Transfer` 不同，因此索引器不会按 topic 将二者混淆，但阅读日志的人可能会混淆。\n- 没有取消或追回机制：资金一旦存入，只会在解锁时间之后交给收款方。\n- 转账收费型或 rebase 型代币可能导致记录的 `amount` 与合约实际持有的数量不一致。\n"}}}
