{"eip":5313,"title":"Light Contract Ownership","description":"An interface for identifying ownership of contracts","authors":["William Entriken (@fulldecent)"],"status":"Final","type":"Standards Track","category":"ERC","created":"2022-07-22","requires":[165,173],"discussionsTo":"https://ethereum-magicians.org/t/eip-5313-light-contract-ownership/10052","repo":"ERCs","label":"ERC-5313","officialUrl":"https://eips.ethereum.org/EIPS/eip-5313","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5313.md","url":"https://eips.huatuo.xyz/eip-5313/","tldr":{"en":"The smallest possible ownership interface: a contract exposes owner() so marketplaces and tools can tell who controls it.","ja":"可能な限り最小のオーナーシップ用インターフェース。コントラクトが owner() を公開し、マーケットプレイスやツールが誰がそれを管理しているかを判別できるようにする。","ko":"가능한 가장 작은 소유권 인터페이스. 컨트랙트가 owner()를 노출해 마켓플레이스와 도구가 누가 그 컨트랙트를 제어하는지 알 수 있게 한다.","zh":"最小的所有权接口：合约公开 owner()，让市场和工具能够知道谁控制着它。"},"tags":["ownership","access-control","interface","nft","marketplaces"],"explainers":{"en":{"lang":"en","tldr":"The smallest possible ownership interface: a contract exposes owner() so marketplaces and tools can tell who controls it.","tags":["ownership","access-control","interface","nft","marketplaces"],"related":[173,165,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5313/","markdown":"## What problem does it solve?\n\nThird-party sites, most notably NFT marketplaces, need to know who controls a contract: for example, to let the collection's owner edit its page, set a banner or configure royalties. The established answer was [EIP-173](/eip-173/), which also standardizes `transferOwnership` and an `OwnershipTransferred` event. Many contracts expose `owner()` but handle transfers differently (two-step transfers, multisig-controlled, immutable owners), so they cannot claim full EIP-173 compliance.\n\nERC-5313 codifies the part everybody already relies on: a single `owner()` view function.\n\n## How it works\n\nA compliant contract implements exactly one function:\n\n```solidity\ninterface EIP5313 {\n    /// @notice Get the address of the owner\n    function owner() external view returns (address);\n}\n```\n\nThat's all. There is no transfer function, no event, and deliberately no [ERC-165](/eip-165/) interface ID, so that the many existing contracts that already have `owner()` are compliant without changes. Every EIP-173 contract (including OpenZeppelin's `Ownable`) automatically satisfies ERC-5313.\n\nHow ownership is set, transferred or renounced is left entirely to the contract.\n\n## Sample code\n\nA contract with a fixed owner, which EIP-173 would not cover because it cannot be transferred:\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract FixedOwnerCollection {\n    address private immutable _owner;\n\n    constructor() { _owner = msg.sender; }\n\n    /// ERC-5313\n    function owner() external view returns (address) {\n        return _owner;\n    }\n}\n```\n\nChecking control from a script (ethers v6):\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst c = new Contract(collection, [\"function owner() view returns (address)\"], provider);\nconst owner: string = await c.owner();\nconst isOwner = owner.toLowerCase() === userAddress.toLowerCase();\n```\n\n## Things to know\n\n- Status: **Final**.\n- Without ERC-165 you cannot be certain that `owner()` means \"controller\": a contract could have an unrelated function with the same signature. That is fine for low-stakes checks like \"may this wallet edit the collection page\", but risky for decisions such as sending valuable assets to the reported owner.\n- `owner()` returning the zero address conventionally means ownership has been renounced, but the spec does not require that interpretation.\n- If you need standardized transfer semantics and events, implement [EIP-173](/eip-173/) instead; you get ERC-5313 for free.\n"},"ja":{"lang":"ja","tldr":"可能な限り最小のオーナーシップ用インターフェース。コントラクトが owner() を公開し、マーケットプレイスやツールが誰がそれを管理しているかを判別できるようにする。","tags":["ownership","access-control","interface","nft","marketplaces"],"related":[173,165,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5313/","markdown":"## 何を解決するのか\n\nサードパーティのサイト、特に NFT マーケットプレイスは、コントラクトを誰が管理しているかを知る必要があります。たとえば、コレクションのオーナーにページの編集、バナーの設定、ロイヤリティの設定を許可するためです。これまでの答えは [EIP-173](/eip-173/) で、`transferOwnership` と `OwnershipTransferred` イベントも標準化しています。多くのコントラクトは `owner()` を公開していますが、移転の扱いが異なる（2 段階の移転、マルチシグによる管理、変更不可のオーナーなど）ため、EIP-173 に完全準拠しているとは言えません。\n\nERC-5313 は、誰もがすでに頼りにしている部分、つまり `owner()` ビュー関数ただ 1 つを規格化します。\n\n## 仕組み\n\n準拠するコントラクトが実装するのは、次の関数ただ 1 つです。\n\n```solidity\ninterface EIP5313 {\n    /// @notice Get the address of the owner\n    function owner() external view returns (address);\n}\n```\n\nこれだけです。移転用の関数もイベントもなく、意図的に [ERC-165](/eip-165/) のインターフェース ID も定義していません。すでに `owner()` を持つ多くの既存コントラクトが、変更なしで準拠できるようにするためです。EIP-173 のコントラクト（OpenZeppelin の `Ownable` を含む）は、自動的に ERC-5313 を満たします。\n\nオーナーシップをどう設定し、移転し、放棄するかは、完全にコントラクトに委ねられています。\n\n## サンプルコード\n\n固定オーナーのコントラクトです。移転できないため、EIP-173 では対象外になります。\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract FixedOwnerCollection {\n    address private immutable _owner;\n\n    constructor() { _owner = msg.sender; }\n\n    /// ERC-5313\n    function owner() external view returns (address) {\n        return _owner;\n    }\n}\n```\n\nスクリプトから管理権限を確認する例（ethers v6）:\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst c = new Contract(collection, [\"function owner() view returns (address)\"], provider);\nconst owner: string = await c.owner();\nconst isOwner = owner.toLowerCase() === userAddress.toLowerCase();\n```\n\n## 知っておくべきこと\n\n- ステータス: **Final**。\n- ERC-165 がないため、`owner()` が「管理者」を意味すると確信することはできません。同じシグネチャを持つ無関係な関数がある可能性もあります。「このウォレットはコレクションページを編集してよいか」といった重要度の低い確認なら問題ありませんが、報告されたオーナーに価値ある資産を送るといった判断には危険です。\n- `owner()` がゼロアドレスを返す場合、慣例的にはオーナーシップが放棄されたことを意味しますが、仕様はその解釈を要求していません。\n- 標準化された移転のセマンティクスとイベントが必要なら、代わりに [EIP-173](/eip-173/) を実装してください。ERC-5313 は自動的に満たされます。\n"},"ko":{"lang":"ko","tldr":"가능한 가장 작은 소유권 인터페이스. 컨트랙트가 owner()를 노출해 마켓플레이스와 도구가 누가 그 컨트랙트를 제어하는지 알 수 있게 한다.","tags":["ownership","access-control","interface","nft","marketplaces"],"related":[173,165,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5313/","markdown":"## 어떤 문제를 해결하나요?\n\n서드파티 사이트, 특히 NFT 마켓플레이스는 컨트랙트를 누가 제어하는지 알아야 합니다. 예를 들어 컬렉션 소유자가 페이지를 편집하거나, 배너를 설정하거나, 로열티를 구성하도록 허용하기 위해서입니다. 기존의 답은 [EIP-173](/eip-173/)으로, `transferOwnership`과 `OwnershipTransferred` 이벤트도 표준화합니다. 많은 컨트랙트가 `owner()`를 노출하지만 이전 방식은 제각각이어서(2단계 이전, 멀티시그 제어, 변경 불가능한 소유자) EIP-173을 완전히 준수한다고 말할 수 없습니다.\n\nERC-5313은 모두가 이미 의존하고 있는 부분, 즉 `owner()` 뷰 함수 하나를 명문화합니다.\n\n## 어떻게 동작하나요?\n\n준수하는 컨트랙트가 구현하는 것은 정확히 함수 하나입니다.\n\n```solidity\ninterface EIP5313 {\n    /// @notice Get the address of the owner\n    function owner() external view returns (address);\n}\n```\n\n이게 전부입니다. 이전 함수도, 이벤트도 없고, 의도적으로 [ERC-165](/eip-165/) 인터페이스 ID도 두지 않았습니다. 이미 `owner()`를 가진 수많은 기존 컨트랙트가 수정 없이 준수할 수 있게 하기 위해서입니다. 모든 EIP-173 컨트랙트(OpenZeppelin의 `Ownable` 포함)는 자동으로 ERC-5313을 만족합니다.\n\n소유권을 어떻게 설정하고, 이전하고, 포기하는지는 전적으로 컨트랙트에 맡겨져 있습니다.\n\n## 샘플 코드\n\n소유자가 고정된 컨트랙트입니다. 이전할 수 없으므로 EIP-173이 다루지 못합니다.\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract FixedOwnerCollection {\n    address private immutable _owner;\n\n    constructor() { _owner = msg.sender; }\n\n    /// ERC-5313\n    function owner() external view returns (address) {\n        return _owner;\n    }\n}\n```\n\n스크립트에서 제어권을 확인하는 예시입니다(ethers v6).\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst c = new Contract(collection, [\"function owner() view returns (address)\"], provider);\nconst owner: string = await c.owner();\nconst isOwner = owner.toLowerCase() === userAddress.toLowerCase();\n```\n\n## 알아둘 점\n\n- 상태: **Final**.\n- ERC-165가 없으면 `owner()`가 \"제어자\"를 뜻한다고 확신할 수 없습니다. 같은 시그니처를 가진 무관한 함수가 있을 수도 있습니다. \"이 지갑이 컬렉션 페이지를 편집해도 되는가\" 같은 위험이 낮은 확인에는 괜찮지만, 보고된 소유자에게 가치 있는 자산을 보내는 것 같은 결정에는 위험합니다.\n- `owner()`가 제로 주소를 반환하면 관례상 소유권이 포기되었다는 뜻이지만, 사양이 그 해석을 요구하지는 않습니다.\n- 표준화된 이전 시맨틱과 이벤트가 필요하다면 대신 [EIP-173](/eip-173/)을 구현하세요. ERC-5313은 자동으로 충족됩니다.\n"},"zh":{"lang":"zh","tldr":"最小的所有权接口：合约公开 owner()，让市场和工具能够知道谁控制着它。","tags":["ownership","access-control","interface","nft","marketplaces"],"related":[173,165,721],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5313/","markdown":"## 它解决什么问题？\n\n第三方网站，尤其是 NFT 市场，需要知道谁控制着某个合约：例如，让合集所有者编辑其页面、设置横幅或配置版税。此前的既有方案是 [EIP-173](/eip-173/)，它同时规范了 `transferOwnership` 和 `OwnershipTransferred` 事件。许多合约公开了 `owner()`，但处理转移的方式不同（两步转移、由多签控制、不可变的所有者），因此无法声称完全符合 EIP-173。\n\nERC-5313 把大家早已依赖的那部分固定下来：一个 `owner()` 视图函数。\n\n## 它如何运作\n\n合规的合约只需实现这一个函数：\n\n```solidity\ninterface EIP5313 {\n    /// @notice Get the address of the owner\n    function owner() external view returns (address);\n}\n```\n\n仅此而已。没有转移函数，没有事件，并且刻意不定义 [ERC-165](/eip-165/) 接口 ID，这样许多已有 `owner()` 的现有合约无需修改即可合规。每个 EIP-173 合约（包括 OpenZeppelin 的 `Ownable`）都自动满足 ERC-5313。\n\n所有权如何设置、转移或放弃，完全由合约自行决定。\n\n## 示例代码\n\n一个所有者固定的合约，EIP-173 无法涵盖它，因为它不能转移：\n\n```solidity\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.20;\n\ncontract FixedOwnerCollection {\n    address private immutable _owner;\n\n    constructor() { _owner = msg.sender; }\n\n    /// ERC-5313\n    function owner() external view returns (address) {\n        return _owner;\n    }\n}\n```\n\n通过脚本检查控制权（ethers v6）：\n\n```ts\nimport { Contract, JsonRpcProvider } from \"ethers\";\n\nconst provider = new JsonRpcProvider(process.env.RPC_URL);\nconst c = new Contract(collection, [\"function owner() view returns (address)\"], provider);\nconst owner: string = await c.owner();\nconst isOwner = owner.toLowerCase() === userAddress.toLowerCase();\n```\n\n## 需要注意\n\n- 状态：**Final**。\n- 没有 ERC-165，你就无法确定 `owner()` 指的是\"控制者\"：合约可能有一个签名相同但毫不相干的函数。对于\"这个钱包是否可以编辑合集页面\"这类低风险检查没有问题，但对于把有价值的资产发送给所报告的所有者这类决定则有风险。\n- `owner()` 返回零地址按惯例表示所有权已被放弃，但规范并不要求这种解释。\n- 如果你需要标准化的转移语义和事件，请改为实现 [EIP-173](/eip-173/)；这样你自然也满足 ERC-5313。\n"}}}
