pub trait TokenTrait<'a, P: JsonRpcProvider>: SmartContractTrait<'a, P = P> {
const TOTAL_SUPPLY: &'static str = "totalSupply";
const SYMBOL: &'static str = "symbol";
const DECIMALS: &'static str = "decimals";
Show 14 methods
// Required methods
fn total_supply(&self) -> Option<u64>;
fn set_total_supply(&mut self, total_supply: u64);
fn decimals(&self) -> Option<u8>;
fn set_decimals(&mut self, decimals: u8);
fn symbol(&self) -> Option<String>;
fn set_symbol(&mut self, symbol: String);
fn resolve_nns_text_record<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 NNSName,
) -> Pin<Box<dyn Future<Output = Result<H160, ContractError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
// Provided methods
fn get_total_supply<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<u64, ContractError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn get_decimals<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<u8, ContractError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn get_symbol<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String, ContractError>> + Send + 'async_trait>>
where Self: Send + 'async_trait,
'life0: 'async_trait { ... }
fn to_fractions(
&self,
amount: u64,
decimals: u32,
) -> Result<i32, ContractError> { ... }
fn to_fractions_decimal(
&self,
amount: Decimal,
decimals: u32,
) -> Result<u64, ContractError> { ... }
fn to_decimals_u64(&self, fractions: u64, decimals: u32) -> Decimal { ... }
fn to_decimals(&self, amount: i64, decimals: u32) -> Decimal { ... }
}
Provided Associated Constants§
const TOTAL_SUPPLY: &'static str = "totalSupply"
const SYMBOL: &'static str = "symbol"
const DECIMALS: &'static str = "decimals"
Required Methods§
fn total_supply(&self) -> Option<u64>
fn set_total_supply(&mut self, total_supply: u64)
fn decimals(&self) -> Option<u8>
fn set_decimals(&mut self, decimals: u8)
fn symbol(&self) -> Option<String>
fn set_symbol(&mut self, symbol: String)
fn resolve_nns_text_record<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 NNSName,
) -> Pin<Box<dyn Future<Output = Result<H160, ContractError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Provided Methods§
fn get_total_supply<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<u64, ContractError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn get_decimals<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<u8, ContractError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn get_symbol<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<String, ContractError>> + Send + 'async_trait>>where
Self: Send + 'async_trait,
'life0: 'async_trait,
fn to_fractions(&self, amount: u64, decimals: u32) -> Result<i32, ContractError>
fn to_fractions_decimal( &self, amount: Decimal, decimals: u32, ) -> Result<u64, ContractError>
fn to_decimals_u64(&self, fractions: u64, decimals: u32) -> Decimal
fn to_decimals(&self, amount: i64, decimals: u32) -> Decimal
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.