ERC-20

From Vulnerapedia
Jump to navigation Jump to search

Ethereum Request for Comments 20 is a fungible token standard that implements an API for tokens within smart contracts. It provides basic functionality to transfer tokens between accounts, getting the token balance of an account and the total supply of the token available on the network, as well as allows tokens to be approved so they can be spent by another on-chain third party. It allows smart contracts to act similarly to a conventional cryptocurrency like Bitcoin, or Ethereum itself.

ERC-20 Vulnerabilities

see ERC-20 vulnerabilities

before Token Transfer

after Token Transfer

ERC-20 Token Contracts

Smart contracts that implement ERC-20 processes are called ERC-20 Token Contracts, and they keep track of created tokens on Ethereum. Numerous cryptocurrencies have launched as ERC-20 tokens and have been distributed through initial coin offerings.

Methods

function name() public view returns (string)
function symbol() public view returns (string)
function decimals() public view returns (uint8)
function totalSupply() public view returns (uint256)
function balanceOf(address _owner) public view returns (uint256 balance)
function transfer(address _to, uint256 _value) public returns (bool success)
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
function approve(address _spender, uint256 _value) public returns (bool success)
function allowance(address _owner, address _spender) public view returns (uint256 remaining)

Events

event Transfer(address indexed _from, address indexed _to, uint256 _value)
event Approval(address indexed _owner, address indexed _spender, uint256 _value)

History

ERC-20 was introduced by Fabian Vogelsteller and Vitalik Buterin on 19 November 2015 as an Ethereum Improvement Proposal [1][2][3]

External links

References