主页EIPs
EIPsERC-5313
ERC-5313

Light Contract Ownership

An interface for identifying ownership of contracts
FinalStandards Track: ERC
创建时间: 2022-07-22
关联 EIP: EIP-165, EIP-173
William Entriken (@fulldecent)
社区讨论原文链接编辑
1 分钟了解

相关视频
欢迎补充好内容
去提交
正文

Abstract

This specification defines the minimum interface required to identify an account that controls a contract.

Motivation

This is a slimmed-down alternative to EIP-173.

Specification

The key word “MUST” in this document is to be interpreted as described in RFC 2119.

Every contract compliant with this EIP MUST implement the EIP5313 interface.

// SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.15; /// @title EIP-5313 Light Contract Ownership Standard interface EIP5313 { /// @notice Get the address of the owner /// @return The address of the owner function owner() view external returns(address); }

Rationale

Key factors influencing the standard:

  • Minimize the number of functions in the interface
  • Backwards compatibility with existing contracts

This standard can be (and has been) extended by other standards to add additional ownership functionality. The smaller scope of this specification allows more and more straightforward ownership implementations, see limitations explained in EIP-173 under "other schemes that were considered".

Implementing EIP-165 could be a valuable addition to this interface specification. However, this EIP is being written to codify existing protocols that connect contracts (often NFTs), with third-party websites (often a well-known NFT marketplace).

Backwards Compatibility

Every contract that implements EIP-173 already implements this specification.

Security Considerations

Because this specification does not extend EIP-165, calling this EIP's owner function cannot result in complete certainty that the result is indeed the owner. For example, another function with the same function signature may return some value that is then interpreted to be the true owner. If this EIP is used solely to identify if an account is the owner of a contract, then the impact of this risk is minimized. But if the interrogator is, for example, sending a valuable NFT to the identified owner of any contract on the network, then the risk is heightened.

Copyright and related rights waived via CC0.

扩展阅读
欢迎补充好内容
去提交
相关项目
欢迎补充好内容
去提交

不想错过最新的 EIP 动态?

订阅 EIPs Fun 周刊以跟进相关更新,建⽴你与 EIP 之间的连接 ,更好地建设以太坊。

详情
聚集 EIP 贡献者, 扩展以太坊
资源
GitHub
支持社区