question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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:open
  • Created 2 years ago
  • Reactions:1
  • Comments:15 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mw2000commented, Mar 30, 2022

I also would want to tag @Amxx snd @frangio to this thread to hear their thoughts about it.

0reactions
hanselbcommented, Apr 16, 2022

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Extending Contracts - OpenZeppelin Docs
Extending Contracts. Most of the OpenZeppelin Contracts are expected to be used via inheritance: you will inherit from them when writing your own...
Read more >
Part 32 - Contract Financing | Acquisition.GOV
32.205 Procedures for offeror-proposed commercial contract financing. ... If the financing institution is willing to extend credit, ...
Read more >
CSG Forte Payments Inc Approved NCRB ... - City of Chicago
extension of the current Forte contract to sustain uninterrupted services. Attach a copy of the cost proposal, scope of services, ...
Read more >
25A-2. "Consumer credit sale" defined.
arranges for the extension of consumer credit, or offers to extend or arrange ... the offer in this State to buy, regardless of...
Read more >
solicitation/contract/order for commercial items
17b, CHECK IF REMITTANCE IS DIFFERENT AND PUT SUCH ADDRESS IN OFFER ... (b) If the Government exercises this option, the extended contract...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found