[Ethereum] how to deploy escrow smartcontract and use it with exciting erc20 tokens

contract-deploymentcontract-developmentethereum-classicsoliditytokens

i want to build escrow smart contract with one particular ERC20 standard token. i want to hold token in escrow as a guarantee for transaction. and on some condition those tokens should go back to sellers account.

so in my app party A is use some services of party B but party B is not trusted so party B will keep some token in escrow and after some condition party B will get those tokens back. its like one way transaction escrow.

but what conditions we can use like if condition. also Can i send tokens to smartContract and if i can then how to send those tokens back to Party B's wallet or how to send received tokens from escrow smartcontract to any wallet owner person

and if i am the owner of the tokens and i am not able to understand who can deploy escrow.cause if i deploy escrow and im the owner of the tokens then i can go to that token function and use transferfrom() function and use escrow address to get back my tokens so how to prevent this question.so how to safely lock those tokens in escrow. because almost 90% tutorials are about ether not about tokens on ethers.

Best Answer

I'm having a bit difficulties following your writing, so I'll make this a bit more generalized.

If you are the one who released the token then you have decided how the tokens can be transferred. Most likely you as the contract owner have full power to transfer any amount of tokens to whoever you wish, or maybe even remove tokens from someone (yes, tokens can be removed as they only exist within the same contract, they are never actually 'sent' anywhere).

So if you have full power over the tokens you can just do whatever you want with them - hold some in any sort of escrow for example if your contract supports such functionality.

If you did not create the token contract (but it was created by someone else) you can act as an escrow and get the tokens transferred to your account. When the escrow service is no longer needed, you can either authorize (approve function in ERC20) the transfer back to someone or directly transfer them with the transfer function.

Related Topic