ERC20Facet

Git Source

Inherits: IERC20, ERC20Base, Facet

Functions

ERC20_init

function ERC20_init(string memory name_, string memory symbol_, uint8 decimals_) external onlyInitializing;

name

Returns the name of the token.

function name() external view returns (string memory);

symbol

Returns the symbol of the token.

function symbol() external view returns (string memory);

decimals

Returns the decimals places of the token.

function decimals() external view returns (uint8);

transfer

Moves an amount of tokens from the caller's account to another account.

function transfer(address to, uint256 amount) external returns (bool);

Parameters

Returns

approve

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

function approve(address spender, uint256 amount) external returns (bool);

Parameters

Returns

transferFrom

Transferrs an amount of tokens from an account to other using the allowance mechanism.

Amount is deducted from the caller's allowance.

function transferFrom(address from, address to, uint256 amount) external returns (bool);

Parameters

Returns

allowance

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

This value changes when {approve} or {transferFrom} are called and is zero by default.

function allowance(address owner, address spender) external view returns (uint256);

Parameters

totalSupply

Returns the amount of tokens in existence.

function totalSupply() external view returns (uint256);

balanceOf

Returns the amount of tokens owned by an account.

function balanceOf(address account) external view returns (uint256);

Parameters