If I have assets (can be just ADA for simplicity) locked in a contract, how can I release the funds to the previous owners most efficiently?
Some more context regarding the question. I created a pay endpoint (for the PAB), where different parties pay the same amount of ADA into a smart contract. Once a certain condition is met, the script can be consumed as an UTXO by another party (= getting paid some ADA). Until that condition is met, I want the parties that pay funds into the contract to essentially cancel the contract (= creating more appropriate UTXOs). In simple terms, the parties get their money back.
I have some code that solves this on a per-party basis, but I would like to get to the point where all parties get "reimbursed".