Great solution @Ernest_SG
The only comment I would make is that TransactionCompleted isn’t really specific enough for an appropriate event name. “Transaction” could refer to either of our transactions (deposit or transfer) and any additional types of transaction that are added later. You could use this same “general” event for all transactions, and add an additional string parameter for the transaction type. The name of each type of transaction could then be added as a fixed string in each of the separate emit statements e.g.
event TransactionCompleted(string transaction, uint amount, address sender, address recipient);
emit TransactionCompleted("Transfer", amount, msg.sender, recipient);
emit TransactionCompleted("Desposit", _toAdd, msg.sender, address(0));
Notice, that the number of arguments and their values in the emit statements must correspond with the number of parameters and their data types in the event definition. This means that any of the arguments that aren’t relevant for a particular transaction would still need to be included and logged as zero values.
Or you could change the event name to something more specific to a transfer, and just use it as an event exclusive to transfers, and have separate event definitions for each type of transaction.
Let me know if you have any questions