ERC721PaymentSplitter Extension Contract Proposal
See original GitHub issue🧐 Motivation
We are trying to find an official way to discretely/transparently distribute rewards among token holders. I am certain we can accomplish this by combining the ERC721, ERC721Enumerable, PaymentSplitter contracts. This would allow creators to share ETH or ERC-20 tokens proportionally among holders.
📝 Details
I have extended ERC721Enumerable and used most of the functions of PaymentSplitter but removed payees[]
and made _totalShares
a function that returns the ERC721Enumerable’s totalSupply
(or override to maxSupply
if we want to save shares for future token holders).
This allows me to add two public methods to the ERC721, release(tokenId)
and release(account)
to distribute payment using ownerOf(tokenId)
and tokenOfOwnerByIndex(account)
internally.
I also added _pendingPayment(account)
and _pendingPayment(tokenId)
and use it to check on before token transfer for release to owner (or leaving it for future claim by changing _releaseOnTranser
to false which can be set in the constructor)
I am adding this to start the dialog while I work on cleaning my code and tests before submitting my PR. I have a working prototype of this concept here 0x68ddddc10323f8b8e3fe3514dcdb70381af12e85
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (6 by maintainers)
I also would want to tag @Amxx snd @frangio to this thread to hear their thoughts about it.
I understand now. Thank you so much @Amxx for the explanation, I can see now why you made those tradeoffs. This has given me much to think about while I come up with better designs.