Struct BaseFeeParams
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§
§impl BaseFeeParams
impl BaseFeeParams
pub const fn new(
max_change_denominator: u128,
elasticity_multiplier: u128,
) -> BaseFeeParams
pub const fn new( max_change_denominator: u128, elasticity_multiplier: u128, ) -> BaseFeeParams
Create a new BaseFeeParams
pub const fn ethereum() -> BaseFeeParams
pub const fn ethereum() -> BaseFeeParams
Get the base fee parameters for Ethereum mainnet
pub const fn optimism() -> BaseFeeParams
pub const fn optimism() -> BaseFeeParams
Get the base fee parameters for Optimism Mainnet
pub const fn optimism_canyon() -> BaseFeeParams
pub const fn optimism_canyon() -> BaseFeeParams
Get the base fee parameters for Optimism Mainnet (post Canyon)
pub const fn optimism_sepolia() -> BaseFeeParams
pub const fn optimism_sepolia() -> BaseFeeParams
Get the base fee parameters for Optimism Sepolia
pub const fn optimism_sepolia_canyon() -> BaseFeeParams
pub const fn optimism_sepolia_canyon() -> BaseFeeParams
Get the base fee parameters for Optimism Sepolia (post Canyon)
pub const fn base_sepolia() -> BaseFeeParams
pub const fn base_sepolia() -> BaseFeeParams
Get the base fee parameters for Base Sepolia
pub const fn base_sepolia_canyon() -> BaseFeeParams
pub const fn base_sepolia_canyon() -> BaseFeeParams
Get the base fee parameters for Base Sepolia (post Canyon)
pub 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§
§impl<'arbitrary> Arbitrary<'arbitrary> for BaseFeeParams
impl<'arbitrary> Arbitrary<'arbitrary> for BaseFeeParams
§fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<BaseFeeParams, Error>
fn arbitrary(u: &mut Unstructured<'arbitrary>) -> Result<BaseFeeParams, Error>
Self from the given unstructured data. Read more§fn arbitrary_take_rest(
u: Unstructured<'arbitrary>,
) -> Result<BaseFeeParams, Error>
fn arbitrary_take_rest( u: Unstructured<'arbitrary>, ) -> Result<BaseFeeParams, Error>
Self from the entirety of the given
unstructured data. Read more§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read more§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 more§impl Clone for BaseFeeParams
impl Clone for BaseFeeParams
§fn clone(&self) -> BaseFeeParams
fn clone(&self) -> BaseFeeParams
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for BaseFeeParams
§impl Debug for BaseFeeParams
impl Debug for BaseFeeParams
§impl<'de> Deserialize<'de> for BaseFeeParams
impl<'de> Deserialize<'de> for BaseFeeParams
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BaseFeeParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BaseFeeParams, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for BaseFeeParams
Source§impl From<BaseFeeParams> for BaseFeeParamsKind
impl From<BaseFeeParams> for BaseFeeParamsKind
Source§fn from(params: BaseFeeParams) -> Self
fn from(params: BaseFeeParams) -> Self
§impl PartialEq for BaseFeeParams
impl PartialEq for BaseFeeParams
§impl Serialize for BaseFeeParams
impl Serialize for BaseFeeParams
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 UnsafeUnpin for BaseFeeParams
impl UnwindSafe for BaseFeeParams
Blanket Implementations§
impl<A> ArbInterop for A
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
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> MaybeSerde for Twhere
T: Serialize + for<'de> Deserialize<'de>,
§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘwhere
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ
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