pub fn from_abi(tx: abi::Transaction, allow_no_target: bool) -> anyhow::Result<Self> {
        Ok(match tx {
            abi::Transaction::L1 {
                tx,
                factory_deps,
                eth_block,
            } => {
                let factory_deps_hashes: Vec<_> = factory_deps
                    .iter()
                    .map(|b| BytecodeHash::for_bytecode(b).value_u256())
                    .collect();
                anyhow::ensure!(tx.factory_deps == factory_deps_hashes);
                for item in &tx.reserved[2..] {
                    anyhow::ensure!(item == &U256::zero());
                }
                assert_eq!(tx.max_priority_fee_per_gas, U256::zero());
                assert_eq!(tx.paymaster, U256::zero());
                assert!(tx.signature.is_empty());
                assert!(tx.paymaster_input.is_empty());
                assert!(tx.reserved_dynamic.is_empty());
                let hash = tx.hash();
                Transaction {
                    common_data: match tx.tx_type {
                        t if t == PRIORITY_OPERATION_L2_TX_TYPE.into() => {
                            ExecuteTransactionCommon::L1(L1TxCommonData {
                                serial_id: PriorityOpId(
                                    tx.nonce
                                        .try_into()
                                        .map_err(|err| anyhow::format_err!("{err}"))?,
                                ),
                                canonical_tx_hash: hash,
                                sender: u256_to_address(&tx.from),
                                layer_2_tip_fee: U256::zero(),
                                to_mint: tx.reserved[0],
                                refund_recipient: u256_to_address(&tx.reserved[1]),
                                full_fee: U256::zero(),
                                gas_limit: tx.gas_limit,
                                max_fee_per_gas: tx.max_fee_per_gas,
                                gas_per_pubdata_limit: tx.gas_per_pubdata_byte_limit,
                                op_processing_type: l1::OpProcessingType::Common,
                                priority_queue_type: l1::PriorityQueueType::Deque,
                                eth_block,
                            })
                        }
                        t if t == PROTOCOL_UPGRADE_TX_TYPE.into() => {
                            ExecuteTransactionCommon::ProtocolUpgrade(ProtocolUpgradeTxCommonData {
                                upgrade_id: tx.nonce.try_into().unwrap(),
                                canonical_tx_hash: hash,
                                sender: u256_to_address(&tx.from),
                                to_mint: tx.reserved[0],
                                refund_recipient: u256_to_address(&tx.reserved[1]),
                                gas_limit: tx.gas_limit,
                                max_fee_per_gas: tx.max_fee_per_gas,
                                gas_per_pubdata_limit: tx.gas_per_pubdata_byte_limit,
                                eth_block,
                            })
                        }
                        unknown_type => anyhow::bail!("unknown tx type {unknown_type}"),
                    },
                    execute: Execute {
                        contract_address: Some(u256_to_address(&tx.to)),
                        calldata: tx.data,
                        factory_deps,
                        value: tx.value,
                    },
                    raw_bytes: None,
                    received_timestamp_ms: helpers::unix_timestamp_ms(),
                }
            }
            abi::Transaction::L2(raw) => {
                let (req, hash) =
                    transaction_request::TransactionRequest::from_bytes_unverified(&raw)?;
                let mut tx = L2Tx::from_request_unverified(req, allow_no_target)?;
                tx.set_input(raw, hash);
                tx.into()
            }
        })
    }
Converts a transaction from its ABI representation.

# Arguments

- `allow_no_target` enables / disables L2 transactions without target (i.e., `to` field).
This field can only be absent for EVM deployment transactions.
core/lib/types/src/lib.rs