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: u128The base_fee_max_change_denominator from EIP-1559
elasticity_multiplier: u128The 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<'arbitrary> Arbitrary<'arbitrary> for BaseFeeParams
impl<'arbitrary> Arbitrary<'arbitrary> for BaseFeeParams
Source§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
fn arbitrary_take_rest(u: Unstructured<'arbitrary>) -> Result<Self>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read moreSource§impl Clone for BaseFeeParams
impl Clone for BaseFeeParams
Source§fn clone(&self) -> BaseFeeParams
fn clone(&self) -> BaseFeeParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
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>,
Source§impl PartialEq for BaseFeeParams
impl PartialEq for BaseFeeParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 32 bytes