Payment Splitter addPayee after initialization

Hello I have NFT Smart Contract and I need to distribute royalties. I found out that the Payment Splitter will be amazing for that scenario however I don't know all of the payees when NFT Smart Contract is initialized. I need to add the third payee member when he is minting the NFT but I can see the addPayee function is private, do you have any suggestion, how would you handle this case. There will be in total 3 payees addresses. 2 of them are known when the collection is created and the 3rd one is known when the nft is minted how to add this address to the payment splitter or some separate logic which will be helpful

I think you can just define it yourself and put a proper permission structure on it, something like:

contract CustomPaymentSplitter is Ownable, PaymentSplitter {
    function addPayee(address payee_, uint256 shares_) onlyOwner { 
        _addPayee(payee_, shares_);
    }
}

EDIT: If it's private, you may have to override the _addPayee function and/or implement it yourself.

Yes it is private, i was wondering is this the correct approach and how other platforms are distributing royalties

It is not possible to addPayee after initialization, because doing that requires a more complex implementation than what we have currently.

Hi @frangio,
do you plans to release that feature?

Indeed most projects involving royalties don't have the list of payees before hand or need to update the list of payee later on after releasing the funds for example.
It seems like ThirdWeb contract has the same limitations than yours but that this project (https://github.com/kitfud/SmartSplitter) and this one (https://medium.com/northwest-nfts/announcing-paymentsplitter-io-9b27eccfacd4) are trying to tackle this issue

thanks for your help!

it can be done thru some tricks, like, in the begining we can assign some dummy wallet and its %, once we get actual payee's wallet addy, we can change it with dummy wallet.

fair, but I mean, this is a regular real life use case...
if we want to build app used by millions of people we need to replicate what millions of people are already doing on Web 2. It should not require "tricks" or workarounds, it should be standard, and OpenZeppelin represents these standards for the Web 3 community

1 Like

@ibox Thanks for the feedback. We have some issues around this such as https://github.com/OpenZeppelin/openzeppelin-contracts/issues/2896.

In the meantime, I've heard about 0xSplits which you may use as an out of the box solution.

1 Like

Hi @frangio
thanks for your answer, the issue with OxSplits is that there is no API and it's not flexible enough. Indeed the ticket you shared is important, crazy it hasn't moved in a year though!