Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

IERC20DispatcherTrait

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20DispatcherTrait

Part of the group: dispatchers

pub trait IERC20DispatcherTrait<T>

Trait functions

total_supply

Returns the total supply of tokens.

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

fn total_supply(self: T) -> u256

balance_of

Returns the amount of tokens owned by account.

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

fn balance_of(self: T, account: ContractAddress) -> u256

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::IERC20DispatcherTrait::allowance

fn allowance(self: T, owner: ContractAddress, spender: ContractAddress) -> u256

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::IERC20DispatcherTrait::transfer

fn transfer(self: T, recipient: ContractAddress, amount: u256) -> bool

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::IERC20DispatcherTrait::transfer_from

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

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::IERC20DispatcherTrait::approve

fn approve(self: T, spender: ContractAddress, amount: u256) -> bool