Skip to content

Latest commit

 

History

History
332 lines (295 loc) · 10.2 KB

ERC20Detailed.md

File metadata and controls

332 lines (295 loc) · 10.2 KB

ERC20Detailed.sol

View Source: contracts/openzeppelin/ERC20Detailed.sol

↗ Extends: IERC20_ ↘ Derived Contracts: SOV

ERC20Detailed contract

Optional functions from the ERC20 standard.

Contract Members

Constants & Variables

string private _name;
string private _symbol;
uint8 private _decimals;

Functions


constructor

Sets the values for name, symbol, and decimals. All three of these values are immutable: they can only be set once during construction.

function (string name, string symbol, uint8 decimals) public nonpayable

Arguments

Name Type Description
name string
symbol string
decimals uint8
Source Code
constructor(
        string memory name,
        string memory symbol,
        uint8 decimals
    ) public {
        _name = name;
        _symbol = symbol;
        _decimals = decimals;
    }

name

Returns the name of the token.

function name() public view
returns(string)
Source Code
function name() public view returns (string memory) {
        return _name;
    }

symbol

Returns the symbol of the token, usually a shorter version of the name.

function symbol() public view
returns(string)
Source Code
function symbol() public view returns (string memory) {
        return _symbol;
    }

decimals

Returns the number of decimals used to get its user representation. For example, if decimals equals 2, a balance of 505 tokens should be displayed to a user as 5,05 (505 / 10 ** 2). * Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. * NOTE: This information is only used for display purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.

function decimals() public view
returns(uint8)
Source Code
function decimals() public view returns (uint8) {
        return _decimals;
    }

Contracts