pub struct Authorization {
pub authority: H160,
pub address: H160,
pub nonce: u64,
pub is_valid: bool,
}Expand description
Authorization contains already prepared data for EIP-7702.
authorityisecrecoveredauthority address.addressis delegation destination address.nonceis thenoncevalue whichauthority.nonceshould be equal.is_validis the flag that indicates the validity of the authorization. It is used to charge gas for each authorization item, but if it’s invalid exclude from EVMauthority_listflow.
Fields§
§address: H160§nonce: u64§is_valid: boolImplementations§
Source§impl Authorization
impl Authorization
Sourcepub const fn new(
authority: H160,
address: H160,
nonce: u64,
is_valid: bool,
) -> Self
pub const fn new( authority: H160, address: H160, nonce: u64, is_valid: bool, ) -> Self
Create a new Authorization with given authority, address, and nonce.
Sourcepub fn is_delegated(code: &[u8]) -> bool
pub fn is_delegated(code: &[u8]) -> bool
Returns true if authority is delegated to address.
0xef0100 ++ address, and it is always 23 bytes.
Sourcepub fn get_delegated_address(code: &[u8]) -> Option<H160>
pub fn get_delegated_address(code: &[u8]) -> Option<H160>
Get authority delegated address.
It checks, is it delegation designation (EIP-7702).
Sourcepub fn delegation_code(&self) -> Vec<u8> ⓘ
pub fn delegation_code(&self) -> Vec<u8> ⓘ
Returns the delegation code as composing: 0xef0100 ++ address.
Result code is always 23 bytes.
Trait Implementations§
Source§impl Clone for Authorization
impl Clone for Authorization
Source§fn clone(&self) -> Authorization
fn clone(&self) -> Authorization
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for Authorization
impl Debug for Authorization
Source§impl Default for Authorization
impl Default for Authorization
Source§fn default() -> Authorization
fn default() -> Authorization
Returns the “default value” for a type. Read more
Source§impl PartialEq for Authorization
impl PartialEq for Authorization
impl Eq for Authorization
impl StructuralPartialEq for Authorization
Auto Trait Implementations§
impl Freeze for Authorization
impl RefUnwindSafe for Authorization
impl Send for Authorization
impl Sync for Authorization
impl Unpin for Authorization
impl UnwindSafe for Authorization
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more