ERC-5298: ENS Trust to hold NFTs under ENS name

An interface for a smart contract acting as a "trust" that holds tokens by ENS name.


Metadata
Status: StagnantStandards Track: ERCCreated: 2022-07-12
Authors
Zainan Victor Zhou (@xinbenlv)

Abstract


This EIP standardizes an interface for smart contracts to hold of EIP-721 and EIP-1155 tokens on behalf of ENS domains.

Motivation


Currently, if someone wants to receive a token, they have to set up a wallet address. This EIP decouples NFT ownership from wallet addresses.

Specification


  1. Compliant contracts MUST implement ERC721TokenReceiver, as defined in EIP-721.
  2. Compliant contracts implement the following interface:

  1. claimTo MUST check if msg.sender is the owner of the ENS node identified by bytes32 ensNode (and/or approved by the domain in implementation-specific ways). The compliant contract then MUST make a call to the safeTransferFrom function of EIP-721 or EIP-1155.

  2. Any ensNode is allowed.

Rationale


  1. ENS was chosen because it is a well-established scoped ownership namespace. This is nonetheless compatible with other scoped ownership namespaces.

  2. We didn't expose getters or setters for ensRoot because it is outside of the scope of this EIP.

Backwards Compatibility


No backward compatibility issues were found.

Test Cases



Reference Implementation



Security Considerations


Needs discussion.

Copyright


Copyright and related rights waived via CC0.