Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

ITTFeeCollector

Fully qualified path: tokentable_v2::components::interfaces::feecollector::ITTFeeCollector

pub trait ITTFeeCollector<TContractState>

Trait functions

withdraw_fee

Withdraws collected fees.

Arguments

  • token: The type of SNIP-2 token we are trying to withdraw.
  • amount: The amount of tokens we are trying to withdraw.

Panics

  • OwnableComponent::Errors::NOT_OWNER: If the caller is not the owner.

Fully qualified path: tokentable_v2::components::interfaces::feecollector::ITTFeeCollector::withdraw_fee

fn withdraw_fee(ref self: TContractState, token: ContractAddress, amount: u256)

set_default_fee

Sets the default fee.

Arguments

  • bips: The proportion of fees to take in basis points.

Panics

  • OwnableComponent::Errors::NOT_OWNER: If the caller is not the owner.

Fully qualified path: tokentable_v2::components::interfaces::feecollector::ITTFeeCollector::set_default_fee

fn set_default_fee(ref self: TContractState, bips: u256)

set_custom_fee

Sets a custom fee for a specific Unlocker.

Arguments

  • unlocker_instance: The specific Unlocker we are trying to configure.
  • bips: The proportion of fees to take in basis points.

Panics

  • OwnableComponent::Errors::NOT_OWNER: If the caller is not the owner.

Fully qualified path: tokentable_v2::components::interfaces::feecollector::ITTFeeCollector::set_custom_fee

fn set_custom_fee(ref self: TContractState, unlocker_instance: ContractAddress, bips: u256)

get_default_fee

Returns the default fee in basis points.

Fully qualified path: tokentable_v2::components::interfaces::feecollector::ITTFeeCollector::get_default_fee

fn get_default_fee(self: @TContractState) -> u256

get_fee

Returns the fees incurred by transacting a certain amount of tokens within a specific Unlocker.

Fully qualified path: tokentable_v2::components::interfaces::feecollector::ITTFeeCollector::get_fee

fn get_fee(
    self: @TContractState, unlocker_instance: ContractAddress, tokens_transferred: u256,
) -> u256