After developing a token Smart Contract that is compliant with the ERC20 standard https://github.com/ethereum/EIPs/issues/20 (is that the same as token API https://github.com/ethereum/wiki/wiki/Standardized_Contract_APIs ? ) and a escrow Smart Contract too, I want to use the escrow contract to manage tokens instead of Ether. I guess that is possible by implementing calls to the token contract inside the escrow contract, right?

So, I have two questions:

1.- Can I develop a universal escrow contract that accepts any kind of tokens, not just my own, using the token contract hardcoded address?

2.- If gas is out while executing the escrow and token contract has been called from escrow contract, would token transfers be rollback?

Thx for any hint about these topics.

References: Can I use my own coin in 3rd party contracts? How can I know if a token that I created is used in a smart contract? How can ERC20 token implementations be verified?

  • 4
    Right, Yes and Yes. – Edmund Edgar Jan 26 '17 at 13:35
  • 1
    Check out 0x for a token escrow example. – 0xcaff Aug 16 '17 at 1:46
  • Do you have an example of the escrow contract? – saitam Mar 1 '18 at 7:21

Right, it is possible to implement calls to tokens from an escrow contract.

1) You can make an escrow that will support any kind of token (as long as they implement the expected abi).

2) Yes, all evm state changes made by a transaction where the gas runs out are reverted.

protected by Community Jun 21 '18 at 19:06

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.