pub use ownable_2_step::*;
/// 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,
)]
pub mod ownable_2_step {
#[rustfmt::skip]
const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"OwnershipTransferStarted\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"OwnershipTransferred\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"acceptOwnership\",\"outputs\":[]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"pendingOwner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"renounceOwnership\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferOwnership\",\"outputs\":[]}]";
///The parsed JSON ABI of the contract.
pub static OWNABLE2STEP_ABI: ::ethers_contract::Lazy<::ethers_core::abi::Abi> = ::ethers_contract::Lazy::new(||
::ethers_core::utils::__serde_json::from_str(__ABI).expect("ABI is always valid"));
pub struct Ownable2Step<M>(::ethers_contract::Contract<M>);
impl<M> ::core::clone::Clone for Ownable2Step<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for Ownable2Step<M> {
type Target = ::ethers_contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for Ownable2Step<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for Ownable2Step<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(Ownable2Step)).field(&self.address()).finish()
}
}
impl<M: ::ethers_providers::Middleware> Ownable2Step<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(),
OWNABLE2STEP_ABI.clone(),
client,
),
)
}
///Calls the contract's `acceptOwnership` (0x79ba5097) function
pub fn accept_ownership(
&self,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([121, 186, 80, 151], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `owner` (0x8da5cb5b) function
pub fn owner(
&self,
) -> ::ethers_contract::builders::ContractCall<
M,
::ethers_core::types::Address,
> {
self.0
.method_hash([141, 165, 203, 91], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `pendingOwner` (0xe30c3978) function
pub fn pending_owner(
&self,
) -> ::ethers_contract::builders::ContractCall<
M,
::ethers_core::types::Address,
> {
self.0
.method_hash([227, 12, 57, 120], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `renounceOwnership` (0x715018a6) function
pub fn renounce_ownership(
&self,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([113, 80, 24, 166], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `transferOwnership` (0xf2fde38b) function
pub fn transfer_ownership(
&self,
new_owner: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([242, 253, 227, 139], new_owner)
.expect("method not found (this should never happen)")
}
///Gets the contract's `OwnershipTransferStarted` event
pub fn ownership_transfer_started_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
OwnershipTransferStartedFilter,
> {
self.0.event()
}
///Gets the contract's `OwnershipTransferred` event
pub fn ownership_transferred_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
OwnershipTransferredFilter,
> {
self.0.event()
}
/// Returns an `Event` builder for all the events of this contract.
pub fn events(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
Ownable2StepEvents,
> {
self.0.event_with_filter(::core::default::Default::default())
}
}
impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
for Ownable2Step<M> {
fn from(contract: ::ethers_contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(
name = "OwnershipTransferStarted",
abi = "OwnershipTransferStarted(address,address)"
)]
pub struct OwnershipTransferStartedFilter {
#[ethevent(indexed)]
pub previous_owner: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub new_owner: ::ethers_core::types::Address,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(
name = "OwnershipTransferred",
abi = "OwnershipTransferred(address,address)"
)]
pub struct OwnershipTransferredFilter {
#[ethevent(indexed)]
pub previous_owner: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub new_owner: ::ethers_core::types::Address,
}
///Container type for all of the contract's events
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum Ownable2StepEvents {
OwnershipTransferStartedFilter(OwnershipTransferStartedFilter),
OwnershipTransferredFilter(OwnershipTransferredFilter),
}
impl ::ethers_contract::EthLogDecode for Ownable2StepEvents {
fn decode_log(
log: &::ethers_core::abi::RawLog,
) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
if let Ok(decoded) = OwnershipTransferStartedFilter::decode_log(log) {
return Ok(Ownable2StepEvents::OwnershipTransferStartedFilter(decoded));
}
if let Ok(decoded) = OwnershipTransferredFilter::decode_log(log) {
return Ok(Ownable2StepEvents::OwnershipTransferredFilter(decoded));
}
Err(::ethers_core::abi::Error::InvalidData)
}
}
impl ::core::fmt::Display for Ownable2StepEvents {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::OwnershipTransferStartedFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::OwnershipTransferredFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
}
}
}
impl ::core::convert::From<OwnershipTransferStartedFilter> for Ownable2StepEvents {
fn from(value: OwnershipTransferStartedFilter) -> Self {
Self::OwnershipTransferStartedFilter(value)
}
}
impl ::core::convert::From<OwnershipTransferredFilter> for Ownable2StepEvents {
fn from(value: OwnershipTransferredFilter) -> Self {
Self::OwnershipTransferredFilter(value)
}
}
///Container type for all input parameters for the `acceptOwnership` function with signature `acceptOwnership()` and selector `0x79ba5097`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "acceptOwnership", abi = "acceptOwnership()")]
pub struct AcceptOwnershipCall;
///Container type for all input parameters for the `owner` function with signature `owner()` and selector `0x8da5cb5b`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "owner", abi = "owner()")]
pub struct OwnerCall;
///Container type for all input parameters for the `pendingOwner` function with signature `pendingOwner()` and selector `0xe30c3978`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "pendingOwner", abi = "pendingOwner()")]
pub struct PendingOwnerCall;
///Container type for all input parameters for the `renounceOwnership` function with signature `renounceOwnership()` and selector `0x715018a6`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "renounceOwnership", abi = "renounceOwnership()")]
pub struct RenounceOwnershipCall;
///Container type for all input parameters for the `transferOwnership` function with signature `transferOwnership(address)` and selector `0xf2fde38b`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "transferOwnership", abi = "transferOwnership(address)")]
pub struct TransferOwnershipCall {
pub new_owner: ::ethers_core::types::Address,
}
///Container type for all of the contract's call
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum Ownable2StepCalls {
AcceptOwnership(AcceptOwnershipCall),
Owner(OwnerCall),
PendingOwner(PendingOwnerCall),
RenounceOwnership(RenounceOwnershipCall),
TransferOwnership(TransferOwnershipCall),
}
impl ::ethers_core::abi::AbiDecode for Ownable2StepCalls {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <AcceptOwnershipCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::AcceptOwnership(decoded));
}
if let Ok(decoded)
= <OwnerCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Owner(decoded));
}
if let Ok(decoded)
= <PendingOwnerCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::PendingOwner(decoded));
}
if let Ok(decoded)
= <RenounceOwnershipCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::RenounceOwnership(decoded));
}
if let Ok(decoded)
= <TransferOwnershipCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::TransferOwnership(decoded));
}
Err(::ethers_core::abi::Error::InvalidData.into())
}
}
impl ::ethers_core::abi::AbiEncode for Ownable2StepCalls {
fn encode(self) -> Vec<u8> {
match self {
Self::AcceptOwnership(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Owner(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::PendingOwner(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::RenounceOwnership(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::TransferOwnership(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
}
}
}
impl ::core::fmt::Display for Ownable2StepCalls {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::AcceptOwnership(element) => ::core::fmt::Display::fmt(element, f),
Self::Owner(element) => ::core::fmt::Display::fmt(element, f),
Self::PendingOwner(element) => ::core::fmt::Display::fmt(element, f),
Self::RenounceOwnership(element) => ::core::fmt::Display::fmt(element, f),
Self::TransferOwnership(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<AcceptOwnershipCall> for Ownable2StepCalls {
fn from(value: AcceptOwnershipCall) -> Self {
Self::AcceptOwnership(value)
}
}
impl ::core::convert::From<OwnerCall> for Ownable2StepCalls {
fn from(value: OwnerCall) -> Self {
Self::Owner(value)
}
}
impl ::core::convert::From<PendingOwnerCall> for Ownable2StepCalls {
fn from(value: PendingOwnerCall) -> Self {
Self::PendingOwner(value)
}
}
impl ::core::convert::From<RenounceOwnershipCall> for Ownable2StepCalls {
fn from(value: RenounceOwnershipCall) -> Self {
Self::RenounceOwnership(value)
}
}
impl ::core::convert::From<TransferOwnershipCall> for Ownable2StepCalls {
fn from(value: TransferOwnershipCall) -> Self {
Self::TransferOwnership(value)
}
}
///Container type for all return fields from the `owner` function with signature `owner()` and selector `0x8da5cb5b`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct OwnerReturn(pub ::ethers_core::types::Address);
///Container type for all return fields from the `pendingOwner` function with signature `pendingOwner()` and selector `0xe30c3978`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct PendingOwnerReturn(pub ::ethers_core::types::Address);
}