# Payment Splitter addPayee after initialization

**URL:** <https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606>\
**Category:** Contracts\
**Tags:** erc721, erc1155\
**Created:** [October 26, 2021, 2:41pm UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606 "2021-10-26T14:41:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andon\_Mitev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/andon_mitev/32/4301_2.png) [@Andon\_Mitev](https://forum.openzeppelin.com/u/Andon_Mitev)\
**Post date:** [October 26, 2021, 2:41pm UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/1 "2021-10-26T14:41:20Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![0xLostArchitect](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/0xlostarchitect/32/9554_2.png) [@0xLostArchitect](https://forum.openzeppelin.com/u/0xLostArchitect)\
**Post date:** [October 26, 2021, 3:17pm UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/2 "2021-10-26T15:17:36Z")

</div>

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

```auto
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.

---

<div class="post-metadata">

**Author:** ![Andon\_Mitev](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/andon_mitev/32/4301_2.png) [@Andon\_Mitev](https://forum.openzeppelin.com/u/Andon_Mitev)\
**Post date:** [October 26, 2021, 3:56pm UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/3 "2021-10-26T15:56:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [October 27, 2021, 9:42pm UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/4 "2021-10-27T21:42:44Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ibox](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@ibox](https://forum.openzeppelin.com/u/ibox)\
**Post date:** [August 6, 2022, 7:11pm UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/5 "2022-08-06T19:11:40Z")

</div>

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](https://github.com/kitfud/SmartSplitter)) and this one ([https://medium.com/northwest-nfts/announcing-paymentsplitter-io-9b27eccfacd4](https://medium.com/northwest-nfts/announcing-paymentsplitter-io-9b27eccfacd4)) are trying to tackle this issue

thanks for your help!

---

<div class="post-metadata">

**Author:** ![comeonline](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/comeonline/32/7800_2.png) [@comeonline](https://forum.openzeppelin.com/u/comeonline)\
**Post date:** [August 7, 2022, 3:41am UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/6 "2022-08-07T03:41:01Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ibox](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@ibox](https://forum.openzeppelin.com/u/ibox)\
**Post date:** [August 8, 2022, 10:03am UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/7 "2022-08-08T10:03:07Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![frangio](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.openzeppelin.com/frangio/32/15251_2.png) [@frangio](https://forum.openzeppelin.com/u/frangio)\
**Post date:** [August 10, 2022, 2:32pm UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/8 "2022-08-10T14:32:59Z")

</div>

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

In the meantime, I've heard about [0xSplits](https://www.0xsplits.xyz) which you may use as an out of the box solution.

---

<div class="post-metadata">

**Author:** ![ibox](https://avatars.discourse-cdn.com/v4/letter/i/f05b48/32.png) [@ibox](https://forum.openzeppelin.com/u/ibox)\
**Post date:** [August 10, 2022, 2:54pm UTC](https://forum.openzeppelin.com/t/payment-splitter-addpayee-after-initialization/17606/9 "2022-08-10T14:54:15Z")

</div>

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!
