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