{"eip":7410,"title":"ERC-20 Update Allowance By Spender","description":"Extension to enable revoking and decreasing allowance approval by spender for ERC-20","authors":["Mohammad Zakeri Rad (@zakrad)","Adam Boudjemaa (@aboudjem)","Mohamad Hammoud (@mohamadhammoud)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2023-07-26","requires":[20,165],"discussionsTo":"https://ethereum-magicians.org/t/eip-7410-decrease-allowance-by-spender/15222","repo":"ERCs","label":"ERC-7410","officialUrl":"https://eips.ethereum.org/EIPS/eip-7410","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7410.md","url":"https://eips.huatuo.xyz/eip-7410/","tldr":{"en":"A draft ERC-20 extension that lets the spender, not just the owner, reduce or revoke an allowance it was given, useful when the owner is a slow multisig or treasury.","ja":"所有者だけでなく spender も、付与された allowance を減らしたり取り消したりできるようにするドラフトの ERC-20 拡張。所有者が対応の遅いマルチシグやトレジャリーである場合に役立つ。","ko":"소유자뿐 아니라 spender도 자신에게 부여된 allowance를 줄이거나 취소할 수 있게 하는 초안 ERC-20 확장. 소유자가 대응이 느린 멀티시그나 트레저리일 때 유용하다.","zh":"一个草案的 ERC-20 扩展，允许被授权的 spender（而不只是所有者）减少或撤销自己获得的额度，在所有者是响应缓慢的多签或金库时很有用。"},"tags":["erc20","allowance","approval","security"],"explainers":{"en":{"lang":"en","tldr":"A draft ERC-20 extension that lets the spender, not just the owner, reduce or revoke an allowance it was given, useful when the owner is a slow multisig or treasury.","tags":["erc20","allowance","approval","security"],"related":[20,165,2612],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7410/","markdown":"## What problem does it solve?\n\nIn [ERC-20](/eip-20/), only the token owner can change an allowance. That is a problem when the owner is a treasury or multisig that granted a spender far more than needed: shrinking the approval requires collecting signatures and coordinating, which takes time. Meanwhile the spender, perhaps a protocol contract or service account, may know it no longer needs the allowance or may fear its key is at risk.\n\nERC-7410 lets the spender give the permission back on its own, adding a quick safety valve without changing anything for owners.\n\n## How it works\n\nThe token adds a single function:\n\n```solidity\nfunction decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external;\n```\n\n- The caller is the spender; it lowers `allowance(owner, msg.sender)` by `subtractedValue`.\n- If `subtractedValue` is greater than or equal to the current allowance, the allowance becomes 0.\n- If the current allowance is `type(uint256).max` (an \"infinite\" approval), any call sets it to 0. Partial decreases of infinite approvals are not possible.\n- The standard ERC-20 `Approval` event must be emitted with the new value.\n- The token must implement [ERC-165](/eip-165/) and return `true` for interface ID `0x12860fba`.\n\n## Sample code\n\nAdding the extension to an OpenZeppelin ERC-20:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\ncontract SpenderRevocableToken is ERC20, ERC165 {\n    constructor() ERC20(\"Demo\", \"DEMO\") { _mint(msg.sender, 1e24); }\n\n    function decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external {\n        uint256 current = allowance(owner, msg.sender);\n        uint256 next = (current == type(uint256).max || subtractedValue \u003e= current)\n            ? 0\n            : current - subtractedValue;\n        _approve(owner, msg.sender, next, true); // emits Approval\n    }\n\n    function supportsInterface(bytes4 id) public view override returns (bool) {\n        return id == 0x12860fba || super.supportsInterface(id);\n    }\n}\n```\n\nCalling it as the spender (ethers v6):\n\n```ts\nimport { Contract, MaxUint256, parseUnits } from \"ethers\";\n\nconst token = new Contract(tokenAddr, [\"function decreaseAllowanceBySpender(address,uint256)\"], spenderWallet);\nawait token.decreaseAllowanceBySpender(treasuryAddr, parseUnits(\"500\", 18)); // shrink by 500\nawait token.decreaseAllowanceBySpender(treasuryAddr, MaxUint256);           // revoke fully\n```\n\n## Things to know\n\n- Status is **Draft**.\n- It only works on tokens that implement it; existing ERC-20 tokens cannot be retrofitted.\n- A spender can cancel an allowance the owner wanted to keep (for example for recurring payments). The spec accepts this, since giving up a right is less harmful than using it, but integrators should not assume allowances stay stable.\n- Related approaches to safer approvals include [ERC-2612](/eip-2612/) `permit`, which avoids long-lived allowances.\n"},"ja":{"lang":"ja","tldr":"所有者だけでなく spender も、付与された allowance を減らしたり取り消したりできるようにするドラフトの ERC-20 拡張。所有者が対応の遅いマルチシグやトレジャリーである場合に役立つ。","tags":["erc20","allowance","approval","security"],"related":[20,165,2612],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7410/","markdown":"## 何を解決するのか\n\n[ERC-20](/eip-20/) では、allowance を変更できるのはトークンの所有者だけです。所有者がトレジャリーやマルチシグで、spender に必要以上の額を付与してしまった場合、これは問題になります。承認額を減らすには署名を集めて調整する必要があり、時間がかかります。その間にも、プロトコルコントラクトやサービスアカウントなどの spender は、もう allowance が不要だと分かっていたり、自分の鍵が危険にさらされているのではないかと懸念していたりするかもしれません。\n\nERC-7410 は、spender が自分で権限を返上できるようにし、所有者側には何も変更を加えずに、迅速な安全弁を追加します。\n\n## 仕組み\n\nトークンに次の関数を 1 つ追加します。\n\n```solidity\nfunction decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external;\n```\n\n- 呼び出し元は spender で、`allowance(owner, msg.sender)` を `subtractedValue` だけ減らします。\n- `subtractedValue` が現在の allowance 以上の場合、allowance は 0 になります。\n- 現在の allowance が `type(uint256).max`（「無限」承認）の場合、どの呼び出しでも 0 になります。無限承認を部分的に減らすことはできません。\n- 標準の ERC-20 `Approval` イベントを、新しい値で emit する必要があります。\n- トークンは [ERC-165](/eip-165/) を実装し、インターフェース ID `0x12860fba` に対して `true` を返す必要があります。\n\n## サンプルコード\n\nOpenZeppelin の ERC-20 に拡張を追加する:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\ncontract SpenderRevocableToken is ERC20, ERC165 {\n    constructor() ERC20(\"Demo\", \"DEMO\") { _mint(msg.sender, 1e24); }\n\n    function decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external {\n        uint256 current = allowance(owner, msg.sender);\n        uint256 next = (current == type(uint256).max || subtractedValue \u003e= current)\n            ? 0\n            : current - subtractedValue;\n        _approve(owner, msg.sender, next, true); // emits Approval\n    }\n\n    function supportsInterface(bytes4 id) public view override returns (bool) {\n        return id == 0x12860fba || super.supportsInterface(id);\n    }\n}\n```\n\nspender として呼び出す（ethers v6）:\n\n```ts\nimport { Contract, MaxUint256, parseUnits } from \"ethers\";\n\nconst token = new Contract(tokenAddr, [\"function decreaseAllowanceBySpender(address,uint256)\"], spenderWallet);\nawait token.decreaseAllowanceBySpender(treasuryAddr, parseUnits(\"500\", 18)); // shrink by 500\nawait token.decreaseAllowanceBySpender(treasuryAddr, MaxUint256);           // revoke fully\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** です。\n- これを実装したトークンでのみ動作します。既存の ERC-20 トークンに後付けすることはできません。\n- spender は、所有者が維持したかった allowance（たとえば定期支払いのためのもの）を取り消せてしまいます。権利を放棄することは行使するより害が少ないため、仕様はこれを許容していますが、連携する側は allowance が安定して残ると想定すべきではありません。\n- より安全な承認のための関連する方法には、長期間残る allowance を避ける [ERC-2612](/eip-2612/) の `permit` があります。\n"},"ko":{"lang":"ko","tldr":"소유자뿐 아니라 spender도 자신에게 부여된 allowance를 줄이거나 취소할 수 있게 하는 초안 ERC-20 확장. 소유자가 대응이 느린 멀티시그나 트레저리일 때 유용하다.","tags":["erc20","allowance","approval","security"],"related":[20,165,2612],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7410/","markdown":"## 어떤 문제를 해결하나요?\n\n[ERC-20](/eip-20/)에서는 토큰 소유자만 allowance를 바꿀 수 있습니다. 소유자가 트레저리나 멀티시그이고 spender에게 필요 이상으로 많이 부여했다면 문제가 됩니다. 승인을 줄이려면 서명을 모으고 조율해야 해서 시간이 걸립니다. 그동안 프로토콜 컨트랙트나 서비스 계정일 수 있는 spender는 더 이상 allowance가 필요 없다는 것을 알고 있거나 자신의 키가 위험할까 걱정할 수 있습니다.\n\nERC-7410은 spender가 스스로 권한을 반납할 수 있게 하여, 소유자에게는 아무것도 바꾸지 않으면서 빠른 안전 밸브를 더합니다.\n\n## 어떻게 동작하나요?\n\n토큰에 함수 하나를 추가합니다.\n\n```solidity\nfunction decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external;\n```\n\n- 호출자는 spender이며, `allowance(owner, msg.sender)`를 `subtractedValue`만큼 낮춥니다.\n- `subtractedValue`가 현재 allowance 이상이면 allowance는 0이 됩니다.\n- 현재 allowance가 `type(uint256).max`(\"무한\" 승인)이면 어떤 호출이든 0으로 설정됩니다. 무한 승인을 부분적으로 줄이는 것은 불가능합니다.\n- 표준 ERC-20 `Approval` 이벤트를 새 값으로 emit해야 합니다.\n- 토큰은 [ERC-165](/eip-165/)를 구현하고 인터페이스 ID `0x12860fba`에 대해 `true`를 반환해야 합니다.\n\n## 샘플 코드\n\nOpenZeppelin ERC-20에 확장 추가하기:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\ncontract SpenderRevocableToken is ERC20, ERC165 {\n    constructor() ERC20(\"Demo\", \"DEMO\") { _mint(msg.sender, 1e24); }\n\n    function decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external {\n        uint256 current = allowance(owner, msg.sender);\n        uint256 next = (current == type(uint256).max || subtractedValue \u003e= current)\n            ? 0\n            : current - subtractedValue;\n        _approve(owner, msg.sender, next, true); // emits Approval\n    }\n\n    function supportsInterface(bytes4 id) public view override returns (bool) {\n        return id == 0x12860fba || super.supportsInterface(id);\n    }\n}\n```\n\nspender로서 호출하기(ethers v6):\n\n```ts\nimport { Contract, MaxUint256, parseUnits } from \"ethers\";\n\nconst token = new Contract(tokenAddr, [\"function decreaseAllowanceBySpender(address,uint256)\"], spenderWallet);\nawait token.decreaseAllowanceBySpender(treasuryAddr, parseUnits(\"500\", 18)); // shrink by 500\nawait token.decreaseAllowanceBySpender(treasuryAddr, MaxUint256);           // revoke fully\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**입니다.\n- 이를 구현한 토큰에서만 동작합니다. 기존 ERC-20 토큰에 사후 적용할 수는 없습니다.\n- spender는 소유자가 유지하고 싶었던 allowance(예: 정기 결제용)를 취소할 수 있습니다. 권리를 포기하는 것이 행사하는 것보다 덜 해롭기 때문에 명세는 이를 받아들이지만, 연동하는 쪽은 allowance가 안정적으로 유지된다고 가정해서는 안 됩니다.\n- 더 안전한 승인을 위한 관련 방식으로는 오래 남는 allowance를 피하는 [ERC-2612](/eip-2612/)의 `permit`이 있습니다.\n"},"zh":{"lang":"zh","tldr":"一个草案的 ERC-20 扩展，允许被授权的 spender（而不只是所有者）减少或撤销自己获得的额度，在所有者是响应缓慢的多签或金库时很有用。","tags":["erc20","allowance","approval","security"],"related":[20,165,2612],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7410/","markdown":"## 它解决什么问题？\n\n在 [ERC-20](/eip-20/) 中，只有代币所有者可以修改授权额度。当所有者是金库或多签，并且授予了 spender 远超所需的额度时，这就成了问题：缩减授权需要收集签名并协调，耗时较长。与此同时，spender（可能是协议合约或服务账户）也许知道自己已不再需要这笔额度，或者担心自己的密钥有风险。\n\nERC-7410 让 spender 可以自行交还权限，在不改变所有者任何操作的前提下，增加了一个快速的安全阀。\n\n## 它如何运作\n\n代币增加一个函数：\n\n```solidity\nfunction decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external;\n```\n\n- 调用者是 spender；它将 `allowance(owner, msg.sender)` 减少 `subtractedValue`。\n- 如果 `subtractedValue` 大于或等于当前额度，额度变为 0。\n- 如果当前额度为 `type(uint256).max`（\"无限\"授权），任何调用都会将其设为 0。无法对无限授权进行部分减少。\n- 必须触发标准的 ERC-20 `Approval` 事件，并带上新值。\n- 代币必须实现 [ERC-165](/eip-165/)，并对接口 ID `0x12860fba` 返回 `true`。\n\n## 示例代码\n\n为 OpenZeppelin ERC-20 添加该扩展：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\nimport \"@openzeppelin/contracts/token/ERC20/ERC20.sol\";\nimport \"@openzeppelin/contracts/utils/introspection/ERC165.sol\";\n\ncontract SpenderRevocableToken is ERC20, ERC165 {\n    constructor() ERC20(\"Demo\", \"DEMO\") { _mint(msg.sender, 1e24); }\n\n    function decreaseAllowanceBySpender(address owner, uint256 subtractedValue) external {\n        uint256 current = allowance(owner, msg.sender);\n        uint256 next = (current == type(uint256).max || subtractedValue \u003e= current)\n            ? 0\n            : current - subtractedValue;\n        _approve(owner, msg.sender, next, true); // emits Approval\n    }\n\n    function supportsInterface(bytes4 id) public view override returns (bool) {\n        return id == 0x12860fba || super.supportsInterface(id);\n    }\n}\n```\n\n以 spender 身份调用（ethers v6）：\n\n```ts\nimport { Contract, MaxUint256, parseUnits } from \"ethers\";\n\nconst token = new Contract(tokenAddr, [\"function decreaseAllowanceBySpender(address,uint256)\"], spenderWallet);\nawait token.decreaseAllowanceBySpender(treasuryAddr, parseUnits(\"500\", 18)); // shrink by 500\nawait token.decreaseAllowanceBySpender(treasuryAddr, MaxUint256);           // revoke fully\n```\n\n## 需要注意\n\n- 状态为 **Draft**。\n- 它只适用于实现了它的代币；已有的 ERC-20 代币无法事后改造。\n- spender 可以取消所有者本想保留的额度（例如用于定期付款）。规范接受这一点，因为放弃权利比使用权利的危害小，但集成方不应假定额度会保持稳定。\n- 实现更安全授权的相关方法还有 [ERC-2612](/eip-2612/) 的 `permit`，它可以避免长期存在的额度。\n"}}}
