If a contract calls several external methods of other contract(s), is it as a whole one atomic transaction (reverted as a whole if an exception happens)?
1 Answer
Mostly yes.
When a transaction is initiated to a contract all the actions caused by the transaction are included in the same transaction. This includes everything: calling the original contract, calls inside that contract to different functions and all calls to external libraries and contracts (and also possible calls from those contracts onwards).
All actions cost some gas. So the more there are actions the more gas is consumed. You, as the transaction initiator, have to be prepared to pay for all of these actions by specifying high enough a gas limit.
However it is possible to have exceptions in contracts which do not cause for the whole transaction to fail - depends on how the calls to other contracts are initiated. Here's some more info: does revert()/require() revert changes made to other contracts? . One more example is the use of new try/catch keywords: https://blog.ethereum.org/2020/01/29/solidity-0.6-try-catch/