pub fn encode(&self) -> Token {
        let mut tokens = vec![self.l2_protocol_upgrade_tx.encode()];

        let protocol_version = ProtocolSemanticVersion::try_from_packed(self.new_protocol_version)
            .expect("Version is not supported")
            .minor;
        if protocol_version.is_pre_gateway() {
            tokens.push(Token::Array(
                self.factory_deps
                    .clone()
                    .expect("Factory deps should be present in pre-gateway upgrade data")
                    .into_iter()
                    .map(Token::Bytes)
                    .collect(),
            ));
        }
        tokens.extend([
            Token::FixedBytes(self.bootloader_hash.into()),
            Token::FixedBytes(self.default_account_hash.into()),
            Token::FixedBytes(self.evm_emulator_hash.into()),
            Token::Address(self.verifier),
            self.verifier_params.encode(),
            Token::Bytes(self.l1_contracts_upgrade_calldata.clone()),
            Token::Bytes(self.post_upgrade_calldata.clone()),
            Token::Uint(self.upgrade_timestamp),
            Token::Uint(self.new_protocol_version),
        ]);

        Token::Tuple(tokens)
    }
Encodes `ProposedUpgrade` to a RLP token. Uses the latest schema.
core/lib/types/src/abi.rs