Given two contracts, I'd like to push a transaction that requires successful completion of an action by each of the two contracts.

If either action by either contract fails then all actions by all contracts must not occur.

The transaction is successful only when all actions by all contracts are successful.

Is this possible? Please give an example using cleos.

  • Constructing complex cases (e.g. multiple actions) using cleos is painful right now. It's easier using eosjs or eos-altjs. May 9 '18 at 21:25

In EOS, you can construct Transactions that contain multiple actions. When the transaction is submitted, all of the actions must succeed, or the entire transaction will fail. An example is available in the Smart Contract tutorial on the EOS Wiki.


If you're talking about contracts talking to one another, see the link here:


In this example, you see an "inline transactions" being sent. That one will be processed by the other contract. They all need to succeed for the transaction to be accepted.

In the shine contract.. we "listen" on a transfer to the account holding the shine code, and we "fan out" a series of transfers out.. I think this is not possible on some other well-known blockchains.

Your Answer

