Releasing Funds with the Payment Splitter contract

Hi all,

I'm in the progress of currently migrating a web3.sendTransaction payment split NFT marketplace to OpenZeppelin's Payment Splitter contract. Along the way with my implementation I noticed that the funds have to be released after the payment has come through. Currently I've got it setup that the user/buyer is executing these release functions, I was wondering if perhaps there is a different way to implement this contract where the release functions would happen elsewhere so the buyer/user only needs to accept one transaction?

Kind Regards,
Scott

EDIT:
Upon further inspection/testing it was another method calling these transactions. However, I'm unable to release the funds for the addresses as no eth has appeared in any of the accounts.

PaymentSplitter follows a "pull payment" model. The funds are not released automatically, the release needs to be triggered. You can call the function release(account) on the contract.

1 Like

Thank you for your response.
I've managed to release the funds after the payment has been sent. Is there a way to allow another account (possibly an Admin account) to release those funds based on its deployed address, rather than have the user/customer run the 2-3 different release functions?
Sorry I'm a bit new to the OpenZeppelin contracts

Yes, the release function can already be called by anyone. It doesn't need to be one of the payees, nor an admin.

Ah okay awesome. In that instance what would in your own opinion be the best way to for those funds to be released so its less transactions for the user/buyer (currently they send payment to Payment Splitter contract, release all the funds, mint the artwork and then change the ownership)?

I don't think the buyer should be releasing all the funds. You should probably have a scheduled process to release funds regularly.

Ah okay thank you! Is there any resources you could recommend?

I've managed to try make each person's address able to release the funds however when releasing funds from the latest Payment Splitter contract it works successfully however a contract prior doesn't work. Is there any idea why that could be as well?

Thanks!

Please share the exact version you're using.

Sorry for the late reply,

I'm currently using OZ contracts version ^3.2.0 in my package file. The pragma for the PaymentSplitter.sol is solidity >=0.6.0 < 0.8.0 and the contracts I've created are using solidity 0.6.12 / ^0.6.0.

EDIT:
I've managed to use these exact versions on remix to do some initial testing and they work great. I've ran into problems with releasing funds as I deploy two different PaymentSplitter contracts with the same payees only the latest deployment will allow funds to be released and the other gives an error regarding that there are no funds to be released.