pub use i_transparent_upgradeable_proxy::*;
/// 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 i_transparent_upgradeable_proxy {
#[rustfmt::skip]
const __ABI: &str = "[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\",\"components\":[],\"indexed\":false},{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"AdminChanged\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"BeaconUpgraded\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"Upgraded\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"changeAdmin\",\"outputs\":[]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"upgradeTo\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\",\"components\":[]}],\"stateMutability\":\"payable\",\"type\":\"function\",\"name\":\"upgradeToAndCall\",\"outputs\":[]}]";
///The parsed JSON ABI of the contract.
pub static ITRANSPARENTUPGRADEABLEPROXY_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 ITransparentUpgradeableProxy<M>(::ethers_contract::Contract<M>);
impl<M> ::core::clone::Clone for ITransparentUpgradeableProxy<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for ITransparentUpgradeableProxy<M> {
type Target = ::ethers_contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for ITransparentUpgradeableProxy<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for ITransparentUpgradeableProxy<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(ITransparentUpgradeableProxy))
.field(&self.address())
.finish()
}
}
impl<M: ::ethers_providers::Middleware> ITransparentUpgradeableProxy<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(),
ITRANSPARENTUPGRADEABLEPROXY_ABI.clone(),
client,
),
)
}
///Calls the contract's `admin` (0xf851a440) function
pub fn admin(
&self,
) -> ::ethers_contract::builders::ContractCall<
M,
::ethers_core::types::Address,
> {
self.0
.method_hash([248, 81, 164, 64], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `changeAdmin` (0x8f283970) function
pub fn change_admin(
&self,
p0: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([143, 40, 57, 112], p0)
.expect("method not found (this should never happen)")
}
///Calls the contract's `implementation` (0x5c60da1b) function
pub fn implementation(
&self,
) -> ::ethers_contract::builders::ContractCall<
M,
::ethers_core::types::Address,
> {
self.0
.method_hash([92, 96, 218, 27], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `upgradeTo` (0x3659cfe6) function
pub fn upgrade_to(
&self,
p0: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([54, 89, 207, 230], p0)
.expect("method not found (this should never happen)")
}
///Calls the contract's `upgradeToAndCall` (0x4f1ef286) function
pub fn upgrade_to_and_call(
&self,
p0: ::ethers_core::types::Address,
p1: ::ethers_core::types::Bytes,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([79, 30, 242, 134], (p0, p1))
.expect("method not found (this should never happen)")
}
///Gets the contract's `AdminChanged` event
pub fn admin_changed_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
AdminChangedFilter,
> {
self.0.event()
}
///Gets the contract's `BeaconUpgraded` event
pub fn beacon_upgraded_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
BeaconUpgradedFilter,
> {
self.0.event()
}
///Gets the contract's `Upgraded` event
pub fn upgraded_filter(
&self,
) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, UpgradedFilter> {
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,
ITransparentUpgradeableProxyEvents,
> {
self.0.event_with_filter(::core::default::Default::default())
}
}
impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
for ITransparentUpgradeableProxy<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 = "AdminChanged", abi = "AdminChanged(address,address)")]
pub struct AdminChangedFilter {
pub previous_admin: ::ethers_core::types::Address,
pub new_admin: ::ethers_core::types::Address,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "BeaconUpgraded", abi = "BeaconUpgraded(address)")]
pub struct BeaconUpgradedFilter {
#[ethevent(indexed)]
pub beacon: ::ethers_core::types::Address,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "Upgraded", abi = "Upgraded(address)")]
pub struct UpgradedFilter {
#[ethevent(indexed)]
pub implementation: ::ethers_core::types::Address,
}
///Container type for all of the contract's events
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum ITransparentUpgradeableProxyEvents {
AdminChangedFilter(AdminChangedFilter),
BeaconUpgradedFilter(BeaconUpgradedFilter),
UpgradedFilter(UpgradedFilter),
}
impl ::ethers_contract::EthLogDecode for ITransparentUpgradeableProxyEvents {
fn decode_log(
log: &::ethers_core::abi::RawLog,
) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
if let Ok(decoded) = AdminChangedFilter::decode_log(log) {
return Ok(
ITransparentUpgradeableProxyEvents::AdminChangedFilter(decoded),
);
}
if let Ok(decoded) = BeaconUpgradedFilter::decode_log(log) {
return Ok(
ITransparentUpgradeableProxyEvents::BeaconUpgradedFilter(decoded),
);
}
if let Ok(decoded) = UpgradedFilter::decode_log(log) {
return Ok(ITransparentUpgradeableProxyEvents::UpgradedFilter(decoded));
}
Err(::ethers_core::abi::Error::InvalidData)
}
}
impl ::core::fmt::Display for ITransparentUpgradeableProxyEvents {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::AdminChangedFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::BeaconUpgradedFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::UpgradedFilter(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<AdminChangedFilter>
for ITransparentUpgradeableProxyEvents {
fn from(value: AdminChangedFilter) -> Self {
Self::AdminChangedFilter(value)
}
}
impl ::core::convert::From<BeaconUpgradedFilter>
for ITransparentUpgradeableProxyEvents {
fn from(value: BeaconUpgradedFilter) -> Self {
Self::BeaconUpgradedFilter(value)
}
}
impl ::core::convert::From<UpgradedFilter> for ITransparentUpgradeableProxyEvents {
fn from(value: UpgradedFilter) -> Self {
Self::UpgradedFilter(value)
}
}
///Container type for all input parameters for the `admin` function with signature `admin()` and selector `0xf851a440`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "admin", abi = "admin()")]
pub struct AdminCall;
///Container type for all input parameters for the `changeAdmin` function with signature `changeAdmin(address)` and selector `0x8f283970`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "changeAdmin", abi = "changeAdmin(address)")]
pub struct ChangeAdminCall(pub ::ethers_core::types::Address);
///Container type for all input parameters for the `implementation` function with signature `implementation()` and selector `0x5c60da1b`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "implementation", abi = "implementation()")]
pub struct ImplementationCall;
///Container type for all input parameters for the `upgradeTo` function with signature `upgradeTo(address)` and selector `0x3659cfe6`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "upgradeTo", abi = "upgradeTo(address)")]
pub struct UpgradeToCall(pub ::ethers_core::types::Address);
///Container type for all input parameters for the `upgradeToAndCall` function with signature `upgradeToAndCall(address,bytes)` and selector `0x4f1ef286`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "upgradeToAndCall", abi = "upgradeToAndCall(address,bytes)")]
pub struct UpgradeToAndCallCall(
pub ::ethers_core::types::Address,
pub ::ethers_core::types::Bytes,
);
///Container type for all of the contract's call
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum ITransparentUpgradeableProxyCalls {
Admin(AdminCall),
ChangeAdmin(ChangeAdminCall),
Implementation(ImplementationCall),
UpgradeTo(UpgradeToCall),
UpgradeToAndCall(UpgradeToAndCallCall),
}
impl ::ethers_core::abi::AbiDecode for ITransparentUpgradeableProxyCalls {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <AdminCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Admin(decoded));
}
if let Ok(decoded)
= <ChangeAdminCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::ChangeAdmin(decoded));
}
if let Ok(decoded)
= <ImplementationCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Implementation(decoded));
}
if let Ok(decoded)
= <UpgradeToCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::UpgradeTo(decoded));
}
if let Ok(decoded)
= <UpgradeToAndCallCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::UpgradeToAndCall(decoded));
}
Err(::ethers_core::abi::Error::InvalidData.into())
}
}
impl ::ethers_core::abi::AbiEncode for ITransparentUpgradeableProxyCalls {
fn encode(self) -> Vec<u8> {
match self {
Self::Admin(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::ChangeAdmin(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Implementation(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::UpgradeTo(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::UpgradeToAndCall(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
}
}
}
impl ::core::fmt::Display for ITransparentUpgradeableProxyCalls {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::Admin(element) => ::core::fmt::Display::fmt(element, f),
Self::ChangeAdmin(element) => ::core::fmt::Display::fmt(element, f),
Self::Implementation(element) => ::core::fmt::Display::fmt(element, f),
Self::UpgradeTo(element) => ::core::fmt::Display::fmt(element, f),
Self::UpgradeToAndCall(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<AdminCall> for ITransparentUpgradeableProxyCalls {
fn from(value: AdminCall) -> Self {
Self::Admin(value)
}
}
impl ::core::convert::From<ChangeAdminCall> for ITransparentUpgradeableProxyCalls {
fn from(value: ChangeAdminCall) -> Self {
Self::ChangeAdmin(value)
}
}
impl ::core::convert::From<ImplementationCall>
for ITransparentUpgradeableProxyCalls {
fn from(value: ImplementationCall) -> Self {
Self::Implementation(value)
}
}
impl ::core::convert::From<UpgradeToCall> for ITransparentUpgradeableProxyCalls {
fn from(value: UpgradeToCall) -> Self {
Self::UpgradeTo(value)
}
}
impl ::core::convert::From<UpgradeToAndCallCall>
for ITransparentUpgradeableProxyCalls {
fn from(value: UpgradeToAndCallCall) -> Self {
Self::UpgradeToAndCall(value)
}
}
///Container type for all return fields from the `admin` function with signature `admin()` and selector `0xf851a440`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct AdminReturn(pub ::ethers_core::types::Address);
///Container type for all return fields from the `implementation` function with signature `implementation()` and selector `0x5c60da1b`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct ImplementationReturn(pub ::ethers_core::types::Address);
}