As we know, smart contracts in Ethereum are executed within the EVM. The EVM is a virtual machine that also acts as a sandbox, thus preventing smart contracts from directly accessing the network and other shared resources of the blockchain. To update the data stored within the blockchain, the only viable way is therefore to instantiate a transaction, which must be validated by the network nodes. Transactions can also be instantiated by smart contracts.
In the following sections, we will see the best practices that we can adopt to ensure the security of transactions within smart contracts.