pub struct ERC20 { /* private fields */ }Expand description
ERC-20 Token Standardı
Implementations§
Source§impl ERC20
impl ERC20
Sourcepub fn new(
name: &str,
symbol: &str,
initial_supply: u64,
max_supply: u64,
) -> ERC20
pub fn new( name: &str, symbol: &str, initial_supply: u64, max_supply: u64, ) -> ERC20
Yeni bir ERC-20 token oluşturur.
Sourcepub fn total_supply(&self) -> u64
pub fn total_supply(&self) -> u64
Toplam arzı döndürür.
Sourcepub fn max_supply(&self) -> u64
pub fn max_supply(&self) -> u64
Maksimum arzı döndürür.
Sourcepub fn balance_of(&self, owner: &str) -> u64
pub fn balance_of(&self, owner: &str) -> u64
Bir kullanıcının bakiyesini sorgular.
Sourcepub fn transfer(&mut self, from: &str, to: &str, amount: u64) -> bool
pub fn transfer(&mut self, from: &str, to: &str, amount: u64) -> bool
Token transfer eder. from hesabından to hesabına amount kadar token transfer eder.
Re-entrancy saldırılarını önlemek için izin ve transfer mantığı ayrı tutulur.
Sourcepub fn approve(&mut self, owner: &str, spender: &str, amount: u64) -> bool
pub fn approve(&mut self, owner: &str, spender: &str, amount: u64) -> bool
Bir kullanıcıya belirli miktarda token harcaması için izin verir.
Sourcepub fn transfer_from(
&mut self,
owner: &str,
spender: &str,
to: &str,
amount: u64,
) -> bool
pub fn transfer_from( &mut self, owner: &str, spender: &str, to: &str, amount: u64, ) -> bool
Harcama izni ile transfer işlemi gerçekleştirir.
Trait Implementations§
Source§impl FromWasmAbi for ERC20
impl FromWasmAbi for ERC20
Source§impl IntoWasmAbi for ERC20
impl IntoWasmAbi for ERC20
Source§impl LongRefFromWasmAbi for ERC20
impl LongRefFromWasmAbi for ERC20
Source§impl OptionFromWasmAbi for ERC20
impl OptionFromWasmAbi for ERC20
Source§impl OptionIntoWasmAbi for ERC20
impl OptionIntoWasmAbi for ERC20
Source§impl RefFromWasmAbi for ERC20
impl RefFromWasmAbi for ERC20
Source§impl RefMutFromWasmAbi for ERC20
impl RefMutFromWasmAbi for ERC20
Source§impl TryFromJsValue for ERC20
impl TryFromJsValue for ERC20
Source§impl VectorFromWasmAbi for ERC20
impl VectorFromWasmAbi for ERC20
Source§impl VectorIntoWasmAbi for ERC20
impl VectorIntoWasmAbi for ERC20
impl SupportsConstructor for ERC20
impl SupportsInstanceProperty for ERC20
impl SupportsStaticProperty for ERC20
Auto Trait Implementations§
impl Freeze for ERC20
impl RefUnwindSafe for ERC20
impl Send for ERC20
impl Sync for ERC20
impl Unpin for ERC20
impl UnwindSafe for ERC20
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.