revm_context_interface/transaction/eip7702.rs
1//! EIP-7702 Account Abstraction transaction interface.
2use auto_impl::auto_impl;
3use primitives::{Address, U256};
4
5/// Authorization trait.
6#[auto_impl(&, Box, Arc, Rc)]
7pub trait AuthorizationTr {
8 /// Authority address.
9 ///
10 /// # Note
11 ///
12 /// Authority signature can be invalid, so this method returns None if the authority
13 /// could not be recovered.
14 ///
15 /// Valid signature Parity should be 0 or 1 and
16 /// signature s-value should be less than SECP256K1N_HALF.
17 fn authority(&self) -> Option<Address>;
18
19 /// Returns authorization the chain id.
20 fn chain_id(&self) -> U256;
21
22 /// Returns the nonce.
23 ///
24 /// # Note
25 ///
26 /// If nonce is not same as the nonce of the signer account,
27 /// the authorization is skipped.
28 fn nonce(&self) -> u64;
29
30 /// Returns the address that this account is delegated to.
31 fn address(&self) -> Address;
32}