Hello. I have the following problem:
- there is a user A (account) that can define a set of items to sell.
- User A only receives all the money when all his items are sold.
- any user B, C, ... (account) can buy an item that they want and that has not been sold to another user. For this, use a PDA so that the money goes to this account and in the end, it transfers everything to user A (smart contract).
-There may be the case that user A cancels the sale, meaning that the objects that have been sold will be his property again, and the money of the users who have bought the objects must be returned.
I have the list of the users, which I store their Pubkey.
How can you close the account and transfer the money to the users who made the transfer?