signet_zenith/
lib.rs

1#![doc = include_str!("../README.md")]
2#![warn(
3    missing_copy_implementations,
4    missing_debug_implementations,
5    missing_docs,
6    unreachable_pub,
7    clippy::missing_const_for_fn,
8    rustdoc::all
9)]
10#![cfg_attr(not(test), warn(unused_crate_dependencies))]
11#![deny(unused_must_use, rust_2018_idioms)]
12#![cfg_attr(docsrs, feature(doc_cfg))]
13
14mod bindings;
15pub use bindings::{
16    mintCall, BundleHelper, HostOrders, Passage, RollupOrders, RollupPassage, Transactor, Zenith,
17};
18
19mod block;
20pub use block::{decode_txns, encode_txns, Alloy2718Coder, Coder, ZenithBlock, ZenithTransaction};
21
22mod trevm;
23
24use alloy::{
25    network::Network,
26    primitives::{address, Address},
27    providers::Provider,
28};
29
30use alloy_core as _;
31
32/// System address with permission to mint tokens on pre-deploys.
33/// "tokenadmin"
34pub const MINTER_ADDRESS: Address = address!("00000000000000000000746f6b656e61646d696e");
35
36impl<P, N> HostOrders::HostOrdersInstance<P, N>
37where
38    P: Provider<N>,
39    N: Network,
40{
41    /// Preflight a signed order to see if the transaction would succeed.
42    /// # Warning ⚠️
43    /// Take care with the rpc endpoint used for this. SignedFills *must* remain private until they mine.
44    pub async fn try_fill(
45        &self,
46        outputs: Vec<RollupOrders::Output>,
47        permit: RollupOrders::Permit2Batch,
48    ) -> Result<(), alloy::contract::Error> {
49        self.fillPermit2(outputs, permit).call().await.map(drop)
50    }
51}