pub use gas_info::*;
/// This module was auto-generated with ethers-rs Abigen.
/// More information at: <https://github.com/gakonst/ethers-rs>
#[allow(
clippy::enum_variant_names,
clippy::too_many_arguments,
clippy::upper_case_acronyms,
clippy::type_complexity,
dead_code,
non_camel_case_types
)]
#[allow(clippy::module_inception)]
#[allow(clippy::useless_conversion)]
#[allow(clippy::large_enum_variant)]
pub mod gas_info {
#[allow(deprecated)]
fn __abi() -> ::ethers::core::abi::Abi {
::ethers::core::abi::ethabi::Contract {
constructor: ::core::option::Option::None,
functions: ::core::convert::From::from([
(
::std::borrow::ToOwned::to_owned("decimals"),
::std::vec![::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("decimals"),
inputs: ::std::vec![],
outputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::Pure,
},],
),
(
::std::borrow::ToOwned::to_owned("getL1Fee"),
::std::vec![::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("getL1Fee"),
inputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("_data"),
kind: ::ethers::core::abi::ethabi::ParamType::Bytes,
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("bytes"),
),
},],
outputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},],
),
(
::std::borrow::ToOwned::to_owned("getL1GasUsed"),
::std::vec![::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("getL1GasUsed"),
inputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::borrow::ToOwned::to_owned("_data"),
kind: ::ethers::core::abi::ethabi::ParamType::Bytes,
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("bytes"),
),
},],
outputs: ::std::vec![::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::View,
},],
),
(
::std::borrow::ToOwned::to_owned("getPricesInWei"),
::std::vec![::ethers::core::abi::ethabi::Function {
name: ::std::borrow::ToOwned::to_owned("getPricesInWei"),
inputs: ::std::vec![],
outputs: ::std::vec![
::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},
::ethers::core::abi::ethabi::Param {
name: ::std::string::String::new(),
kind: ::ethers::core::abi::ethabi::ParamType::Uint(256usize,),
internal_type: ::core::option::Option::Some(
::std::borrow::ToOwned::to_owned("uint256"),
),
},
],
constant: ::core::option::Option::None,
state_mutability: ::ethers::core::abi::ethabi::StateMutability::Pure,
},],
),
]),
events: ::std::collections::BTreeMap::new(),
errors: ::std::collections::BTreeMap::new(),
receive: false,
fallback: false,
}
}
///The parsed JSON ABI of the contract.
pub static GASINFO_ABI: ::ethers::contract::Lazy<::ethers::core::abi::Abi> =
::ethers::contract::Lazy::new(__abi);
#[rustfmt::skip]
const __BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[Pa\x01\xAC\x80a\0 `\09`\0\xF3\xFE`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0LW`\x005`\xE0\x1C\x80c1<\xE5g\x14a\0QW\x80cA\xB2G\xA8\x14a\0gW\x80cI\x94\x8E\x0E\x14a\0\x9BW\x80c\xDE&\xC4\xA1\x14a\0\x9BW[`\0\x80\xFD[`\0[`@Q\x90\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[`\0\x80\x80\x80\x80\x80`@\x80Q\x96\x87R` \x87\x01\x95\x90\x95R\x93\x85\x01\x92\x90\x92R``\x84\x01R`\x80\x83\x01R`\xA0\x82\x01R`\xC0\x01a\0^V[a\0Ta\0\xA96`\x04a\0\xC5V[P`\0\x90V[cNH{q`\xE0\x1B`\0R`A`\x04R`$`\0\xFD[`\0` \x82\x84\x03\x12\x15a\0\xD7W`\0\x80\xFD[\x815g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x80\x82\x11\x15a\0\xEFW`\0\x80\xFD[\x81\x84\x01\x91P\x84`\x1F\x83\x01\x12a\x01\x03W`\0\x80\xFD[\x815\x81\x81\x11\x15a\x01\x15Wa\x01\x15a\0\xAFV[`@Q`\x1F\x82\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x81\x01\x90\x83\x82\x11\x81\x83\x10\x17\x15a\x01=Wa\x01=a\0\xAFV[\x81`@R\x82\x81R\x87` \x84\x87\x01\x01\x11\x15a\x01VW`\0\x80\xFD[\x82` \x86\x01` \x83\x017`\0\x92\x81\x01` \x01\x92\x90\x92RP\x95\x94PPPPPV\xFE\xA2dipfsX\"\x12 AW\x1B/!\x81\xAA^S`A_\xDEtdh\x87d\x9E\xC4\xC54_9\x8D\x0E\xC7\x89\xDD%;\xBEdsolcC\0\x08\r\x003";
/// The bytecode of the contract.
pub static GASINFO_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__BYTECODE);
#[rustfmt::skip]
const __DEPLOYED_BYTECODE: &[u8] = b"`\x80`@R4\x80\x15a\0\x10W`\0\x80\xFD[P`\x046\x10a\0LW`\x005`\xE0\x1C\x80c1<\xE5g\x14a\0QW\x80cA\xB2G\xA8\x14a\0gW\x80cI\x94\x8E\x0E\x14a\0\x9BW\x80c\xDE&\xC4\xA1\x14a\0\x9BW[`\0\x80\xFD[`\0[`@Q\x90\x81R` \x01[`@Q\x80\x91\x03\x90\xF3[`\0\x80\x80\x80\x80\x80`@\x80Q\x96\x87R` \x87\x01\x95\x90\x95R\x93\x85\x01\x92\x90\x92R``\x84\x01R`\x80\x83\x01R`\xA0\x82\x01R`\xC0\x01a\0^V[a\0Ta\0\xA96`\x04a\0\xC5V[P`\0\x90V[cNH{q`\xE0\x1B`\0R`A`\x04R`$`\0\xFD[`\0` \x82\x84\x03\x12\x15a\0\xD7W`\0\x80\xFD[\x815g\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x80\x82\x11\x15a\0\xEFW`\0\x80\xFD[\x81\x84\x01\x91P\x84`\x1F\x83\x01\x12a\x01\x03W`\0\x80\xFD[\x815\x81\x81\x11\x15a\x01\x15Wa\x01\x15a\0\xAFV[`@Q`\x1F\x82\x01`\x1F\x19\x90\x81\x16`?\x01\x16\x81\x01\x90\x83\x82\x11\x81\x83\x10\x17\x15a\x01=Wa\x01=a\0\xAFV[\x81`@R\x82\x81R\x87` \x84\x87\x01\x01\x11\x15a\x01VW`\0\x80\xFD[\x82` \x86\x01` \x83\x017`\0\x92\x81\x01` \x01\x92\x90\x92RP\x95\x94PPPPPV\xFE\xA2dipfsX\"\x12 AW\x1B/!\x81\xAA^S`A_\xDEtdh\x87d\x9E\xC4\xC54_9\x8D\x0E\xC7\x89\xDD%;\xBEdsolcC\0\x08\r\x003";
/// The deployed bytecode of the contract.
pub static GASINFO_DEPLOYED_BYTECODE: ::ethers::core::types::Bytes =
::ethers::core::types::Bytes::from_static(__DEPLOYED_BYTECODE);
pub struct GasInfo<M>(::ethers::contract::Contract<M>);
impl<M> ::core::clone::Clone for GasInfo<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for GasInfo<M> {
type Target = ::ethers::contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for GasInfo<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for GasInfo<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(::core::stringify!(GasInfo))
.field(&self.address())
.finish()
}
}
impl<M: ::ethers::providers::Middleware> GasInfo<M> {
/// Creates a new contract instance with the specified `ethers` client at
/// `address`. The contract derefs to a `ethers::Contract` object.
pub fn new<T: Into<::ethers::core::types::Address>>(
address: T,
client: ::std::sync::Arc<M>,
) -> Self {
Self(::ethers::contract::Contract::new(
address.into(),
GASINFO_ABI.clone(),
client,
))
}
/// Constructs the general purpose `Deployer` instance based on the provided constructor arguments and sends it.
/// Returns a new instance of a deployer that returns an instance of this contract after sending the transaction
///
/// Notes:
/// - If there are no constructor arguments, you should pass `()` as the argument.
/// - The default poll duration is 7 seconds.
/// - The default number of confirmations is 1 block.
///
///
/// # Example
///
/// Generate contract bindings with `abigen!` and deploy a new contract instance.
///
/// *Note*: this requires a `bytecode` and `abi` object in the `greeter.json` artifact.
///
/// ```ignore
/// # async fn deploy<M: ethers::providers::Middleware>(client: ::std::sync::Arc<M>) {
/// abigen!(Greeter, "../greeter.json");
///
/// let greeter_contract = Greeter::deploy(client, "Hello world!".to_string()).unwrap().send().await.unwrap();
/// let msg = greeter_contract.greet().call().await.unwrap();
/// # }
/// ```
pub fn deploy<T: ::ethers::core::abi::Tokenize>(
client: ::std::sync::Arc<M>,
constructor_args: T,
) -> ::core::result::Result<
::ethers::contract::builders::ContractDeployer<M, Self>,
::ethers::contract::ContractError<M>,
> {
let factory = ::ethers::contract::ContractFactory::new(
GASINFO_ABI.clone(),
GASINFO_BYTECODE.clone().into(),
client,
);
let deployer = factory.deploy(constructor_args)?;
let deployer = ::ethers::contract::ContractDeployer::new(deployer);
Ok(deployer)
}
///Calls the contract's `decimals` (0x313ce567) function
pub fn decimals(
&self,
) -> ::ethers::contract::builders::ContractCall<M, ::ethers::core::types::U256> {
self.0
.method_hash([49, 60, 229, 103], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `getL1Fee` (0x49948e0e) function
pub fn get_l1_fee(
&self,
data: ::ethers::core::types::Bytes,
) -> ::ethers::contract::builders::ContractCall<M, ::ethers::core::types::U256> {
self.0
.method_hash([73, 148, 142, 14], data)
.expect("method not found (this should never happen)")
}
///Calls the contract's `getL1GasUsed` (0xde26c4a1) function
pub fn get_l1_gas_used(
&self,
data: ::ethers::core::types::Bytes,
) -> ::ethers::contract::builders::ContractCall<M, ::ethers::core::types::U256> {
self.0
.method_hash([222, 38, 196, 161], data)
.expect("method not found (this should never happen)")
}
///Calls the contract's `getPricesInWei` (0x41b247a8) function
pub fn get_prices_in_wei(
&self,
) -> ::ethers::contract::builders::ContractCall<
M,
(
::ethers::core::types::U256,
::ethers::core::types::U256,
::ethers::core::types::U256,
::ethers::core::types::U256,
::ethers::core::types::U256,
::ethers::core::types::U256,
),
> {
self.0
.method_hash([65, 178, 71, 168], ())
.expect("method not found (this should never happen)")
}
}
impl<M: ::ethers::providers::Middleware> From<::ethers::contract::Contract<M>> for GasInfo<M> {
fn from(contract: ::ethers::contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
}
///Container type for all input parameters for the `decimals` function with signature `decimals()` and selector `0x313ce567`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(name = "decimals", abi = "decimals()")]
pub struct DecimalsCall;
///Container type for all input parameters for the `getL1Fee` function with signature `getL1Fee(bytes)` and selector `0x49948e0e`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(name = "getL1Fee", abi = "getL1Fee(bytes)")]
pub struct GetL1FeeCall {
pub data: ::ethers::core::types::Bytes,
}
///Container type for all input parameters for the `getL1GasUsed` function with signature `getL1GasUsed(bytes)` and selector `0xde26c4a1`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(name = "getL1GasUsed", abi = "getL1GasUsed(bytes)")]
pub struct GetL1GasUsedCall {
pub data: ::ethers::core::types::Bytes,
}
///Container type for all input parameters for the `getPricesInWei` function with signature `getPricesInWei()` and selector `0x41b247a8`
#[derive(
Clone,
::ethers::contract::EthCall,
::ethers::contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
#[ethcall(name = "getPricesInWei", abi = "getPricesInWei()")]
pub struct GetPricesInWeiCall;
///Container type for all of the contract's call
#[derive(Clone, ::ethers::contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum GasInfoCalls {
Decimals(DecimalsCall),
GetL1Fee(GetL1FeeCall),
GetL1GasUsed(GetL1GasUsedCall),
GetPricesInWei(GetPricesInWeiCall),
}
impl ::ethers::core::abi::AbiDecode for GasInfoCalls {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers::core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded) = <DecimalsCall as ::ethers::core::abi::AbiDecode>::decode(data) {
return Ok(Self::Decimals(decoded));
}
if let Ok(decoded) = <GetL1FeeCall as ::ethers::core::abi::AbiDecode>::decode(data) {
return Ok(Self::GetL1Fee(decoded));
}
if let Ok(decoded) = <GetL1GasUsedCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
return Ok(Self::GetL1GasUsed(decoded));
}
if let Ok(decoded) =
<GetPricesInWeiCall as ::ethers::core::abi::AbiDecode>::decode(data)
{
return Ok(Self::GetPricesInWei(decoded));
}
Err(::ethers::core::abi::Error::InvalidData.into())
}
}
impl ::ethers::core::abi::AbiEncode for GasInfoCalls {
fn encode(self) -> Vec<u8> {
match self {
Self::Decimals(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::GetL1Fee(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::GetL1GasUsed(element) => ::ethers::core::abi::AbiEncode::encode(element),
Self::GetPricesInWei(element) => ::ethers::core::abi::AbiEncode::encode(element),
}
}
}
impl ::core::fmt::Display for GasInfoCalls {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::Decimals(element) => ::core::fmt::Display::fmt(element, f),
Self::GetL1Fee(element) => ::core::fmt::Display::fmt(element, f),
Self::GetL1GasUsed(element) => ::core::fmt::Display::fmt(element, f),
Self::GetPricesInWei(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<DecimalsCall> for GasInfoCalls {
fn from(value: DecimalsCall) -> Self {
Self::Decimals(value)
}
}
impl ::core::convert::From<GetL1FeeCall> for GasInfoCalls {
fn from(value: GetL1FeeCall) -> Self {
Self::GetL1Fee(value)
}
}
impl ::core::convert::From<GetL1GasUsedCall> for GasInfoCalls {
fn from(value: GetL1GasUsedCall) -> Self {
Self::GetL1GasUsed(value)
}
}
impl ::core::convert::From<GetPricesInWeiCall> for GasInfoCalls {
fn from(value: GetPricesInWeiCall) -> Self {
Self::GetPricesInWei(value)
}
}
///Container type for all return fields from the `decimals` function with signature `decimals()` and selector `0x313ce567`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct DecimalsReturn(pub ::ethers::core::types::U256);
///Container type for all return fields from the `getL1Fee` function with signature `getL1Fee(bytes)` and selector `0x49948e0e`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct GetL1FeeReturn(pub ::ethers::core::types::U256);
///Container type for all return fields from the `getL1GasUsed` function with signature `getL1GasUsed(bytes)` and selector `0xde26c4a1`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct GetL1GasUsedReturn(pub ::ethers::core::types::U256);
///Container type for all return fields from the `getPricesInWei` function with signature `getPricesInWei()` and selector `0x41b247a8`
#[derive(
Clone,
::ethers::contract::EthAbiType,
::ethers::contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash,
)]
pub struct GetPricesInWeiReturn(
pub ::ethers::core::types::U256,
pub ::ethers::core::types::U256,
pub ::ethers::core::types::U256,
pub ::ethers::core::types::U256,
pub ::ethers::core::types::U256,
pub ::ethers::core::types::U256,
);
}