multiversx_sc::types

Trait FixedSupplyToken

Source
pub trait FixedSupplyToken<M: ManagedTypeApi> {
    // Required methods
    fn get_total_supply(&self) -> BigUint<M>;
    fn into_part(self, payment_amount: &BigUint<M>) -> Self;

    // Provided methods
    fn rule_of_three(
        &self,
        current_supply: &BigUint<M>,
        full_value: &BigUint<M>,
    ) -> BigUint<M> { ... }
    fn rule_of_three_non_zero_result(
        &self,
        current_supply: &BigUint<M>,
        full_value: &BigUint<M>,
    ) -> BigUint<M> { ... }
}

Required Methods§

Source

fn get_total_supply(&self) -> BigUint<M>

Source

fn into_part(self, payment_amount: &BigUint<M>) -> Self

Provided Methods§

Source

fn rule_of_three( &self, current_supply: &BigUint<M>, full_value: &BigUint<M>, ) -> BigUint<M>

full_value * current_supply / total_supply

Source

fn rule_of_three_non_zero_result( &self, current_supply: &BigUint<M>, full_value: &BigUint<M>, ) -> BigUint<M>

full_value * current_supply / total_supply

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.

Implementors§