Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

IERC20SafeDispatcherTrait

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20SafeDispatcherTrait

Part of the group: dispatchers

pub trait IERC20SafeDispatcherTrait<T>

Trait functions

total_supply

Returns the total supply of tokens.

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20SafeDispatcherTrait::total_supply

fn total_supply(self: T) -> Result<u256, Array<felt252>>

balance_of

Returns the amount of tokens owned by account.

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20SafeDispatcherTrait::balance_of

fn balance_of(self: T, account: ContractAddress) -> Result<u256, Array<felt252>>

allowance

Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through transfer_from.

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20SafeDispatcherTrait::allowance

fn allowance(
    self: T, owner: ContractAddress, spender: ContractAddress,
) -> Result<u256, Array<felt252>>

transfer

Moves amount tokens from the caller’s account to recipient.

Returns a boolean value indicating whether the operation succeeded.

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20SafeDispatcherTrait::transfer

fn transfer(self: T, recipient: ContractAddress, amount: u256) -> Result<bool, Array<felt252>>

transfer_from

Moves amount tokens from sender to recipient using the allowance mechanism.

Returns a boolean value indicating whether the operation succeeded.

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20SafeDispatcherTrait::transfer_from

fn transfer_from(
    self: T, sender: ContractAddress, recipient: ContractAddress, amount: u256,
) -> Result<bool, Array<felt252>>

approve

Sets amount as the allowance of spender over the caller’s tokens.

Returns a boolean value indicating whether the operation succeeded.

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20SafeDispatcherTrait::approve

fn approve(self: T, spender: ContractAddress, amount: u256) -> Result<bool, Array<felt252>>