|
|
(One intermediate revision by the same user not shown) |
Line 1: |
Line 1: |
− | The ERC20 token is the most commonly used token standard on the [[Ethereum]] blockchain. As such, it is the most popular token for companies running an [[ICO]].
| + | #REDIRECT [[What are ERC20 tokens]] |
− | | |
− | == Token Functions ==
| |
− | The ERC20 token required functions are:
| |
− | * Get the total token supply:
| |
− | | |
− | <code>function totalSupply() public constant returns (uint);</code>
| |
− | | |
− | * Get the account balance of another account:
| |
− | | |
− | <code>function balanceOf(address tokenOwner) public constant returns (uint balance);</code>
| |
− | | |
− | * Returns the amount which the spender is still allowed to withdraw from the owner:
| |
− | | |
− | <code>function allowance(address tokenOwner, address spender) public constant returns (uint remaining);</code>
| |
− | | |
− | * Send amount of tokens to address:
| |
− | | |
− | <code>function transfer(address to, uint tokens) public returns (bool success);</code>
| |
− | | |
− | * Allow spender to withdraw from your account, multiple times, up to the amount written. If this function is called again it overwrites the current allowance with the value:
| |
− | | |
− | <code>function approve(address spender, uint tokens) public returns (bool success);</code>
| |
− | | |
− | * Send amount of tokens from one address to another address:
| |
− | | |
− | <code>function transferFrom(address from, address to, uint tokens) public returns (bool success);</code>
| |
− | | |
− | * Triggered when tokens are transferred
| |
− | | |
− | <code>event Transfer(address indexed from, address indexed to, uint tokens);</code>
| |
− | | |
− | * Triggered whenever approve is called:
| |
− | | |
− | <code>event Approval(address indexed tokenOwner, address indexed spender, uint tokens);</code>
| |
− | }
| |
− | | |
− | | |
− | == ERC20 Examples ==
| |
− | * [[QTUM]]
| |
− | * [[EOS]]
| |
− | * [[KredCoins]]
| |
− | | |
− | == Links ==
| |
− | [https://blocktorial.com/guides--tutorials/how-to-create-your-own-erc-20-token-in-2o-minutes-or-less Create your own ERC20 token]
| |