pub use erc20_votes_comp::*;
/// 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_votes_comp {
#[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\":[{\"internalType\":\"address\",\"name\":\"delegator\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"fromDelegate\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"address\",\"name\":\"toDelegate\",\"type\":\"address\",\"components\":[],\"indexed\":true}],\"type\":\"event\",\"name\":\"DelegateChanged\",\"outputs\":[],\"anonymous\":false},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegate\",\"type\":\"address\",\"components\":[],\"indexed\":true},{\"internalType\":\"uint256\",\"name\":\"previousBalance\",\"type\":\"uint256\",\"components\":[],\"indexed\":false},{\"internalType\":\"uint256\",\"name\":\"newBalance\",\"type\":\"uint256\",\"components\":[],\"indexed\":false}],\"type\":\"event\",\"name\":\"DelegateVotesChanged\",\"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\":\"CLOCK_MODE\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\",\"components\":[]}]},{\"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\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint32\",\"name\":\"pos\",\"type\":\"uint32\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"checkpoints\",\"outputs\":[{\"internalType\":\"struct ERC20Votes.Checkpoint\",\"name\":\"\",\"type\":\"tuple\",\"components\":[{\"internalType\":\"uint32\",\"name\":\"fromBlock\",\"type\":\"uint32\",\"components\":[]},{\"internalType\":\"uint224\",\"name\":\"votes\",\"type\":\"uint224\",\"components\":[]}]}]},{\"inputs\":[],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"clock\",\"outputs\":[{\"internalType\":\"uint48\",\"name\":\"\",\"type\":\"uint48\",\"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\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"nonpayable\",\"type\":\"function\",\"name\":\"delegate\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"delegatee\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"nonce\",\"type\":\"uint256\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"expiry\",\"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\":\"delegateBySig\",\"outputs\":[]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"delegates\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\",\"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\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getCurrentVotes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getPastTotalSupply\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"timepoint\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getPastVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]},{\"internalType\":\"uint256\",\"name\":\"blockNumber\",\"type\":\"uint256\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getPriorVotes\",\"outputs\":[{\"internalType\":\"uint96\",\"name\":\"\",\"type\":\"uint96\",\"components\":[]}]},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"getVotes\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"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\":\"account\",\"type\":\"address\",\"components\":[]}],\"stateMutability\":\"view\",\"type\":\"function\",\"name\":\"numCheckpoints\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\",\"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 ERC20VOTESCOMP_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 ERC20VotesComp<M>(::ethers_contract::Contract<M>);
impl<M> ::core::clone::Clone for ERC20VotesComp<M> {
fn clone(&self) -> Self {
Self(::core::clone::Clone::clone(&self.0))
}
}
impl<M> ::core::ops::Deref for ERC20VotesComp<M> {
type Target = ::ethers_contract::Contract<M>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<M> ::core::ops::DerefMut for ERC20VotesComp<M> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
impl<M> ::core::fmt::Debug for ERC20VotesComp<M> {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
f.debug_tuple(stringify!(ERC20VotesComp)).field(&self.address()).finish()
}
}
impl<M: ::ethers_providers::Middleware> ERC20VotesComp<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(),
ERC20VOTESCOMP_ABI.clone(),
client,
),
)
}
///Calls the contract's `CLOCK_MODE` (0x4bf5d7e9) function
pub fn clock_mode(
&self,
) -> ::ethers_contract::builders::ContractCall<M, ::std::string::String> {
self.0
.method_hash([75, 245, 215, 233], ())
.expect("method not found (this should never happen)")
}
///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 `checkpoints` (0xf1127ed8) function
pub fn checkpoints(
&self,
account: ::ethers_core::types::Address,
pos: u32,
) -> ::ethers_contract::builders::ContractCall<M, Checkpoint> {
self.0
.method_hash([241, 18, 126, 216], (account, pos))
.expect("method not found (this should never happen)")
}
///Calls the contract's `clock` (0x91ddadf4) function
pub fn clock(&self) -> ::ethers_contract::builders::ContractCall<M, u64> {
self.0
.method_hash([145, 221, 173, 244], ())
.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 `delegate` (0x5c19a95c) function
pub fn delegate(
&self,
delegatee: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([92, 25, 169, 92], delegatee)
.expect("method not found (this should never happen)")
}
///Calls the contract's `delegateBySig` (0xc3cda520) function
pub fn delegate_by_sig(
&self,
delegatee: ::ethers_core::types::Address,
nonce: ::ethers_core::types::U256,
expiry: ::ethers_core::types::U256,
v: u8,
r: [u8; 32],
s: [u8; 32],
) -> ::ethers_contract::builders::ContractCall<M, ()> {
self.0
.method_hash([195, 205, 165, 32], (delegatee, nonce, expiry, v, r, s))
.expect("method not found (this should never happen)")
}
///Calls the contract's `delegates` (0x587cde1e) function
pub fn delegates(
&self,
account: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<
M,
::ethers_core::types::Address,
> {
self.0
.method_hash([88, 124, 222, 30], account)
.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 `getCurrentVotes` (0xb4b5ea57) function
pub fn get_current_votes(
&self,
account: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, u128> {
self.0
.method_hash([180, 181, 234, 87], account)
.expect("method not found (this should never happen)")
}
///Calls the contract's `getPastTotalSupply` (0x8e539e8c) function
pub fn get_past_total_supply(
&self,
timepoint: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([142, 83, 158, 140], timepoint)
.expect("method not found (this should never happen)")
}
///Calls the contract's `getPastVotes` (0x3a46b1a8) function
pub fn get_past_votes(
&self,
account: ::ethers_core::types::Address,
timepoint: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([58, 70, 177, 168], (account, timepoint))
.expect("method not found (this should never happen)")
}
///Calls the contract's `getPriorVotes` (0x782d6fe1) function
pub fn get_prior_votes(
&self,
account: ::ethers_core::types::Address,
block_number: ::ethers_core::types::U256,
) -> ::ethers_contract::builders::ContractCall<M, u128> {
self.0
.method_hash([120, 45, 111, 225], (account, block_number))
.expect("method not found (this should never happen)")
}
///Calls the contract's `getVotes` (0x9ab24eb0) function
pub fn get_votes(
&self,
account: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, ::ethers_core::types::U256> {
self.0
.method_hash([154, 178, 78, 176], account)
.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 `numCheckpoints` (0x6fcfff45) function
pub fn num_checkpoints(
&self,
account: ::ethers_core::types::Address,
) -> ::ethers_contract::builders::ContractCall<M, u32> {
self.0
.method_hash([111, 207, 255, 69], account)
.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 `DelegateChanged` event
pub fn delegate_changed_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
DelegateChangedFilter,
> {
self.0.event()
}
///Gets the contract's `DelegateVotesChanged` event
pub fn delegate_votes_changed_filter(
&self,
) -> ::ethers_contract::builders::Event<
::std::sync::Arc<M>,
M,
DelegateVotesChangedFilter,
> {
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,
ERC20VotesCompEvents,
> {
self.0.event_with_filter(::core::default::Default::default())
}
}
impl<M: ::ethers_providers::Middleware> From<::ethers_contract::Contract<M>>
for ERC20VotesComp<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 ERC20VotesCompErrors {
InvalidShortString(InvalidShortString),
StringTooLong(StringTooLong),
/// The standard solidity revert string, with selector
/// Error(string) -- 0x08c379a0
RevertString(::std::string::String),
}
impl ::ethers_core::abi::AbiDecode for ERC20VotesCompErrors {
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 ERC20VotesCompErrors {
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 ERC20VotesCompErrors {
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 ERC20VotesCompErrors {
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 ERC20VotesCompErrors {
fn from(value: String) -> Self {
Self::RevertString(value)
}
}
impl ::core::convert::From<InvalidShortString> for ERC20VotesCompErrors {
fn from(value: InvalidShortString) -> Self {
Self::InvalidShortString(value)
}
}
impl ::core::convert::From<StringTooLong> for ERC20VotesCompErrors {
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 = "DelegateChanged",
abi = "DelegateChanged(address,address,address)"
)]
pub struct DelegateChangedFilter {
#[ethevent(indexed)]
pub delegator: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub from_delegate: ::ethers_core::types::Address,
#[ethevent(indexed)]
pub to_delegate: ::ethers_core::types::Address,
}
#[derive(
Clone,
::ethers_contract::EthEvent,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethevent(
name = "DelegateVotesChanged",
abi = "DelegateVotesChanged(address,uint256,uint256)"
)]
pub struct DelegateVotesChangedFilter {
#[ethevent(indexed)]
pub delegate: ::ethers_core::types::Address,
pub previous_balance: ::ethers_core::types::U256,
pub new_balance: ::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 ERC20VotesCompEvents {
ApprovalFilter(ApprovalFilter),
DelegateChangedFilter(DelegateChangedFilter),
DelegateVotesChangedFilter(DelegateVotesChangedFilter),
Eip712DomainChangedFilter(Eip712DomainChangedFilter),
TransferFilter(TransferFilter),
}
impl ::ethers_contract::EthLogDecode for ERC20VotesCompEvents {
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(ERC20VotesCompEvents::ApprovalFilter(decoded));
}
if let Ok(decoded) = DelegateChangedFilter::decode_log(log) {
return Ok(ERC20VotesCompEvents::DelegateChangedFilter(decoded));
}
if let Ok(decoded) = DelegateVotesChangedFilter::decode_log(log) {
return Ok(ERC20VotesCompEvents::DelegateVotesChangedFilter(decoded));
}
if let Ok(decoded) = Eip712DomainChangedFilter::decode_log(log) {
return Ok(ERC20VotesCompEvents::Eip712DomainChangedFilter(decoded));
}
if let Ok(decoded) = TransferFilter::decode_log(log) {
return Ok(ERC20VotesCompEvents::TransferFilter(decoded));
}
Err(::ethers_core::abi::Error::InvalidData)
}
}
impl ::core::fmt::Display for ERC20VotesCompEvents {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::ApprovalFilter(element) => ::core::fmt::Display::fmt(element, f),
Self::DelegateChangedFilter(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::DelegateVotesChangedFilter(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 ERC20VotesCompEvents {
fn from(value: ApprovalFilter) -> Self {
Self::ApprovalFilter(value)
}
}
impl ::core::convert::From<DelegateChangedFilter> for ERC20VotesCompEvents {
fn from(value: DelegateChangedFilter) -> Self {
Self::DelegateChangedFilter(value)
}
}
impl ::core::convert::From<DelegateVotesChangedFilter> for ERC20VotesCompEvents {
fn from(value: DelegateVotesChangedFilter) -> Self {
Self::DelegateVotesChangedFilter(value)
}
}
impl ::core::convert::From<Eip712DomainChangedFilter> for ERC20VotesCompEvents {
fn from(value: Eip712DomainChangedFilter) -> Self {
Self::Eip712DomainChangedFilter(value)
}
}
impl ::core::convert::From<TransferFilter> for ERC20VotesCompEvents {
fn from(value: TransferFilter) -> Self {
Self::TransferFilter(value)
}
}
///Container type for all input parameters for the `CLOCK_MODE` function with signature `CLOCK_MODE()` and selector `0x4bf5d7e9`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "CLOCK_MODE", abi = "CLOCK_MODE()")]
pub struct ClockModeCall;
///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 `checkpoints` function with signature `checkpoints(address,uint32)` and selector `0xf1127ed8`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "checkpoints", abi = "checkpoints(address,uint32)")]
pub struct CheckpointsCall {
pub account: ::ethers_core::types::Address,
pub pos: u32,
}
///Container type for all input parameters for the `clock` function with signature `clock()` and selector `0x91ddadf4`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "clock", abi = "clock()")]
pub struct ClockCall;
///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 `delegate` function with signature `delegate(address)` and selector `0x5c19a95c`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "delegate", abi = "delegate(address)")]
pub struct DelegateCall {
pub delegatee: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `delegateBySig` function with signature `delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)` and selector `0xc3cda520`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(
name = "delegateBySig",
abi = "delegateBySig(address,uint256,uint256,uint8,bytes32,bytes32)"
)]
pub struct DelegateBySigCall {
pub delegatee: ::ethers_core::types::Address,
pub nonce: ::ethers_core::types::U256,
pub expiry: ::ethers_core::types::U256,
pub v: u8,
pub r: [u8; 32],
pub s: [u8; 32],
}
///Container type for all input parameters for the `delegates` function with signature `delegates(address)` and selector `0x587cde1e`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "delegates", abi = "delegates(address)")]
pub struct DelegatesCall {
pub account: ::ethers_core::types::Address,
}
///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 `getCurrentVotes` function with signature `getCurrentVotes(address)` and selector `0xb4b5ea57`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "getCurrentVotes", abi = "getCurrentVotes(address)")]
pub struct GetCurrentVotesCall {
pub account: ::ethers_core::types::Address,
}
///Container type for all input parameters for the `getPastTotalSupply` function with signature `getPastTotalSupply(uint256)` and selector `0x8e539e8c`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "getPastTotalSupply", abi = "getPastTotalSupply(uint256)")]
pub struct GetPastTotalSupplyCall {
pub timepoint: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `getPastVotes` function with signature `getPastVotes(address,uint256)` and selector `0x3a46b1a8`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "getPastVotes", abi = "getPastVotes(address,uint256)")]
pub struct GetPastVotesCall {
pub account: ::ethers_core::types::Address,
pub timepoint: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `getPriorVotes` function with signature `getPriorVotes(address,uint256)` and selector `0x782d6fe1`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "getPriorVotes", abi = "getPriorVotes(address,uint256)")]
pub struct GetPriorVotesCall {
pub account: ::ethers_core::types::Address,
pub block_number: ::ethers_core::types::U256,
}
///Container type for all input parameters for the `getVotes` function with signature `getVotes(address)` and selector `0x9ab24eb0`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "getVotes", abi = "getVotes(address)")]
pub struct GetVotesCall {
pub account: ::ethers_core::types::Address,
}
///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 `numCheckpoints` function with signature `numCheckpoints(address)` and selector `0x6fcfff45`
#[derive(
Clone,
::ethers_contract::EthCall,
::ethers_contract::EthDisplay,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
#[ethcall(name = "numCheckpoints", abi = "numCheckpoints(address)")]
pub struct NumCheckpointsCall {
pub account: ::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 ERC20VotesCompCalls {
ClockMode(ClockModeCall),
DomainSeparator(DomainSeparatorCall),
Allowance(AllowanceCall),
Approve(ApproveCall),
BalanceOf(BalanceOfCall),
Checkpoints(CheckpointsCall),
Clock(ClockCall),
Decimals(DecimalsCall),
DecreaseAllowance(DecreaseAllowanceCall),
Delegate(DelegateCall),
DelegateBySig(DelegateBySigCall),
Delegates(DelegatesCall),
Eip712Domain(Eip712DomainCall),
GetCurrentVotes(GetCurrentVotesCall),
GetPastTotalSupply(GetPastTotalSupplyCall),
GetPastVotes(GetPastVotesCall),
GetPriorVotes(GetPriorVotesCall),
GetVotes(GetVotesCall),
IncreaseAllowance(IncreaseAllowanceCall),
Name(NameCall),
Nonces(NoncesCall),
NumCheckpoints(NumCheckpointsCall),
Permit(PermitCall),
Symbol(SymbolCall),
TotalSupply(TotalSupplyCall),
Transfer(TransferCall),
TransferFrom(TransferFromCall),
}
impl ::ethers_core::abi::AbiDecode for ERC20VotesCompCalls {
fn decode(
data: impl AsRef<[u8]>,
) -> ::core::result::Result<Self, ::ethers_core::abi::AbiError> {
let data = data.as_ref();
if let Ok(decoded)
= <ClockModeCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::ClockMode(decoded));
}
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)
= <CheckpointsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Checkpoints(decoded));
}
if let Ok(decoded)
= <ClockCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Clock(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)
= <DelegateCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Delegate(decoded));
}
if let Ok(decoded)
= <DelegateBySigCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::DelegateBySig(decoded));
}
if let Ok(decoded)
= <DelegatesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Delegates(decoded));
}
if let Ok(decoded)
= <Eip712DomainCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::Eip712Domain(decoded));
}
if let Ok(decoded)
= <GetCurrentVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::GetCurrentVotes(decoded));
}
if let Ok(decoded)
= <GetPastTotalSupplyCall as ::ethers_core::abi::AbiDecode>::decode(
data,
) {
return Ok(Self::GetPastTotalSupply(decoded));
}
if let Ok(decoded)
= <GetPastVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::GetPastVotes(decoded));
}
if let Ok(decoded)
= <GetPriorVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::GetPriorVotes(decoded));
}
if let Ok(decoded)
= <GetVotesCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::GetVotes(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)
= <NumCheckpointsCall as ::ethers_core::abi::AbiDecode>::decode(data) {
return Ok(Self::NumCheckpoints(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 ERC20VotesCompCalls {
fn encode(self) -> Vec<u8> {
match self {
Self::ClockMode(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
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::Checkpoints(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Clock(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::Delegate(element) => ::ethers_core::abi::AbiEncode::encode(element),
Self::DelegateBySig(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Delegates(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::Eip712Domain(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::GetCurrentVotes(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::GetPastTotalSupply(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::GetPastVotes(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::GetPriorVotes(element) => {
::ethers_core::abi::AbiEncode::encode(element)
}
Self::GetVotes(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::NumCheckpoints(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 ERC20VotesCompCalls {
fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result {
match self {
Self::ClockMode(element) => ::core::fmt::Display::fmt(element, f),
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::Checkpoints(element) => ::core::fmt::Display::fmt(element, f),
Self::Clock(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::Delegate(element) => ::core::fmt::Display::fmt(element, f),
Self::DelegateBySig(element) => ::core::fmt::Display::fmt(element, f),
Self::Delegates(element) => ::core::fmt::Display::fmt(element, f),
Self::Eip712Domain(element) => ::core::fmt::Display::fmt(element, f),
Self::GetCurrentVotes(element) => ::core::fmt::Display::fmt(element, f),
Self::GetPastTotalSupply(element) => {
::core::fmt::Display::fmt(element, f)
}
Self::GetPastVotes(element) => ::core::fmt::Display::fmt(element, f),
Self::GetPriorVotes(element) => ::core::fmt::Display::fmt(element, f),
Self::GetVotes(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::NumCheckpoints(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<ClockModeCall> for ERC20VotesCompCalls {
fn from(value: ClockModeCall) -> Self {
Self::ClockMode(value)
}
}
impl ::core::convert::From<DomainSeparatorCall> for ERC20VotesCompCalls {
fn from(value: DomainSeparatorCall) -> Self {
Self::DomainSeparator(value)
}
}
impl ::core::convert::From<AllowanceCall> for ERC20VotesCompCalls {
fn from(value: AllowanceCall) -> Self {
Self::Allowance(value)
}
}
impl ::core::convert::From<ApproveCall> for ERC20VotesCompCalls {
fn from(value: ApproveCall) -> Self {
Self::Approve(value)
}
}
impl ::core::convert::From<BalanceOfCall> for ERC20VotesCompCalls {
fn from(value: BalanceOfCall) -> Self {
Self::BalanceOf(value)
}
}
impl ::core::convert::From<CheckpointsCall> for ERC20VotesCompCalls {
fn from(value: CheckpointsCall) -> Self {
Self::Checkpoints(value)
}
}
impl ::core::convert::From<ClockCall> for ERC20VotesCompCalls {
fn from(value: ClockCall) -> Self {
Self::Clock(value)
}
}
impl ::core::convert::From<DecimalsCall> for ERC20VotesCompCalls {
fn from(value: DecimalsCall) -> Self {
Self::Decimals(value)
}
}
impl ::core::convert::From<DecreaseAllowanceCall> for ERC20VotesCompCalls {
fn from(value: DecreaseAllowanceCall) -> Self {
Self::DecreaseAllowance(value)
}
}
impl ::core::convert::From<DelegateCall> for ERC20VotesCompCalls {
fn from(value: DelegateCall) -> Self {
Self::Delegate(value)
}
}
impl ::core::convert::From<DelegateBySigCall> for ERC20VotesCompCalls {
fn from(value: DelegateBySigCall) -> Self {
Self::DelegateBySig(value)
}
}
impl ::core::convert::From<DelegatesCall> for ERC20VotesCompCalls {
fn from(value: DelegatesCall) -> Self {
Self::Delegates(value)
}
}
impl ::core::convert::From<Eip712DomainCall> for ERC20VotesCompCalls {
fn from(value: Eip712DomainCall) -> Self {
Self::Eip712Domain(value)
}
}
impl ::core::convert::From<GetCurrentVotesCall> for ERC20VotesCompCalls {
fn from(value: GetCurrentVotesCall) -> Self {
Self::GetCurrentVotes(value)
}
}
impl ::core::convert::From<GetPastTotalSupplyCall> for ERC20VotesCompCalls {
fn from(value: GetPastTotalSupplyCall) -> Self {
Self::GetPastTotalSupply(value)
}
}
impl ::core::convert::From<GetPastVotesCall> for ERC20VotesCompCalls {
fn from(value: GetPastVotesCall) -> Self {
Self::GetPastVotes(value)
}
}
impl ::core::convert::From<GetPriorVotesCall> for ERC20VotesCompCalls {
fn from(value: GetPriorVotesCall) -> Self {
Self::GetPriorVotes(value)
}
}
impl ::core::convert::From<GetVotesCall> for ERC20VotesCompCalls {
fn from(value: GetVotesCall) -> Self {
Self::GetVotes(value)
}
}
impl ::core::convert::From<IncreaseAllowanceCall> for ERC20VotesCompCalls {
fn from(value: IncreaseAllowanceCall) -> Self {
Self::IncreaseAllowance(value)
}
}
impl ::core::convert::From<NameCall> for ERC20VotesCompCalls {
fn from(value: NameCall) -> Self {
Self::Name(value)
}
}
impl ::core::convert::From<NoncesCall> for ERC20VotesCompCalls {
fn from(value: NoncesCall) -> Self {
Self::Nonces(value)
}
}
impl ::core::convert::From<NumCheckpointsCall> for ERC20VotesCompCalls {
fn from(value: NumCheckpointsCall) -> Self {
Self::NumCheckpoints(value)
}
}
impl ::core::convert::From<PermitCall> for ERC20VotesCompCalls {
fn from(value: PermitCall) -> Self {
Self::Permit(value)
}
}
impl ::core::convert::From<SymbolCall> for ERC20VotesCompCalls {
fn from(value: SymbolCall) -> Self {
Self::Symbol(value)
}
}
impl ::core::convert::From<TotalSupplyCall> for ERC20VotesCompCalls {
fn from(value: TotalSupplyCall) -> Self {
Self::TotalSupply(value)
}
}
impl ::core::convert::From<TransferCall> for ERC20VotesCompCalls {
fn from(value: TransferCall) -> Self {
Self::Transfer(value)
}
}
impl ::core::convert::From<TransferFromCall> for ERC20VotesCompCalls {
fn from(value: TransferFromCall) -> Self {
Self::TransferFrom(value)
}
}
///Container type for all return fields from the `CLOCK_MODE` function with signature `CLOCK_MODE()` and selector `0x4bf5d7e9`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct ClockModeReturn(pub ::std::string::String);
///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 `checkpoints` function with signature `checkpoints(address,uint32)` and selector `0xf1127ed8`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct CheckpointsReturn(pub Checkpoint);
///Container type for all return fields from the `clock` function with signature `clock()` and selector `0x91ddadf4`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct ClockReturn(pub u64);
///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 `delegates` function with signature `delegates(address)` and selector `0x587cde1e`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct DelegatesReturn(pub ::ethers_core::types::Address);
///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 `getCurrentVotes` function with signature `getCurrentVotes(address)` and selector `0xb4b5ea57`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct GetCurrentVotesReturn(pub u128);
///Container type for all return fields from the `getPastTotalSupply` function with signature `getPastTotalSupply(uint256)` and selector `0x8e539e8c`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct GetPastTotalSupplyReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `getPastVotes` function with signature `getPastVotes(address,uint256)` and selector `0x3a46b1a8`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct GetPastVotesReturn(pub ::ethers_core::types::U256);
///Container type for all return fields from the `getPriorVotes` function with signature `getPriorVotes(address,uint256)` and selector `0x782d6fe1`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct GetPriorVotesReturn(pub u128);
///Container type for all return fields from the `getVotes` function with signature `getVotes(address)` and selector `0x9ab24eb0`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct GetVotesReturn(pub ::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 `numCheckpoints` function with signature `numCheckpoints(address)` and selector `0x6fcfff45`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct NumCheckpointsReturn(pub u32);
///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);
///`Checkpoint(uint32,uint224)`
#[derive(
Clone,
::ethers_contract::EthAbiType,
::ethers_contract::EthAbiCodec,
Default,
Debug,
PartialEq,
Eq,
Hash
)]
pub struct Checkpoint {
pub from_block: u32,
pub votes: ::ethers_core::types::U256,
}
}