pub use erc20_permit::*;
/// 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 erc20_permit {
#[rustfmt::skip]
const __ABI: &str = "[{\"inputs\":[],\"type\":\"error\",\"name\":\"InvalidShortString\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"str\",\"type\":\"string\",\"components\":[]}],\"type\":\"error\",\"name\":\"StringTooLong\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Approval\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[],\"type\":\"event\",\"name\":\"EIP712DomainChanged\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"Transfer\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"DOMAIN_SEPARATOR\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"allowance\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"approve\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"decimals\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"subtractedValue\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"decreaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"eip712Domain\",\"outputs\":[{\"internalType\":\"bytes1\",\"name\":\"fields\",\"type\":\"bytes1\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"verifyingContract\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"salt\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"uint256[]\",\"name\":\"extensions\",\"type\":\"uint256[]\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"addedValue\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"increaseAllowance\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"name\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"nonces\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"spender\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"deadline\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint8\",\"name\":\"v\",\"type\":\"uint8\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"r\",\"type\":\"bytes32\",\"components\":[]},{\"internalType\":\"bytes32\",\"name\":\"s\",\"type\":\"bytes32\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"permit\",\"outputs\":[]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"symbol\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"totalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transfer\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"transferFrom\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\",\"components\":[]}]}]";
///The parsed JSON ABI of the contract.
pub static ERC20PERMIT_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 ERC20Permit<M>(::ethers_contract::Contract<M>);
impl<M> ::core::clone::Clone for ERC20Permit<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for ERC20Permit<M> {
type Target = ::ethers_contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for ERC20Permit<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for ERC20Permit<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(ERC20Permit)).field(&self.address()).finish()
}
}
impl<M: ::ethers_providers::Middleware> ERC20Permit<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(),
ERC20PERMIT_ABI.clone(),
client,
),
)
}
///Calls the contract's `DOMAIN_SEPARATOR` (0x3644e515) function
pub fn domain_separator(
&self,
) -> ::ethers_contract::builders::ContractCall<M, [u8; 32]> {
self.0
.method_hash([54, 68, 229, 21], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `allowance` (0xdd62ed3e) function
pub fn allowance(
&self,
owner: ::ethers_core::types::Address,
spender: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([221, 98, 237, 62], (owner, spender))
.expect("method not found (this should never happen)")
}
///Calls the contract's `approve` (0x095ea7b3) function
pub fn approve(
&self,
spender: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([9, 94, 167, 179], (spender, amount))
.expect("method not found (this should never happen)")
}
///Calls the contract's `balanceOf` (0x70a08231) function
pub fn balance_of(
&self,
account: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([112, 160, 130, 49], account)
.expect("method not found (this should never happen)")
}
///Calls the contract's `decimals` (0x313ce567) function
pub fn decimals(&self) -> ::ethers_contract::builders::ContractCall<M, u8> {
self.0
.method_hash([49, 60, 229, 103], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `decreaseAllowance` (0xa457c2d7) function
pub fn decrease_allowance(
&self,
spender: ::ethers_core::types::Address,
subtracted_value: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([164, 87, 194, 215], (spender, subtracted_value))
.expect("method not found (this should never happen)")
}
///Calls the contract's `eip712Domain` (0x84b0196e) function
pub fn eip_712_domain(
&self,
) -> ::ethers_contract::builders::ContractCall<
M,
(
[u8; 1],
::std::string::String,
::std::string::String,
::ethers_core::types::U256,
::ethers_core::types::Address,
[u8; 32],
::std::vec::Vec<::ethers_core::types::U256>,
),
> {
self.0
.method_hash([132, 176, 25, 110], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `increaseAllowance` (0x39509351) function
pub fn increase_allowance(
&self,
spender: ::ethers_core::types::Address,
added_value: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([57, 80, 147, 81], (spender, added_value))
.expect("method not found (this should never happen)")
}
///Calls the contract's `name` (0x06fdde03) function
pub fn name(
&self,
) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
self.0
.method_hash([6, 253, 222, 3], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `nonces` (0x7ecebe00) function
pub fn nonces(
&self,
owner: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([126, 206, 190, 0], owner)
.expect("method not found (this should never happen)")
}
///Calls the contract's `permit` (0xd505accf) function
pub fn permit(
&self,
owner: ::ethers_core::types::Address,
spender: ::ethers_core::types::Address,
value: ::ethers_core::types::U256,
deadline: ::ethers_core::types::U256,
v: u8,
r: [u8; 32],
s: [u8; 32],
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash(
[213, 5, 172, 207],
(owner, spender, value, deadline, v, r, s),
)
.expect("method not found (this should never happen)")
}
///Calls the contract's `symbol` (0x95d89b41) function
pub fn symbol(
&self,
) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
self.0
.method_hash([149, 216, 155, 65], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `totalSupply` (0x18160ddd) function
pub fn total_supply(
&self,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([24, 22, 13, 221], ())
.expect("method not found (this should never happen)")
}
///Calls the contract's `transfer` (0xa9059cbb) function
pub fn transfer(
&self,
to: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([169, 5, 156, 187], (to, amount))
.expect("method not found (this should never happen)")
}
///Calls the contract's `transferFrom` (0x23b872dd) function
pub fn transfer_from(
&self,
from: ::ethers_core::types::Address,
to: ::ethers_core::types::Address,
amount: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, bool> {
self.0
.method_hash([35, 184, 114, 221], (from, to, amount))
.expect("method not found (this should never happen)")
}
///Gets the contract's `Approval` event
pub fn approval_filter(
&self,
) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, ApprovalFilter> {
self.0.event()
}
///Gets the contract's `EIP712DomainChanged` event
pub fn eip712_domain_changed_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
Eip712DomainChangedFilter,
> {
self.0.event()
}
///Gets the contract's `Transfer` event
pub fn transfer_filter(
&self,
) -> ::ethers_contract::builders::Event<::std::sync::Arc<M>, M, TransferFilter> {
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,
ERC20PermitEvents,
> {
self.0.event_with_filter(::core::default::Default::default())
}
}
impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
for ERC20Permit<M> {
fn from(contract: ::ethers_contract::Contract<M>) -> Self {
Self::new(contract.address(), contract.client())
}
}
///Custom Error type `InvalidShortString` with signature `InvalidShortString()` and selector `0xb3512b0c`
#[derive(
Clone,
::ethers_contract::EthError,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[etherror(name = "InvalidShortString", abi = "InvalidShortString()")]
pub struct InvalidShortString;
///Custom Error type `StringTooLong` with signature `StringTooLong(string)` and selector `0x305a27a9`
#[derive(
Clone,
::ethers_contract::EthError,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[etherror(name = "StringTooLong", abi = "StringTooLong(string)")]
pub struct StringTooLong {
pub str: ::std::string::String,
}
///Container type for all of the contract's custom errors
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum ERC20PermitErrors {
InvalidShortString(InvalidShortString),
StringTooLong(StringTooLong),
/// The standard solidity revert string, with selector
/// Error(string) -- 0x08c379a0
RevertString(::std::string::String),
}
impl ::ethers_core::abi::AbiDecode for ERC20PermitErrors {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <::std::string::String as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::RevertString(decoded));
}
if let Ok(decoded)
= <InvalidShortString as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::InvalidShortString(decoded));
}
if let Ok(decoded)
= <StringTooLong as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::StringTooLong(decoded));
}
Err(::ethers_core::abi::Error::InvalidData.into())
}
}
impl ::ethers_core::abi::AbiEncode for ERC20PermitErrors {
fn encode(self) -> ::std::vec::Vec<u8> {
match self {
Self::InvalidShortString(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::StringTooLong(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::RevertString(s) => ::ethers_core::abi::AbiEncode::encode(s),
}
}
}
impl ::ethers_contract::ContractRevert for ERC20PermitErrors {
fn valid_selector(selector: [u8; 4]) -> bool {
match selector {
[0x08, 0xc3, 0x79, 0xa0] => true,
_ if selector
== <InvalidShortString as ::ethers_contract::EthError>::selector() => {
true
}
_ if selector
== <StringTooLong as ::ethers_contract::EthError>::selector() => true,
_ => false,
}
}
}
impl ::core::fmt::Display for ERC20PermitErrors {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::InvalidShortString(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::StringTooLong(element) => ::core::fmt::Display::fmt(element, f),
Self::RevertString(s) => ::core::fmt::Display::fmt(s, f),
}
}
}
impl ::core::convert::From<::std::string::String> for ERC20PermitErrors {
fn from(value: String) -> Self {
Self::RevertString(value)
}
}
impl ::core::convert::From<InvalidShortString> for ERC20PermitErrors {
fn from(value: InvalidShortString) -> Self {
Self::InvalidShortString(value)
}
}
impl ::core::convert::From<StringTooLong> for ERC20PermitErrors {
fn from(value: StringTooLong) -> Self {
Self::StringTooLong(value)
}
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "Approval", abi = "Approval(address,address,uint256)")]
pub struct ApprovalFilter {
#[ethevent(indexed)]
pub owner: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub spender: ::ethers_core::types::Address,
pub value: ::ethers_core::types::U256,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "EIP712DomainChanged", abi = "EIP712DomainChanged()")]
pub struct Eip712DomainChangedFilter;
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(name = "Transfer", abi = "Transfer(address,address,uint256)")]
pub struct TransferFilter {
#[ethevent(indexed)]
pub from: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub to: ::ethers_core::types::Address,
pub value: ::ethers_core::types::U256,
}
///Container type for all of the contract's events
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum ERC20PermitEvents {
ApprovalFilter(ApprovalFilter),
Eip712DomainChangedFilter(Eip712DomainChangedFilter),
TransferFilter(TransferFilter),
}
impl ::ethers_contract::EthLogDecode for ERC20PermitEvents {
fn decode_log(
log: &::ethers_core::abi::RawLog,
) -> ::core::result::Result<Self, ::ethers_core::abi::Error> {
if let Ok(decoded) = ApprovalFilter::decode_log(log) {
return Ok(ERC20PermitEvents::ApprovalFilter(decoded));
}
if let Ok(decoded) = Eip712DomainChangedFilter::decode_log(log) {
return Ok(ERC20PermitEvents::Eip712DomainChangedFilter(decoded));
}
if let Ok(decoded) = TransferFilter::decode_log(log) {
return Ok(ERC20PermitEvents::TransferFilter(decoded));
}
Err(::ethers_core::abi::Error::InvalidData)
}
}
impl ::core::fmt::Display for ERC20PermitEvents {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
Self::Eip712DomainChangedFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::TransferFilter(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<ApprovalFilter> for ERC20PermitEvents {
fn from(value: ApprovalFilter) -> Self {
Self::ApprovalFilter(value)
}
}
impl ::core::convert::From<Eip712DomainChangedFilter> for ERC20PermitEvents {
fn from(value: Eip712DomainChangedFilter) -> Self {
Self::Eip712DomainChangedFilter(value)
}
}
impl ::core::convert::From<TransferFilter> for ERC20PermitEvents {
fn from(value: TransferFilter) -> Self {
Self::TransferFilter(value)
}
}
///Container type for all input parameters for the `DOMAIN_SEPARATOR` function with signature `DOMAIN_SEPARATOR()` and selector `0x3644e515`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "DOMAIN_SEPARATOR", abi = "DOMAIN_SEPARATOR()")]
pub struct DomainSeparatorCall;
///Container type for all input parameters for the `allowance` function with signature `allowance(address,address)` and selector `0xdd62ed3e`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "allowance", abi = "allowance(address,address)")]
pub struct AllowanceCall {
pub owner: ::ethers_core::types::Address,
pub spender: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `approve` function with signature `approve(address,uint256)` and selector `0x095ea7b3`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "approve", abi = "approve(address,uint256)")]
pub struct ApproveCall {
pub spender: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `balanceOf` function with signature `balanceOf(address)` and selector `0x70a08231`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "balanceOf", abi = "balanceOf(address)")]
pub struct BalanceOfCall {
pub account: ::ethers_core::types::Address,
}
///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 `decreaseAllowance` function with signature `decreaseAllowance(address,uint256)` and selector `0xa457c2d7`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "decreaseAllowance", abi = "decreaseAllowance(address,uint256)")]
pub struct DecreaseAllowanceCall {
pub spender: ::ethers_core::types::Address,
pub subtracted_value: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `eip712Domain` function with signature `eip712Domain()` and selector `0x84b0196e`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "eip712Domain", abi = "eip712Domain()")]
pub struct Eip712DomainCall;
///Container type for all input parameters for the `increaseAllowance` function with signature `increaseAllowance(address,uint256)` and selector `0x39509351`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "increaseAllowance", abi = "increaseAllowance(address,uint256)")]
pub struct IncreaseAllowanceCall {
pub spender: ::ethers_core::types::Address,
pub added_value: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `name` function with signature `name()` and selector `0x06fdde03`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "name", abi = "name()")]
pub struct NameCall;
///Container type for all input parameters for the `nonces` function with signature `nonces(address)` and selector `0x7ecebe00`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "nonces", abi = "nonces(address)")]
pub struct NoncesCall {
pub owner: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `permit` function with signature `permit(address,address,uint256,uint256,uint8,bytes32,bytes32)` and selector `0xd505accf`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(
name = "permit",
abi = "permit(address,address,uint256,uint256,uint8,bytes32,bytes32)"
)]
pub struct PermitCall {
pub owner: ::ethers_core::types::Address,
pub spender: ::ethers_core::types::Address,
pub value: ::ethers_core::types::U256,
pub deadline: ::ethers_core::types::U256,
pub v: u8,
pub r: [u8; 32],
pub s: [u8; 32],
}
///Container type for all input parameters for the `symbol` function with signature `symbol()` and selector `0x95d89b41`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "symbol", abi = "symbol()")]
pub struct SymbolCall;
///Container type for all input parameters for the `totalSupply` function with signature `totalSupply()` and selector `0x18160ddd`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "totalSupply", abi = "totalSupply()")]
pub struct TotalSupplyCall;
///Container type for all input parameters for the `transfer` function with signature `transfer(address,uint256)` and selector `0xa9059cbb`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "transfer", abi = "transfer(address,uint256)")]
pub struct TransferCall {
pub to: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `transferFrom` function with signature `transferFrom(address,address,uint256)` and selector `0x23b872dd`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "transferFrom", abi = "transferFrom(address,address,uint256)")]
pub struct TransferFromCall {
pub from: ::ethers_core::types::Address,
pub to: ::ethers_core::types::Address,
pub amount: ::ethers_core::types::U256,
}
///Container type for all of the contract's call
#[derive(Clone, ::ethers_contract::EthAbiType, Debug, PartialEq, Eq, Hash)]
pub enum ERC20PermitCalls {
DomainSeparator(DomainSeparatorCall),
Allowance(AllowanceCall),
Approve(ApproveCall),
BalanceOf(BalanceOfCall),
Decimals(DecimalsCall),
DecreaseAllowance(DecreaseAllowanceCall),
Eip712Domain(Eip712DomainCall),
IncreaseAllowance(IncreaseAllowanceCall),
Name(NameCall),
Nonces(NoncesCall),
Permit(PermitCall),
Symbol(SymbolCall),
TotalSupply(TotalSupplyCall),
Transfer(TransferCall),
TransferFrom(TransferFromCall),
}
impl ::ethers_core::abi::AbiDecode for ERC20PermitCalls {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <DomainSeparatorCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::DomainSeparator(decoded));
}
if let Ok(decoded)
= <AllowanceCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Allowance(decoded));
}
if let Ok(decoded)
= <ApproveCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Approve(decoded));
}
if let Ok(decoded)
= <BalanceOfCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::BalanceOf(decoded));
}
if let Ok(decoded)
= <DecimalsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Decimals(decoded));
}
if let Ok(decoded)
= <DecreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::DecreaseAllowance(decoded));
}
if let Ok(decoded)
= <Eip712DomainCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Eip712Domain(decoded));
}
if let Ok(decoded)
= <IncreaseAllowanceCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::IncreaseAllowance(decoded));
}
if let Ok(decoded)
= <NameCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Name(decoded));
}
if let Ok(decoded)
= <NoncesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Nonces(decoded));
}
if let Ok(decoded)
= <PermitCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Permit(decoded));
}
if let Ok(decoded)
= <SymbolCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Symbol(decoded));
}
if let Ok(decoded)
= <TotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::TotalSupply(decoded));
}
if let Ok(decoded)
= <TransferCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Transfer(decoded));
}
if let Ok(decoded)
= <TransferFromCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::TransferFrom(decoded));
}
Err(::ethers_core::abi::Error::InvalidData.into())
}
}
impl ::ethers_core::abi::AbiEncode for ERC20PermitCalls {
fn encode(self) -> Vec<u8> {
match self {
Self::DomainSeparator(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Allowance(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Approve(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::BalanceOf(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Decimals(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::DecreaseAllowance(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Eip712Domain(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::IncreaseAllowance(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Name(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::Nonces(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::Permit(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::Symbol(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::TotalSupply(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Transfer(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::TransferFrom(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
}
}
}
impl ::core::fmt::Display for ERC20PermitCalls {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::DomainSeparator(element) => ::core::fmt::Display::fmt(element, f),
Self::Allowance(element) => ::core::fmt::Display::fmt(element, f),
Self::Approve(element) => ::core::fmt::Display::fmt(element, f),
Self::BalanceOf(element) => ::core::fmt::Display::fmt(element, f),
Self::Decimals(element) => ::core::fmt::Display::fmt(element, f),
Self::DecreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
Self::Eip712Domain(element) => ::core::fmt::Display::fmt(element, f),
Self::IncreaseAllowance(element) => ::core::fmt::Display::fmt(element, f),
Self::Name(element) => ::core::fmt::Display::fmt(element, f),
Self::Nonces(element) => ::core::fmt::Display::fmt(element, f),
Self::Permit(element) => ::core::fmt::Display::fmt(element, f),
Self::Symbol(element) => ::core::fmt::Display::fmt(element, f),
Self::TotalSupply(element) => ::core::fmt::Display::fmt(element, f),
Self::Transfer(element) => ::core::fmt::Display::fmt(element, f),
Self::TransferFrom(element) => ::core::fmt::Display::fmt(element, f),
}
}
}
impl ::core::convert::From<DomainSeparatorCall> for ERC20PermitCalls {
fn from(value: DomainSeparatorCall) -> Self {
Self::DomainSeparator(value)
}
}
impl ::core::convert::From<AllowanceCall> for ERC20PermitCalls {
fn from(value: AllowanceCall) -> Self {
Self::Allowance(value)
}
}
impl ::core::convert::From<ApproveCall> for ERC20PermitCalls {
fn from(value: ApproveCall) -> Self {
Self::Approve(value)
}
}
impl ::core::convert::From<BalanceOfCall> for ERC20PermitCalls {
fn from(value: BalanceOfCall) -> Self {
Self::BalanceOf(value)
}
}
impl ::core::convert::From<DecimalsCall> for ERC20PermitCalls {
fn from(value: DecimalsCall) -> Self {
Self::Decimals(value)
}
}
impl ::core::convert::From<DecreaseAllowanceCall> for ERC20PermitCalls {
fn from(value: DecreaseAllowanceCall) -> Self {
Self::DecreaseAllowance(value)
}
}
impl ::core::convert::From<Eip712DomainCall> for ERC20PermitCalls {
fn from(value: Eip712DomainCall) -> Self {
Self::Eip712Domain(value)
}
}
impl ::core::convert::From<IncreaseAllowanceCall> for ERC20PermitCalls {
fn from(value: IncreaseAllowanceCall) -> Self {
Self::IncreaseAllowance(value)
}
}
impl ::core::convert::From<NameCall> for ERC20PermitCalls {
fn from(value: NameCall) -> Self {
Self::Name(value)
}
}
impl ::core::convert::From<NoncesCall> for ERC20PermitCalls {
fn from(value: NoncesCall) -> Self {
Self::Nonces(value)
}
}
impl ::core::convert::From<PermitCall> for ERC20PermitCalls {
fn from(value: PermitCall) -> Self {
Self::Permit(value)
}
}
impl ::core::convert::From<SymbolCall> for ERC20PermitCalls {
fn from(value: SymbolCall) -> Self {
Self::Symbol(value)
}
}
impl ::core::convert::From<TotalSupplyCall> for ERC20PermitCalls {
fn from(value: TotalSupplyCall) -> Self {
Self::TotalSupply(value)
}
}
impl ::core::convert::From<TransferCall> for ERC20PermitCalls {
fn from(value: TransferCall) -> Self {
Self::Transfer(value)
}
}
impl ::core::convert::From<TransferFromCall> for ERC20PermitCalls {
fn from(value: TransferFromCall) -> Self {
Self::TransferFrom(value)
}
}
///Container type for all return fields from the `DOMAIN_SEPARATOR` function with signature `DOMAIN_SEPARATOR()` and selector `0x3644e515`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct DomainSeparatorReturn(pub [u8; 32]);
///Container type for all return fields from the `allowance` function with signature `allowance(address,address)` and selector `0xdd62ed3e`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct AllowanceReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `approve` function with signature `approve(address,uint256)` and selector `0x095ea7b3`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct ApproveReturn(pub bool);
///Container type for all return fields from the `balanceOf` function with signature `balanceOf(address)` and selector `0x70a08231`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct BalanceOfReturn(pub ::ethers_core::types::U256);
///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 u8);
///Container type for all return fields from the `decreaseAllowance` function with signature `decreaseAllowance(address,uint256)` and selector `0xa457c2d7`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct DecreaseAllowanceReturn(pub bool);
///Container type for all return fields from the `eip712Domain` function with signature `eip712Domain()` and selector `0x84b0196e`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct Eip712DomainReturn {
pub fields: [u8; 1],
pub name: ::std::string::String,
pub version: ::std::string::String,
pub chain_id: ::ethers_core::types::U256,
pub verifying_contract: ::ethers_core::types::Address,
pub salt: [u8; 32],
pub extensions: ::std::vec::Vec<::ethers_core::types::U256>,
}
///Container type for all return fields from the `increaseAllowance` function with signature `increaseAllowance(address,uint256)` and selector `0x39509351`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct IncreaseAllowanceReturn(pub bool);
///Container type for all return fields from the `name` function with signature `name()` and selector `0x06fdde03`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct NameReturn(pub ::std::string::String);
///Container type for all return fields from the `nonces` function with signature `nonces(address)` and selector `0x7ecebe00`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct NoncesReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `symbol` function with signature `symbol()` and selector `0x95d89b41`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct SymbolReturn(pub ::std::string::String);
///Container type for all return fields from the `totalSupply` function with signature `totalSupply()` and selector `0x18160ddd`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TotalSupplyReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `transfer` function with signature `transfer(address,uint256)` and selector `0xa9059cbb`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TransferReturn(pub bool);
///Container type for all return fields from the `transferFrom` function with signature `transferFrom(address,address,uint256)` and selector `0x23b872dd`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct TransferFromReturn(pub bool);
}