Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ERC: Staked ERC-721 Ownership Recognition #30

Merged
merged 25 commits into from
Dec 7, 2023

Conversation

sullof
Copy link
Contributor

@sullof sullof commented Oct 26, 2023

A previous PR has been closed on EIPs (ethereum/EIPs#7817).


The ownership of ERC721 tokens when staked in a pool presents challenges, particularly when it involves older, non-lockable NFTs like, for example, Crypto Punks or Bored Ape Yacht Club (BAYC) tokens. This proposal introduces an interface to address these challenges by allowing staked NFTs to be recognized by their original owners, even after they've been staked.

Recent solutions involve retaining NFT ownership while "locking" the token when staked. However, this requires the NFT contract to implement lockable functionality. Many early vintage NFTs like CryptoPunks or Bored Ape Yacht Club were not originally designed as lockable.

When these non-lockable NFTs are staked, ownership transfers fully to the staking pool contract. This prevents the original owner from accessing valuable privileges and benefits associated with their NFTs.

For example:

A BAYC holder would lose access to the BAYC Yacht Club and member events when staked.
A CryptoPunks holder may miss out on special airdrops or displays only available to verified owners.
Owners of other early NFTs like EtherRocks would lose the social status of provable ownership when staked.
By maintaining a record of the original owner, the proposed interface allows these original perks to remain accessible even when the NFT is staked elsewhere. This compatibility is critical for vintage NFT projects lacking native locking mechanisms.

The interface provides a simple, elegant way to extend staking compatibility to legacy NFTs without affecting their core functionality or benefits of ownership.

The interface:

interface IERC7531 {
  /**
   * @dev Emitted when the token's technical owner (the contract holding the token) is different 
   *      from its actual owner (the entity with rights over the token). This scenario is common 
   *      in staking, where a staking contract is the technical owner. The event MUST be emitted 
   *      in the same or any subsequent block as the Transfer event for the token. 
   *      A later Transfer event involving the same token supersedes this RightsHolderChange event.
   *      To ensure authenticity, entities listening to this event MUST verify that the contract emitting
   *      the event matches the token's current owner as per the related Transfer event.
   *
   * @param tokenAddress The address of the token contract.
   * @param tokenId The ID of the token.
   * @param holder The address of the actual rights holder of the token.
   */
  event RightsHolderChange(address indexed tokenAddress, uint256 indexed tokenId, address indexed holder);

  /**
   * @dev Returns the address of the entity with rights over the token, distinct from the current owner.
   *      The function MUST revert if the token does not exist or is not currently held.
   *
   * @param tokenAddress The address of the ERC-721 contract.
   * @param tokenId The ID of the token.
   * @return The address of the entity with rights over the token.
   */
  function rightsHolderOf(
    address tokenAddress,
    uint256 tokenId
  ) external view returns (address);
}

@Pandapip1
Copy link
Member

@eth-bot rerun

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Oct 27, 2023

✅ All reviewers have approved.

@eip-review-bot eip-review-bot changed the title Readding ERC-7531 Add ERC: Getting Staked ERC-721 Ownership Recognition Oct 27, 2023
@sullof
Copy link
Contributor Author

sullof commented Nov 14, 2023

I just added a HolderOfRightsFor event, following a fruitful discussion on Ethereum Magician. I think that now the branch is ready to be merged. Hopefully, it will happen soon.

BTW, the errors in the continuous integration bot are related to other documents in the repo, not to this specific one.

@github-actions github-actions bot removed the w-ci label Nov 14, 2023
@github-actions github-actions bot added the w-ci label Nov 14, 2023
@sullof
Copy link
Contributor Author

sullof commented Nov 14, 2023

@Pandapip1 Right now, all the errors reported by the HTMLProofer are due to other documents. I wonder if there is anything I can do. Should I fix those document or ignore them and you guys solve the issue somehow?

@sullof sullof changed the title Add ERC: Getting Staked ERC-721 Ownership Recognition Add ERC: Staked ERC-721 Ownership Recognition Nov 17, 2023
@github-actions github-actions bot removed the w-ci label Nov 17, 2023
@github-actions github-actions bot added the w-ci label Nov 17, 2023
@github-actions github-actions bot removed the w-ci label Nov 21, 2023
@github-actions github-actions bot added the w-ci label Nov 21, 2023
Copy link

The commit ea12dbd (as a parent of e6fae74) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot removed the w-ci label Nov 27, 2023
ERCS/erc-7531.md Outdated Show resolved Hide resolved
ERCS/erc-7531.md Outdated Show resolved Hide resolved
ERCS/erc-7531.md Outdated Show resolved Hide resolved
ERCS/erc-7531.md Outdated Show resolved Hide resolved
ERCS/erc-7531.md Outdated Show resolved Hide resolved
@sullof
Copy link
Contributor Author

sullof commented Nov 28, 2023

@SamWilsn I fixed all the issues you pointed out.
I also changed the name of the event and the function, following your suggestion.

@eip-review-bot eip-review-bot enabled auto-merge (squash) December 7, 2023 16:48
Copy link
Collaborator

@eip-review-bot eip-review-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eip-review-bot eip-review-bot merged commit 2ab71d0 into ethereum:master Dec 7, 2023
15 of 16 checks passed
@sullof sullof deleted the add-erc-7531 branch December 7, 2023 22:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants