I'm looking for any help og pointers, as to the possibility of creating a contract that would act as a "middleman" in a token/eth transaction between 2 users.
Considering a website, were users can list their assets (tokens) for sale at a given rate, and other can give their bid, and if the parties agrees to complete the deal, a smart contract should handle the transaction, to ensure trust in the deal.
Through the website, both seller and buyer calls a function on the smart contract, and thereby sending tokens / Eth to the contract. When both have done so, the last transfer calls an exchange function which will exchange the assets between the users.
I can't see any other way, than the website needs to control and monitor the transactions, this is in essence my question. What would be the best way to create such a transaction in terms of design?