/** Generated by the following Solidity interface... ```solidity interface IERC20 { event Approval(address indexed owner, address indexed spender, uint256 value); event Transfer(address indexed from, address indexed to, uint256 value); function allowance(address owner, address spender) external view returns (uint256); function approve(address spender, uint256 amount) external returns (bool); function balanceOf(address account) external view returns (uint256); function decimals() external view returns (uint8); function name() external view returns (string memory); function symbol() external view returns (string memory); function totalSupply() external view returns (uint256); function transfer(address to, uint256 amount) external returns (bool); function transferFrom(address from, address to, uint256 amount) external returns (bool); } ``` ...which was generated by the following JSON ABI: ```json [ { "type": "function", "name": "allowance", "inputs": [ { "name": "owner", "type": "address", "internalType": "address" }, { "name": "spender", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "approve", "inputs": [ { "name": "spender", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "balanceOf", "inputs": [ { "name": "account", "type": "address", "internalType": "address" } ], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "decimals", "inputs": [], "outputs": [ { "name": "", "type": "uint8", "internalType": "uint8" } ], "stateMutability": "view" }, { "type": "function", "name": "name", "inputs": [], "outputs": [ { "name": "", "type": "string", "internalType": "string" } ], "stateMutability": "view" }, { "type": "function", "name": "symbol", "inputs": [], "outputs": [ { "name": "", "type": "string", "internalType": "string" } ], "stateMutability": "view" }, { "type": "function", "name": "totalSupply", "inputs": [], "outputs": [ { "name": "", "type": "uint256", "internalType": "uint256" } ], "stateMutability": "view" }, { "type": "function", "name": "transfer", "inputs": [ { "name": "to", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "function", "name": "transferFrom", "inputs": [ { "name": "from", "type": "address", "internalType": "address" }, { "name": "to", "type": "address", "internalType": "address" }, { "name": "amount", "type": "uint256", "internalType": "uint256" } ], "outputs": [ { "name": "", "type": "bool", "internalType": "bool" } ], "stateMutability": "nonpayable" }, { "type": "event", "name": "Approval", "inputs": [ { "name": "owner", "type": "address", "indexed": true, "internalType": "address" }, { "name": "spender", "type": "address", "indexed": true, "internalType": "address" }, { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false }, { "type": "event", "name": "Transfer", "inputs": [ { "name": "from", "type": "address", "indexed": true, "internalType": "address" }, { "name": "to", "type": "address", "indexed": true, "internalType": "address" }, { "name": "value", "type": "uint256", "indexed": false, "internalType": "uint256" } ], "anonymous": false } ] ```*/ #[allow(non_camel_case_types, non_snake_case, clippy::style)] pub mod IERC20 { use super::*; use alloy::sol_types as alloy_sol_types; /// The creation / init bytecode of the contract. /// /// ```text ///0x /// ``` #[rustfmt::skip] #[allow(clippy::all)] pub static BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static( b"", ); /// The runtime bytecode of the contract, as deployed on the network. /// /// ```text ///0x /// ``` #[rustfmt::skip] #[allow(clippy::all)] pub static DEPLOYED_BYTECODE: alloy_sol_types::private::Bytes = alloy_sol_types::private::Bytes::from_static( b"", ); /**Event with signature `Approval(address,address,uint256)` and selector `0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925`. ```solidity event Approval(address indexed owner, address indexed spender, uint256 value); ```*/ #[allow(non_camel_case_types, non_snake_case, clippy::style)] #[derive(Clone)] pub struct Approval { #[allow(missing_docs)] pub owner: alloy::sol_types::private::Address, #[allow(missing_docs)] pub spender: alloy::sol_types::private::Address, #[allow(missing_docs)] pub value: alloy::sol_types::private::U256, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; #[automatically_derived] impl alloy_sol_types::SolEvent for Approval { type DataTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; type TopicList = ( alloy_sol_types::sol_data::FixedBytes<32>, alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Address, ); const SIGNATURE: &'static str = "Approval(address,address,uint256)"; const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ 140u8, 91u8, 225u8, 229u8, 235u8, 236u8, 125u8, 91u8, 209u8, 79u8, 113u8, 66u8, 125u8, 30u8, 132u8, 243u8, 221u8, 3u8, 20u8, 192u8, 247u8, 178u8, 41u8, 30u8, 91u8, 32u8, 10u8, 200u8, 199u8, 195u8, 185u8, 37u8, ]); const ANONYMOUS: bool = false; #[allow(unused_variables)] #[inline] fn new( topics: ::RustType, data: as alloy_sol_types::SolType>::RustType, ) -> Self { Self { owner: topics.1, spender: topics.2, value: data.0, } } #[inline] fn tokenize_body(&self) -> Self::DataToken<'_> { ( as alloy_sol_types::SolType>::tokenize(&self.value), ) } #[inline] fn topics(&self) -> ::RustType { (Self::SIGNATURE_HASH.into(), self.owner.clone(), self.spender.clone()) } #[inline] fn encode_topics_raw( &self, out: &mut [alloy_sol_types::abi::token::WordToken], ) -> alloy_sol_types::Result<()> { if out.len() < ::COUNT { return Err(alloy_sol_types::Error::Overrun); } out[0usize] = alloy_sol_types::abi::token::WordToken( Self::SIGNATURE_HASH, ); out[1usize] = ::encode_topic( &self.owner, ); out[2usize] = ::encode_topic( &self.spender, ); Ok(()) } } #[automatically_derived] impl alloy_sol_types::private::IntoLogData for Approval { fn to_log_data(&self) -> alloy_sol_types::private::LogData { From::from(self) } fn into_log_data(self) -> alloy_sol_types::private::LogData { From::from(&self) } } #[automatically_derived] impl From<&Approval> for alloy_sol_types::private::LogData { #[inline] fn from(this: &Approval) -> alloy_sol_types::private::LogData { alloy_sol_types::SolEvent::encode_log_data(this) } } }; /**Event with signature `Transfer(address,address,uint256)` and selector `0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef`. ```solidity event Transfer(address indexed from, address indexed to, uint256 value); ```*/ #[allow(non_camel_case_types, non_snake_case, clippy::style)] #[derive(Clone)] pub struct Transfer { #[allow(missing_docs)] pub from: alloy::sol_types::private::Address, #[allow(missing_docs)] pub to: alloy::sol_types::private::Address, #[allow(missing_docs)] pub value: alloy::sol_types::private::U256, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; #[automatically_derived] impl alloy_sol_types::SolEvent for Transfer { type DataTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); type DataToken<'a> = as alloy_sol_types::SolType>::Token<'a>; type TopicList = ( alloy_sol_types::sol_data::FixedBytes<32>, alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Address, ); const SIGNATURE: &'static str = "Transfer(address,address,uint256)"; const SIGNATURE_HASH: alloy_sol_types::private::B256 = alloy_sol_types::private::B256::new([ 221u8, 242u8, 82u8, 173u8, 27u8, 226u8, 200u8, 155u8, 105u8, 194u8, 176u8, 104u8, 252u8, 55u8, 141u8, 170u8, 149u8, 43u8, 167u8, 241u8, 99u8, 196u8, 161u8, 22u8, 40u8, 245u8, 90u8, 77u8, 245u8, 35u8, 179u8, 239u8, ]); const ANONYMOUS: bool = false; #[allow(unused_variables)] #[inline] fn new( topics: ::RustType, data: as alloy_sol_types::SolType>::RustType, ) -> Self { Self { from: topics.1, to: topics.2, value: data.0, } } #[inline] fn tokenize_body(&self) -> Self::DataToken<'_> { ( as alloy_sol_types::SolType>::tokenize(&self.value), ) } #[inline] fn topics(&self) -> ::RustType { (Self::SIGNATURE_HASH.into(), self.from.clone(), self.to.clone()) } #[inline] fn encode_topics_raw( &self, out: &mut [alloy_sol_types::abi::token::WordToken], ) -> alloy_sol_types::Result<()> { if out.len() < ::COUNT { return Err(alloy_sol_types::Error::Overrun); } out[0usize] = alloy_sol_types::abi::token::WordToken( Self::SIGNATURE_HASH, ); out[1usize] = ::encode_topic( &self.from, ); out[2usize] = ::encode_topic( &self.to, ); Ok(()) } } #[automatically_derived] impl alloy_sol_types::private::IntoLogData for Transfer { fn to_log_data(&self) -> alloy_sol_types::private::LogData { From::from(self) } fn into_log_data(self) -> alloy_sol_types::private::LogData { From::from(&self) } } #[automatically_derived] impl From<&Transfer> for alloy_sol_types::private::LogData { #[inline] fn from(this: &Transfer) -> alloy_sol_types::private::LogData { alloy_sol_types::SolEvent::encode_log_data(this) } } }; /**Function with signature `allowance(address,address)` and selector `0xdd62ed3e`. ```solidity function allowance(address owner, address spender) external view returns (uint256); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct allowanceCall { pub owner: alloy::sol_types::private::Address, pub spender: alloy::sol_types::private::Address, } ///Container type for the return parameters of the [`allowance(address,address)`](allowanceCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct allowanceReturn { pub _0: alloy::sol_types::private::U256, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = ( alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Address, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( alloy::sol_types::private::Address, alloy::sol_types::private::Address, ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: allowanceCall) -> Self { (value.owner, value.spender) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for allowanceCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { owner: tuple.0, spender: tuple.1, } } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: allowanceReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for allowanceReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for allowanceCall { type Parameters<'a> = ( alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Address, ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = allowanceReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "allowance(address,address)"; const SELECTOR: [u8; 4] = [221u8, 98u8, 237u8, 62u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { ( ::tokenize( &self.owner, ), ::tokenize( &self.spender, ), ) } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; /**Function with signature `approve(address,uint256)` and selector `0x095ea7b3`. ```solidity function approve(address spender, uint256 amount) external returns (bool); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct approveCall { pub spender: alloy::sol_types::private::Address, pub amount: alloy::sol_types::private::U256, } ///Container type for the return parameters of the [`approve(address,uint256)`](approveCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct approveReturn { pub _0: bool, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = ( alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Uint<256>, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( alloy::sol_types::private::Address, alloy::sol_types::private::U256, ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: approveCall) -> Self { (value.spender, value.amount) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for approveCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { spender: tuple.0, amount: tuple.1, } } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bool,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (bool,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: approveReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for approveReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for approveCall { type Parameters<'a> = ( alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Uint<256>, ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = approveReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::Bool,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "approve(address,uint256)"; const SELECTOR: [u8; 4] = [9u8, 94u8, 167u8, 179u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { ( ::tokenize( &self.spender, ), as alloy_sol_types::SolType>::tokenize(&self.amount), ) } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; /**Function with signature `balanceOf(address)` and selector `0x70a08231`. ```solidity function balanceOf(address account) external view returns (uint256); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct balanceOfCall { pub account: alloy::sol_types::private::Address, } ///Container type for the return parameters of the [`balanceOf(address)`](balanceOfCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct balanceOfReturn { pub _0: alloy::sol_types::private::U256, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Address,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (alloy::sol_types::private::Address,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: balanceOfCall) -> Self { (value.account,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for balanceOfCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { account: tuple.0 } } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: balanceOfReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for balanceOfReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for balanceOfCall { type Parameters<'a> = (alloy::sol_types::sol_data::Address,); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = balanceOfReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "balanceOf(address)"; const SELECTOR: [u8; 4] = [112u8, 160u8, 130u8, 49u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { ( ::tokenize( &self.account, ), ) } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; /**Function with signature `decimals()` and selector `0x313ce567`. ```solidity function decimals() external view returns (uint8); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct decimalsCall {} ///Container type for the return parameters of the [`decimals()`](decimalsCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct decimalsReturn { pub _0: u8, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = (); #[doc(hidden)] type UnderlyingRustTuple<'a> = (); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: decimalsCall) -> Self { () } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for decimalsCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self {} } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<8>,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (u8,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: decimalsReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for decimalsReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for decimalsCall { type Parameters<'a> = (); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = decimalsReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<8>,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "decimals()"; const SELECTOR: [u8; 4] = [49u8, 60u8, 229u8, 103u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { () } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; /**Function with signature `name()` and selector `0x06fdde03`. ```solidity function name() external view returns (string memory); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct nameCall {} ///Container type for the return parameters of the [`name()`](nameCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct nameReturn { pub _0: alloy::sol_types::private::String, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = (); #[doc(hidden)] type UnderlyingRustTuple<'a> = (); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: nameCall) -> Self { () } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for nameCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self {} } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::String,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (alloy::sol_types::private::String,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: nameReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for nameReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for nameCall { type Parameters<'a> = (); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = nameReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::String,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "name()"; const SELECTOR: [u8; 4] = [6u8, 253u8, 222u8, 3u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { () } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; /**Function with signature `symbol()` and selector `0x95d89b41`. ```solidity function symbol() external view returns (string memory); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct symbolCall {} ///Container type for the return parameters of the [`symbol()`](symbolCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct symbolReturn { pub _0: alloy::sol_types::private::String, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = (); #[doc(hidden)] type UnderlyingRustTuple<'a> = (); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: symbolCall) -> Self { () } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for symbolCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self {} } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::String,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (alloy::sol_types::private::String,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: symbolReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for symbolReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for symbolCall { type Parameters<'a> = (); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = symbolReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::String,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "symbol()"; const SELECTOR: [u8; 4] = [149u8, 216u8, 155u8, 65u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { () } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; /**Function with signature `totalSupply()` and selector `0x18160ddd`. ```solidity function totalSupply() external view returns (uint256); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct totalSupplyCall {} ///Container type for the return parameters of the [`totalSupply()`](totalSupplyCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct totalSupplyReturn { pub _0: alloy::sol_types::private::U256, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = (); #[doc(hidden)] type UnderlyingRustTuple<'a> = (); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: totalSupplyCall) -> Self { () } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for totalSupplyCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self {} } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (alloy::sol_types::private::U256,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: totalSupplyReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for totalSupplyReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for totalSupplyCall { type Parameters<'a> = (); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = totalSupplyReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::Uint<256>,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "totalSupply()"; const SELECTOR: [u8; 4] = [24u8, 22u8, 13u8, 221u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { () } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; /**Function with signature `transfer(address,uint256)` and selector `0xa9059cbb`. ```solidity function transfer(address to, uint256 amount) external returns (bool); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct transferCall { pub to: alloy::sol_types::private::Address, pub amount: alloy::sol_types::private::U256, } ///Container type for the return parameters of the [`transfer(address,uint256)`](transferCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct transferReturn { pub _0: bool, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = ( alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Uint<256>, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( alloy::sol_types::private::Address, alloy::sol_types::private::U256, ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: transferCall) -> Self { (value.to, value.amount) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for transferCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { to: tuple.0, amount: tuple.1, } } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bool,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (bool,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: transferReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for transferReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for transferCall { type Parameters<'a> = ( alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Uint<256>, ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = transferReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::Bool,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "transfer(address,uint256)"; const SELECTOR: [u8; 4] = [169u8, 5u8, 156u8, 187u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { ( ::tokenize( &self.to, ), as alloy_sol_types::SolType>::tokenize(&self.amount), ) } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; /**Function with signature `transferFrom(address,address,uint256)` and selector `0x23b872dd`. ```solidity function transferFrom(address from, address to, uint256 amount) external returns (bool); ```*/ #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct transferFromCall { pub from: alloy::sol_types::private::Address, pub to: alloy::sol_types::private::Address, pub amount: alloy::sol_types::private::U256, } ///Container type for the return parameters of the [`transferFrom(address,address,uint256)`](transferFromCall) function. #[allow(non_camel_case_types, non_snake_case)] #[derive(Clone)] pub struct transferFromReturn { pub _0: bool, } #[allow(non_camel_case_types, non_snake_case, clippy::style)] const _: () = { use alloy::sol_types as alloy_sol_types; { #[doc(hidden)] type UnderlyingSolTuple<'a> = ( alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Uint<256>, ); #[doc(hidden)] type UnderlyingRustTuple<'a> = ( alloy::sol_types::private::Address, alloy::sol_types::private::Address, alloy::sol_types::private::U256, ); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: transferFromCall) -> Self { (value.from, value.to, value.amount) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for transferFromCall { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { from: tuple.0, to: tuple.1, amount: tuple.2, } } } } { #[doc(hidden)] type UnderlyingSolTuple<'a> = (alloy::sol_types::sol_data::Bool,); #[doc(hidden)] type UnderlyingRustTuple<'a> = (bool,); #[cfg(test)] #[allow(dead_code, unreachable_patterns)] fn _type_assertion( _t: alloy_sol_types::private::AssertTypeEq, ) { match _t { alloy_sol_types::private::AssertTypeEq::< ::RustType, >(_) => {} } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From for UnderlyingRustTuple<'_> { fn from(value: transferFromReturn) -> Self { (value._0,) } } #[automatically_derived] #[doc(hidden)] impl ::core::convert::From> for transferFromReturn { fn from(tuple: UnderlyingRustTuple<'_>) -> Self { Self { _0: tuple.0 } } } } #[automatically_derived] impl alloy_sol_types::SolCall for transferFromCall { type Parameters<'a> = ( alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Address, alloy::sol_types::sol_data::Uint<256>, ); type Token<'a> = as alloy_sol_types::SolType>::Token<'a>; type Return = transferFromReturn; type ReturnTuple<'a> = (alloy::sol_types::sol_data::Bool,); type ReturnToken<'a> = as alloy_sol_types::SolType>::Token<'a>; const SIGNATURE: &'static str = "transferFrom(address,address,uint256)"; const SELECTOR: [u8; 4] = [35u8, 184u8, 114u8, 221u8]; #[inline] fn new<'a>( tuple: as alloy_sol_types::SolType>::RustType, ) -> Self { tuple.into() } #[inline] fn tokenize(&self) -> Self::Token<'_> { ( ::tokenize( &self.from, ), ::tokenize( &self.to, ), as alloy_sol_types::SolType>::tokenize(&self.amount), ) } #[inline] fn abi_decode_returns( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { as alloy_sol_types::SolType>::abi_decode_sequence(data, validate) .map(Into::into) } } }; ///Container for all the [`IERC20`](self) function calls. pub enum IERC20Calls { allowance(allowanceCall), approve(approveCall), balanceOf(balanceOfCall), decimals(decimalsCall), name(nameCall), symbol(symbolCall), totalSupply(totalSupplyCall), transfer(transferCall), transferFrom(transferFromCall), } #[automatically_derived] impl IERC20Calls { /// All the selectors of this enum. /// /// Note that the selectors might not be in the same order as the variants. /// No guarantees are made about the order of the selectors. /// /// Prefer using `SolInterface` methods instead. pub const SELECTORS: &'static [[u8; 4usize]] = &[ [6u8, 253u8, 222u8, 3u8], [9u8, 94u8, 167u8, 179u8], [24u8, 22u8, 13u8, 221u8], [35u8, 184u8, 114u8, 221u8], [49u8, 60u8, 229u8, 103u8], [112u8, 160u8, 130u8, 49u8], [149u8, 216u8, 155u8, 65u8], [169u8, 5u8, 156u8, 187u8], [221u8, 98u8, 237u8, 62u8], ]; } #[automatically_derived] impl alloy_sol_types::SolInterface for IERC20Calls { const NAME: &'static str = "IERC20Calls"; const MIN_DATA_LENGTH: usize = 0usize; const COUNT: usize = 9usize; #[inline] fn selector(&self) -> [u8; 4] { match self { Self::allowance(_) => { ::SELECTOR } Self::approve(_) => ::SELECTOR, Self::balanceOf(_) => { ::SELECTOR } Self::decimals(_) => ::SELECTOR, Self::name(_) => ::SELECTOR, Self::symbol(_) => ::SELECTOR, Self::totalSupply(_) => { ::SELECTOR } Self::transfer(_) => ::SELECTOR, Self::transferFrom(_) => { ::SELECTOR } } } #[inline] fn selector_at(i: usize) -> ::core::option::Option<[u8; 4]> { Self::SELECTORS.get(i).copied() } #[inline] fn valid_selector(selector: [u8; 4]) -> bool { Self::SELECTORS.binary_search(&selector).is_ok() } #[inline] #[allow(unsafe_code, non_snake_case)] fn abi_decode_raw( selector: [u8; 4], data: &[u8], validate: bool, ) -> alloy_sol_types::Result { static DECODE_SHIMS: &[fn( &[u8], bool, ) -> alloy_sol_types::Result] = &[ { fn name( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::name) } name }, { fn approve( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::approve) } approve }, { fn totalSupply( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::totalSupply) } totalSupply }, { fn transferFrom( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::transferFrom) } transferFrom }, { fn decimals( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::decimals) } decimals }, { fn balanceOf( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::balanceOf) } balanceOf }, { fn symbol( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::symbol) } symbol }, { fn transfer( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::transfer) } transfer }, { fn allowance( data: &[u8], validate: bool, ) -> alloy_sol_types::Result { ::abi_decode_raw( data, validate, ) .map(IERC20Calls::allowance) } allowance }, ]; let Ok(idx) = Self::SELECTORS.binary_search(&selector) else { return Err( alloy_sol_types::Error::unknown_selector( ::NAME, selector, ), ); }; (unsafe { DECODE_SHIMS.get_unchecked(idx) })(data, validate) } #[inline] fn abi_encoded_size(&self) -> usize { match self { Self::allowance(inner) => { ::abi_encoded_size(inner) } Self::approve(inner) => { ::abi_encoded_size(inner) } Self::balanceOf(inner) => { ::abi_encoded_size(inner) } Self::decimals(inner) => { ::abi_encoded_size(inner) } Self::name(inner) => { ::abi_encoded_size(inner) } Self::symbol(inner) => { ::abi_encoded_size(inner) } Self::totalSupply(inner) => { ::abi_encoded_size( inner, ) } Self::transfer(inner) => { ::abi_encoded_size(inner) } Self::transferFrom(inner) => { ::abi_encoded_size( inner, ) } } } #[inline] fn abi_encode_raw(&self, out: &mut alloy_sol_types::private::Vec) { match self { Self::allowance(inner) => { ::abi_encode_raw( inner, out, ) } Self::approve(inner) => { ::abi_encode_raw(inner, out) } Self::balanceOf(inner) => { ::abi_encode_raw( inner, out, ) } Self::decimals(inner) => { ::abi_encode_raw( inner, out, ) } Self::name(inner) => { ::abi_encode_raw(inner, out) } Self::symbol(inner) => { ::abi_encode_raw(inner, out) } Self::totalSupply(inner) => { ::abi_encode_raw( inner, out, ) } Self::transfer(inner) => { ::abi_encode_raw( inner, out, ) } Self::transferFrom(inner) => { ::abi_encode_raw( inner, out, ) } } } } ///Container for all the [`IERC20`](self) events. pub enum IERC20Events { Approval(Approval), Transfer(Transfer), } #[automatically_derived] impl IERC20Events { /// All the selectors of this enum. /// /// Note that the selectors might not be in the same order as the variants. /// No guarantees are made about the order of the selectors. /// /// Prefer using `SolInterface` methods instead. pub const SELECTORS: &'static [[u8; 32usize]] = &[ [ 140u8, 91u8, 225u8, 229u8, 235u8, 236u8, 125u8, 91u8, 209u8, 79u8, 113u8, 66u8, 125u8, 30u8, 132u8, 243u8, 221u8, 3u8, 20u8, 192u8, 247u8, 178u8, 41u8, 30u8, 91u8, 32u8, 10u8, 200u8, 199u8, 195u8, 185u8, 37u8, ], [ 221u8, 242u8, 82u8, 173u8, 27u8, 226u8, 200u8, 155u8, 105u8, 194u8, 176u8, 104u8, 252u8, 55u8, 141u8, 170u8, 149u8, 43u8, 167u8, 241u8, 99u8, 196u8, 161u8, 22u8, 40u8, 245u8, 90u8, 77u8, 245u8, 35u8, 179u8, 239u8, ], ]; } #[automatically_derived] impl alloy_sol_types::SolEventInterface for IERC20Events { const NAME: &'static str = "IERC20Events"; const COUNT: usize = 2usize; fn decode_raw_log( topics: &[alloy_sol_types::Word], data: &[u8], validate: bool, ) -> alloy_sol_types::Result { match topics.first().copied() { Some(::SIGNATURE_HASH) => { ::decode_raw_log( topics, data, validate, ) .map(Self::Approval) } Some(::SIGNATURE_HASH) => { ::decode_raw_log( topics, data, validate, ) .map(Self::Transfer) } _ => { alloy_sol_types::private::Err(alloy_sol_types::Error::InvalidLog { name: ::NAME, log: alloy_sol_types::private::Box::new( alloy_sol_types::private::LogData::new_unchecked( topics.to_vec(), data.to_vec().into(), ), ), }) } } } } #[automatically_derived] impl alloy_sol_types::private::IntoLogData for IERC20Events { fn to_log_data(&self) -> alloy_sol_types::private::LogData { match self { Self::Approval(inner) => { alloy_sol_types::private::IntoLogData::to_log_data(inner) } Self::Transfer(inner) => { alloy_sol_types::private::IntoLogData::to_log_data(inner) } } } fn into_log_data(self) -> alloy_sol_types::private::LogData { match self { Self::Approval(inner) => { alloy_sol_types::private::IntoLogData::into_log_data(inner) } Self::Transfer(inner) => { alloy_sol_types::private::IntoLogData::into_log_data(inner) } } } } use alloy::contract as alloy_contract; /**Creates a new wrapper around an on-chain [`IERC20`](self) contract instance. See the [wrapper's documentation](`IERC20Instance`) for more details.*/ #[inline] pub const fn new< T: alloy_contract::private::Transport + ::core::clone::Clone, P: alloy_contract::private::Provider, N: alloy_contract::private::Network, >( address: alloy_sol_types::private::Address, provider: P, ) -> IERC20Instance { IERC20Instance::::new(address, provider) } /**Deploys this contract using the given `provider` and constructor arguments, if any. Returns a new instance of the contract, if the deployment was successful. For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/ #[inline] pub fn deploy< T: alloy_contract::private::Transport + ::core::clone::Clone, P: alloy_contract::private::Provider, N: alloy_contract::private::Network, >( provider: P, ) -> impl ::core::future::Future< Output = alloy_contract::Result>, > { IERC20Instance::::deploy(provider) } /**Creates a `RawCallBuilder` for deploying this contract using the given `provider` and constructor arguments, if any. This is a simple wrapper around creating a `RawCallBuilder` with the data set to the bytecode concatenated with the constructor's ABI-encoded arguments.*/ #[inline] pub fn deploy_builder< T: alloy_contract::private::Transport + ::core::clone::Clone, P: alloy_contract::private::Provider, N: alloy_contract::private::Network, >(provider: P) -> alloy_contract::RawCallBuilder { IERC20Instance::::deploy_builder(provider) } /**A [`IERC20`](self) instance. Contains type-safe methods for interacting with an on-chain instance of the [`IERC20`](self) contract located at a given `address`, using a given provider `P`. If the contract bytecode is available (see the [`sol!`](alloy_sol_types::sol!) documentation on how to provide it), the `deploy` and `deploy_builder` methods can be used to deploy a new instance of the contract. See the [module-level documentation](self) for all the available methods.*/ #[derive(Clone)] pub struct IERC20Instance { address: alloy_sol_types::private::Address, provider: P, _network_transport: ::core::marker::PhantomData<(N, T)>, } #[automatically_derived] impl ::core::fmt::Debug for IERC20Instance { #[inline] fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { f.debug_tuple("IERC20Instance").field(&self.address).finish() } } /// Instantiation and getters/setters. #[automatically_derived] impl< T: alloy_contract::private::Transport + ::core::clone::Clone, P: alloy_contract::private::Provider, N: alloy_contract::private::Network, > IERC20Instance { /**Creates a new wrapper around an on-chain [`IERC20`](self) contract instance. See the [wrapper's documentation](`IERC20Instance`) for more details.*/ #[inline] pub const fn new( address: alloy_sol_types::private::Address, provider: P, ) -> Self { Self { address, provider, _network_transport: ::core::marker::PhantomData, } } /**Deploys this contract using the given `provider` and constructor arguments, if any. Returns a new instance of the contract, if the deployment was successful. For more fine-grained control over the deployment process, use [`deploy_builder`] instead.*/ #[inline] pub async fn deploy( provider: P, ) -> alloy_contract::Result> { let call_builder = Self::deploy_builder(provider); let contract_address = call_builder.deploy().await?; Ok(Self::new(contract_address, call_builder.provider)) } /**Creates a `RawCallBuilder` for deploying this contract using the given `provider` and constructor arguments, if any. This is a simple wrapper around creating a `RawCallBuilder` with the data set to the bytecode concatenated with the constructor's ABI-encoded arguments.*/ #[inline] pub fn deploy_builder(provider: P) -> alloy_contract::RawCallBuilder { alloy_contract::RawCallBuilder::new_raw_deploy( provider, ::core::clone::Clone::clone(&BYTECODE), ) } /// Returns a reference to the address. #[inline] pub const fn address(&self) -> &alloy_sol_types::private::Address { &self.address } /// Sets the address. #[inline] pub fn set_address(&mut self, address: alloy_sol_types::private::Address) { self.address = address; } /// Sets the address and returns `self`. pub fn at(mut self, address: alloy_sol_types::private::Address) -> Self { self.set_address(address); self } /// Returns a reference to the provider. #[inline] pub const fn provider(&self) -> &P { &self.provider } } impl IERC20Instance { /// Clones the provider and returns a new instance with the cloned provider. #[inline] pub fn with_cloned_provider(self) -> IERC20Instance { IERC20Instance { address: self.address, provider: ::core::clone::Clone::clone(&self.provider), _network_transport: ::core::marker::PhantomData, } } } /// Function calls. #[automatically_derived] impl< T: alloy_contract::private::Transport + ::core::clone::Clone, P: alloy_contract::private::Provider, N: alloy_contract::private::Network, > IERC20Instance { /// Creates a new call builder using this contract instance's provider and address. /// /// Note that the call can be any function call, not just those defined in this /// contract. Prefer using the other methods for building type-safe contract calls. pub fn call_builder( &self, call: &C, ) -> alloy_contract::SolCallBuilder { alloy_contract::SolCallBuilder::new_sol(&self.provider, &self.address, call) } ///Creates a new call builder for the [`allowance`] function. pub fn allowance( &self, owner: alloy::sol_types::private::Address, spender: alloy::sol_types::private::Address, ) -> alloy_contract::SolCallBuilder { self.call_builder(&allowanceCall { owner, spender }) } ///Creates a new call builder for the [`approve`] function. pub fn approve( &self, spender: alloy::sol_types::private::Address, amount: alloy::sol_types::private::U256, ) -> alloy_contract::SolCallBuilder { self.call_builder(&approveCall { spender, amount }) } ///Creates a new call builder for the [`balanceOf`] function. pub fn balanceOf( &self, account: alloy::sol_types::private::Address, ) -> alloy_contract::SolCallBuilder { self.call_builder(&balanceOfCall { account }) } ///Creates a new call builder for the [`decimals`] function. pub fn decimals( &self, ) -> alloy_contract::SolCallBuilder { self.call_builder(&decimalsCall {}) } ///Creates a new call builder for the [`name`] function. pub fn name(&self) -> alloy_contract::SolCallBuilder { self.call_builder(&nameCall {}) } ///Creates a new call builder for the [`symbol`] function. pub fn symbol(&self) -> alloy_contract::SolCallBuilder { self.call_builder(&symbolCall {}) } ///Creates a new call builder for the [`totalSupply`] function. pub fn totalSupply( &self, ) -> alloy_contract::SolCallBuilder { self.call_builder(&totalSupplyCall {}) } ///Creates a new call builder for the [`transfer`] function. pub fn transfer( &self, to: alloy::sol_types::private::Address, amount: alloy::sol_types::private::U256, ) -> alloy_contract::SolCallBuilder { self.call_builder(&transferCall { to, amount }) } ///Creates a new call builder for the [`transferFrom`] function. pub fn transferFrom( &self, from: alloy::sol_types::private::Address, to: alloy::sol_types::private::Address, amount: alloy::sol_types::private::U256, ) -> alloy_contract::SolCallBuilder { self.call_builder( &transferFromCall { from, to, amount, }, ) } } /// Event filters. #[automatically_derived] impl< T: alloy_contract::private::Transport + ::core::clone::Clone, P: alloy_contract::private::Provider, N: alloy_contract::private::Network, > IERC20Instance { /// Creates a new event filter using this contract instance's provider and address. /// /// Note that the type can be any event, not just those defined in this contract. /// Prefer using the other methods for building type-safe event filters. pub fn event_filter( &self, ) -> alloy_contract::Event { alloy_contract::Event::new_sol(&self.provider, &self.address) } ///Creates a new event filter for the [`Approval`] event. pub fn Approval_filter(&self) -> alloy_contract::Event { self.event_filter::() } ///Creates a new event filter for the [`Transfer`] event. pub fn Transfer_filter(&self) -> alloy_contract::Event { self.event_filter::() } } }