Skip to content

Solidity API

ERC20Base

This contract implements the core functionality of the ERC20 standard It inherits from IERC20Base for interface compliance and ERC20BaseInternal for internal functions

totalSupply

solidity
function totalSupply() external view returns (uint256)

Returns the total number of tokens in existence

Returns the total amount of tokens in existence

Return Values

NameTypeDescription
[0]uint256The total supply of tokens

balanceOf

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

Returns the token balance of a given account

Returns the amount of tokens owned by a specific account

Parameters

NameTypeDescription
accountaddressThe address to query the balance of

Return Values

NameTypeDescription
[0]uint256The number of tokens owned by the specified address

allowance

solidity
function allowance(address holder, address spender) external view returns (uint256)

Returns the remaining number of tokens that spender is allowed to spend on behalf of holder

Returns the remaining number of tokens that spender will be allowed to spend on behalf of holder through {transferFrom}

Parameters

NameTypeDescription
holderaddressThe address which owns the tokens
spenderaddressThe address which will spend the tokens

Return Values

NameTypeDescription
[0]uint256The number of tokens still available for the spender

approve

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

Sets the amount of tokens that spender is allowed to spend on behalf of the caller

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

Parameters

NameTypeDescription
spenderaddressThe address which will spend the tokens
amountuint256The number of tokens to be spent

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the operation succeeded

transfer

solidity
function transfer(address recipient, uint256 amount) external returns (bool)

Moves tokens from caller's account to the recipient

Moves amount tokens from the caller's account to recipient

Parameters

NameTypeDescription
recipientaddressThe address to receive the tokens
amountuint256The number of tokens to transfer

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the operation succeeded

transferFrom

solidity
function transferFrom(address holder, address recipient, uint256 amount) external returns (bool)

Moves tokens from holder's account to recipient using the allowance mechanism

Moves amount tokens from holder to recipient using the allowance mechanism Amount is then deducted from the caller's allowance

Parameters

NameTypeDescription
holderaddressThe address which owns the tokens
recipientaddressThe address to receive the tokens
amountuint256The number of tokens to transfer

Return Values

NameTypeDescription
[0]boolA boolean value indicating whether the operation succeeded