https://developers.eos.io/eosio-home/docs/sending-an-inline-transaction-to-external-contract

In above tutorial, I can see that 'addressbook' send notofication message to 'abcounter', but the data(notification message) is just a string not actual contract data.

What I'm trying to do is send a contract data(fisrt name, last name, street, city, state) to abcounter (to make people_backup table in abcounter).

I see there are examples that sends action to other contract but no data.

Is it possible to send contract data to other??

up vote 3 down vote accepted

Take a look at inline actions (executed in the same transaction) or deferred transactions (executed in another transaction.

Inline Actions

The link refers to the official developer portal. Inline actions will execute in the same transaction as the initiating action. If the inline action fails the whole transaction will fail. These actions also count to the transaction time limit, so keep an eye on the execution time.

I guess an important code snippet is to make a tuple for your action's data:

std::make_tuple(first_name, last_name, street, city, state)

Deferred Transactions

The link refers to another thread on this Exchange. These transactions are completely new transactions which may be included in another block. There is also no guarantee that these will be executed. So keep an eye if your action actually gets triggered.

If you combine these clever you can perform mighty interactions between smart contracts. E.g. your contract's action sends an inline action to a write to another contract which will perform another deferred transaction that will notify the original contract on so on.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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