-
What are the benefits of setting a token standard like ERC20? It effectively allows smart contracts to act like Bitcoin, or Ethereum itself. In saying this, a token hosted on the Ethereum blockchain can be sent, received, checked of its total supply, and checked for the amount that is available on an individual address.
-
What functions are in the ERC20 Token Standard Interface and what do they do?
{
function totalSupply() constant returns (uint theTotalSupply);
function balanceOf(address _owner) constant returns (uint balance);
function transfer(address _to, uint _value) returns (bool success);
function transferFrom(address _from, address _to, uint _value) returns (bool success);
function approve(address _spender, uint _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
-
Token standard like ERC20 allows wallets and exchanges easy integration with new cryptocurrencies which are developed based on ERC20. ERC20 act as a platform for new curreincies to be easily adapted by wallets and exchanges.
totalsupply: Equals the sume of all balances.
balanceOf(): returns the number of tokens held by a given address
transfer(): transfers a number of tokens from the sender to another address.
approve(): This function is used by an account holder to approve transfer of tokens known as allowances
transferFrom(): This functions is used after creating allowances to transfer the allowances.
allowance(): Number of allowed token to transfered from one account to another.
Standard helps token adoption from the very inception. Wallets and and listings already have support for all ERC20 tokens.
For regular transactions:
- balanceOf() to get amount of tokens on any given address.
- transfer () to transfer directly between addresses.
For use in a smart contract:
- allowance() to setup allowance to transfer certain amount of tokens to smart contract or other address.
- approve() to approve allowance.
- transferFrom() to actually transfer tokens and if successful proceed with the function of the smart contract.
Impressive!
Homework: ERC20
Q1: What are the benefits of setting a token standard like ERC20?
A1: Setting the ERC20 standard and its adoption allows the token environment to flourish. New tokens can work with existing wallets and can be added to exchanges more easily with its standardized language.
Q2: What functions are in the ERC20 Token Standard Interface and what do they do?
A2: The functions that make up an ERC20 are:
name- the long name of the token
symbol- the short name of the token like a stock ticker name
decimal- sets with the token is an integer or fractional
totalsupply- pulls the total supply of the tokens in the contract
balanceOf()- provides the balance of a given account which is available on the public blockchain
transfer()- moves and keeps record of tokens sent directly from sender account to another account, note there are no address checks so the sender must be certain of the address they are sending to
approve()- is used in a transaction by a token holder to approve a certain amount of allowance the smart contract has to do an transaction
transferFrom()- once the token holder has approved the allowance the contract is created by using the allowance by way of the transferFrom() function
- A standard decreases friction on the market for example wallets can support all tokens that comply with a certain standard, new and old. Development mves faster with standards. The standard creates security and network effects on the Ethereum blockchain.
- The functions are mainly Balance, transfer and allowance. The balance functions show the token balance on each adress, the transfer function defines how transfers can be made between addresses and the allowance function how many tokens a particular address may send to another given address.
- What are the benefits of setting a token standard like ERC20?
There are severable benefits, wallets and exchanges can inter-operate with the tokens to obtain necessary information. There is no friction and the entire network is scalable and very efficient. - What functions are in the ERC20 Token Standard Interface and what do they do?
There are several functions for example
balanceOf()
function provides the number of tokens held by a given address.
transfer()
function transfers a number of tokens directly from the message sender to another address
approve()
approval to transfer up to a certain number of tokens, known as an allowancetransferFrom()
can take tokens from a users account and perform a task as per smart contract.
allowance()
function provides the number of tokens allowed to be transferred from a given address by another given address.
Transfer()
which emits details of the movement of tokens from one address to another.
Approval()
which emits details of approvals of tokens from one address to another.
Token standards allow for much easier implementation and integration of new/existing tokens on any given platform/service and ensure that they are all interoperable with others on the network.
They include, but are not limited to:
decimals - returns the maximum amount of denominations said currency can be split into
transfer - transfers value from own account to another
totalSupply - returns the total circulating supply of said token
balanceOf - returns account balance of another account
approve - allows user ‘X’ to withdraw funds from your account up to specified limit
- What are the benefits of setting a token standard like ERC20?
That all applications like exchanges, wallets and others can use that same standard and it will apply for all tokens, which makes communication and integration way easier.
- What functions are in the ERC20 Token Standard Interface and what do they do?
balanceOf()
provides the number of tokens held by a given address.
transfer()
transfers a number of tokens directly from the message sender to another address.
approve()
gives another address approval to transfer up to a certain number of tokens.
transferFrom()
takes the address of the sender, the address of the receiver and the number of tokens to be transferred. Then gives an output of success or failure.
allowance()
provides the number of tokens allowed to be transferred from a given address by another given address.
-
We need a token standard to decrease amount of frictions when we interract between different projects within the ecosystem. Developing using standrads simplifies a lot the process of integration.
-
balanceOf() function provides the number of tokens held by a given address.
transfer() function transfers a number of tokens directly from the message sender to another address.
transferFrom() takes the address of the sender, the address of the receiver and the number of tokens to be transferred. Then gives an output of success or failure.
allowance() provides the number of tokens allowed to be transferred from a given address by another given address.
approve() gives another address approval to transfer up to a certain number of tokens.
- It created a common set of features and interfaces to create tokens interacting with the Ethereum blockchain. It integrates wallets with exchanges.
- It allows for the function of transferring, minting, burning, and mapping of the total supply.
-
The benefits of setting a token standard like ERC20 include easy integration, adoption, and use by exchanges and wallets.
-
Functions in the ERC20 Token Standard Interface include totalSupply() which returns the total number of fungible tokens in existence, transfer which transfers a certain number of tokens from one account to another, and balanceOf() which returns the total balance of a given account.
- It’s important to have a standard for many reasons: it’s easy to make new token following the standards, new tokens can easily be supported by exchanges and wallets, ecosystem is growing
- balanceOf() - provides the number of tokens held by a given address
transfer() - transfers a number of tokens directly from the message sender to another address
approve() - appoving the transer of tokens from one address to another
allowance() - provides the number of tokens allowed to be transferred from a given address by another given address
-
It allows all wallets to easyily use erc20 tokens
-
balanceOf gives the sum of all the balances held by a specific address
transfer allows tokens to transfer from one person to another person
Programmers and projects will reuse the same functions and structures. All will work in the same way rather than writing their own from scratch.
balanceOf() returns the account balance, transfer() moves tokens from one account to another, totalSupply() tells how many tokens are in circulation, approve() shows the token holder agrees to the transfer
1, Benefits of ERC20 for the users is the ability to talk to each other by using the same standards on a common set of features and interfaces.
2. The functions in ERC20 Token Standards Interface include: balance - which shows the number of tokens at that address; transfer - number of tokens going to another address.
- What are the benefits of setting a token standard like ERC20?
Having the same standard across the board. ERC20 standard means that various platforms utilise the same specific coding instructions. - What functions are in the ERC20 Token Standard Interface and what do they do?
The ERC20 functions allow users to find out the balances of accounts as well as to transfer them from one account to another under varying conditions by using the following functions eg. balanceOf(), transfer(), Approval()
1. What are the benefits of setting a token standard like ERC20?
A: It allows for use of conventional naming of functions so that all members of the development community knows that a specified function has the same use in all ERC20 tokens. This brings efficiency to the economy created by Ethereum.
2. What functions are in the ERC20 Token Standard Interface and what do they do?
A: totalSupply(): how many tokens in circulation
BalanceOF(address account): qty of tokens in the wallet
transfer(): specifies how many tokens are to be moved between wallet addresses
-
What are the benefits of setting a token standard like ERC20?
The ERC20 standard defines how the tokens are programed which is good so that they are supported by all wallets, exchanges and communicate with one another. -
What functions are in the ERC20 Token Standard Interface and what do they do?
““totalSupply”” is the funtion that all ERC20 tokens have and gives how many tokens are in circulation.
““balanceOf”” gets the balance of an address
““transfer”” Transferes tokens
1, By implementing the ERC20 standard, your token is compatible with other entities such as ERC20 compliant wallets.
2, There are 6 functions defined in the ERC20 interface.
balanceOf() - provide balance of given address
totalSupply() - get total amount of token that exists in circulation
transfer() - transfer given amount to specified address
transferFrom() - automatable transfer of given amount from specified “from” address
approve() - authorises given address to withdraw
allowance() - tells how much the owner address has allowed the spenderAddress to spend
-
All exchanges and wallets can accept tokens from day 1 as they all work under the same set of instructions. Easier implementation in less words
-
balanceOf() - to get balance of a specific wallet address
totalsupply() - sum of all balances
transfer() - transfer amount from sender to receiver