As we known, if a transaction fails, the results of all actions in the transaction must be rolled back.
For example, account user1 (only has 80 EOS) submit a transaction that do following tasks:
- Modify multi index table in contract.
- Transfer 50 EOS from user1 to user2.
- Transfer 50 EOS from user1 to user3.
This transaction would fail as the balance of user1 is not enough.
How eos rollback the changes for multi index table?
In link https://developers.eos.io/eosio-cpp/docs/communication-model, I find there is a concept of “Current Transaction Data”, but there is no detailed information.
Could someone tell me the technical details about how to make transaction atomic in EOS?