public static string[] GetAllRelatedAddresses(this Transaction tx, TransactionReceipt receipt) { if (tx == null) { return(Array.Empty <string>()); } var uniqueAddresses = new UniqueAddressList() { tx.From }; if (tx.To.IsNotAnEmptyAddress()) { uniqueAddresses.Add(tx.To); } if (receipt != null) { if (receipt.ContractAddress.IsNotAnEmptyAddress()) { uniqueAddresses.Add(receipt.ContractAddress); } foreach (var log in tx.GetTransactionLogs(receipt)) { if (log.Address.IsNotAnEmptyAddress()) { uniqueAddresses.Add(log.Address); } } } return(uniqueAddresses.ToArray()); }
public Task HandleAsync(ContractTransaction contractTransaction) { ContractAddresses.Add(contractTransaction.ContractAddress); return(Task.CompletedTask); }