Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

IERC20

Fully qualified path: openzeppelin_interfaces::token::erc20::IERC20

pub trait IERC20<TState>

Trait functions

total_supply

Returns the total supply of tokens.

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

fn total_supply(self: @TState) -> u256

balance_of

Returns the amount of tokens owned by account.

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

fn balance_of(self: @TState, 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::IERC20::allowance

fn allowance(self: @TState, 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::IERC20::transfer

fn transfer(ref self: TState, 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::IERC20::transfer_from

fn transfer_from(
    ref self: TState, 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::IERC20::approve

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