Struct alloy_eips::eip1559::BaseFeeParams
source · pub struct BaseFeeParams {
pub max_change_denominator: u128,
pub elasticity_multiplier: u128,
}
Expand description
BaseFeeParams contains the config parameters that control block base fee computation
Fields§
§max_change_denominator: u128
The base_fee_max_change_denominator from EIP-1559
elasticity_multiplier: u128
The elasticity multiplier from EIP-1559
Implementations§
source§impl BaseFeeParams
impl BaseFeeParams
sourcepub const fn new(
max_change_denominator: u128,
elasticity_multiplier: u128,
) -> Self
pub const fn new( max_change_denominator: u128, elasticity_multiplier: u128, ) -> Self
Create a new BaseFeeParams
sourcepub const fn optimism_canyon() -> Self
pub const fn optimism_canyon() -> Self
Get the base fee parameters for Optimism Mainnet (post Canyon)
sourcepub const fn optimism_sepolia() -> Self
pub const fn optimism_sepolia() -> Self
Get the base fee parameters for Optimism Sepolia
sourcepub const fn optimism_sepolia_canyon() -> Self
pub const fn optimism_sepolia_canyon() -> Self
Get the base fee parameters for Optimism Sepolia (post Canyon)
sourcepub const fn base_sepolia() -> Self
pub const fn base_sepolia() -> Self
Get the base fee parameters for Base Sepolia
sourcepub const fn base_sepolia_canyon() -> Self
pub const fn base_sepolia_canyon() -> Self
Get the base fee parameters for Base Sepolia (post Canyon)
sourcepub fn next_block_base_fee(
self,
gas_used: u64,
gas_limit: u64,
base_fee: u64,
) -> u64
pub fn next_block_base_fee( self, gas_used: u64, gas_limit: u64, base_fee: u64, ) -> u64
Calculate the base fee for the next block based on the EIP-1559 specification.
See also calc_next_block_base_fee
Trait Implementations§
source§impl Clone for BaseFeeParams
impl Clone for BaseFeeParams
source§fn clone(&self) -> BaseFeeParams
fn clone(&self) -> BaseFeeParams
Returns a copy 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 BaseFeeParams
impl Debug for BaseFeeParams
source§impl<'de> Deserialize<'de> for BaseFeeParams
impl<'de> Deserialize<'de> for BaseFeeParams
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for BaseFeeParams
impl PartialEq for BaseFeeParams
source§fn eq(&self, other: &BaseFeeParams) -> bool
fn eq(&self, other: &BaseFeeParams) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for BaseFeeParams
impl Serialize for BaseFeeParams
impl Copy for BaseFeeParams
impl Eq for BaseFeeParams
impl StructuralPartialEq for BaseFeeParams
Auto Trait Implementations§
impl Freeze for BaseFeeParams
impl RefUnwindSafe for BaseFeeParams
impl Send for BaseFeeParams
impl Sync for BaseFeeParams
impl Unpin for BaseFeeParams
impl UnwindSafe for BaseFeeParams
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
source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.