Skip to main content

ERC20.sol

Modern and gas efficient ERC20 + EIP-2612 implementation.

Details Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it. :::

Methods

DOMAIN_SEPARATOR

Solidity
function DOMAIN_SEPARATOR() external view returns (bytes32)

Returns

NameTypeDescription
_0bytes32undefined

allowance

Solidity
function allowance(address, address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined
_1addressundefined

Returns

NameTypeDescription
_0uint256undefined

approve

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

Parameters

NameTypeDescription
spenderaddressundefined
amountuint256undefined

Returns

NameTypeDescription
_0boolundefined

balanceOf

Solidity
function balanceOf(address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

decimals

Solidity
function decimals() external view returns (uint8)

Returns

NameTypeDescription
_0uint8undefined

name

Solidity
function name() external view returns (string)

Returns

NameTypeDescription
_0stringundefined

nonces

Solidity
function nonces(address) external view returns (uint256)

Parameters

NameTypeDescription
_0addressundefined

Returns

NameTypeDescription
_0uint256undefined

permit

Solidity
function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external nonpayable

Parameters

NameTypeDescription
owneraddressundefined
spenderaddressundefined
valueuint256undefined
deadlineuint256undefined
vuint8undefined
rbytes32undefined
sbytes32undefined

symbol

Solidity
function symbol() external view returns (string)

Returns

NameTypeDescription
_0stringundefined

totalSupply

Solidity
function totalSupply() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

transfer

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

Parameters

NameTypeDescription
toaddressundefined
amountuint256undefined

Returns

NameTypeDescription
_0boolundefined

transferFrom

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

Parameters

NameTypeDescription
fromaddressundefined
toaddressundefined
amountuint256undefined

Returns

NameTypeDescription
_0boolundefined

Events

Approval

Solidity
event Approval(address indexed owner, address indexed spender, uint256 amount)

Parameters

NameTypeDescription
owner indexedaddressundefined
spender indexedaddressundefined
amountuint256undefined

Transfer

Solidity
event Transfer(address indexed from, address indexed to, uint256 amount)

Parameters

NameTypeDescription
from indexedaddressundefined
to indexedaddressundefined
amountuint256undefined