-
Because it contains the same language which promotes communication between wallets and all users.
-
totalSupply () β how many tokens that are in circulation.
BalanceOf () - How much tokes that the balance has in a specific wallet.
transfer () β Transfer tokens from one address to another.
-
This standard connects the whole space. Allowing tokens to easily interact with other products (wallets, exchanges).
-
Functions on ERC20 are blocks of code meant to perform specific actions.
Examples:
2.1. balanceOf() gives you the address of a particular address.2.2. totalSupply() tells you how many tokens are in circulation.
2.3. allowance() gives you the number of tokens allowed to be transferred from one address to another.
What are the benefits of setting a token standard like ERC20?
- All Smart Contracts are derived from the standard, have the same functions and coding, so they can interoperate (successfully without errors) within the ecosystem, being fungible they are the same and unique in their makeup.
What functions are in the ERC20 Token Standard Interface and what do they do?
- totalSupply() - in circulation;
- balanceOf() - tokens at the address;
- transfer() - from this contract to an address;
- approve - to contract address;
- allowance() - maximum number of tokens permitted for transfer to address, and;
- transferFrom() - removes tokens from this account.
- With a token standard such as ERC20 functions will be coded the same in all the tokens on that network meaning that apps built to interact with these tokens will be able to use the same functions each time
- totalSupply - returns the total supply, balanceOf() - returns the account balance, transfer()- transfers tokens to the given address, approve(), transferFrom() and doSomething() are used to make payments and carryout functions in smart contracts
- What are the benefits of setting a token standard like ERC20?
- Listing on exchanges becomes as simple as copying a contract address. Also, a common standard allows wallets to provide token balances for hundreds of different tokens.
- What functions are in the ERC20 Token Standard Interface and what do they do?
-
Transfer()
andtransferFrom()
emit details of the movement of tokens from one address to another. TheApprove()
event emits details of approvals of tokens from one address to another. ThebalanceOf()
function provides the number of tokens held by a given address
What are the benefits of setting a token standard like ERC20?
Ensures that wallets and external apps can interact with any number of different smart contracts that implement the same ERC20 contract in the same way. This reduces impedance in the system and ensures new token contracts can be deployed seamlessly to the blockchain
What functions are in the ERC20 Token Standard Interface and what do they do?
//returns the name of the Token
function name() public view returns (string)
//returns the symbol of the Token eg BAND
function symbol() public view returns (string)
//returns the number of decimals for the token
function decimals() public view returns (uint8)
//returns the total supply of tokens
function totalSupply() public view returns (uint256)
//returns the balance of a given token for an address
function balanceOf(address _owner) public view returns (uint256 balance)
//transfers a balance to an address
function transfer(address _to, uint256 _value) public returns (bool success)
//transfers a balance from one address to another. The approve function is called beforehand to allow the smart contract itself the right to transfer the money from the account_from account to another account
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
//allow a delegate account to withdraw amount from senders address. The _spender is usually the address of the token contract
function approve(address _spender, uint256 _value) public returns (bool success)
//returns the number of tokens approved by the owner that the spender can withdraw
function allowance(address _owner, address _spender) public view returns (uint256 remaining)
//an event generated when a transfer from one address to another is made
event Transfer(address indexed _from, address indexed _to, uint256 _value)
//an event transmitted after an approval has been made ie approve function has been invoked
event Approval(address indexed _owner, address indexed _spender, uint256 _value)
The benefits of setting an erc-20 standard or a standard similar to it are it allows the token to easily interact and integrate with multiple projects with multiple wallets, exchanges, contracts ect
The Functions in the ERC-20 token standard are common functions that every compliant token is expected to support. They perform common token behaviours such as:
totalsupply() gives the max amount of that token that exists
balanceOf() gives the number and balance of all the tokens held by a specific address
transfer() fuction takes in the address of the receiver and the funds that are to be sent to the account
transferFrom() function. It takes in three inputs - the address of the sender, the address of the receiver, as well as the number of tokens to be transferred. then gives an output of the success or failure of the transfer.
-
Due to the similar code found in all ERC20 tokens, such as the many functions they use, exchanges and wallets are able to automatically support them due to them using that standard. It also makes it easier for ERC20 tokens to communicate and be interoperable with each other, as they all use the same basis for code.
-
balanceOF(): reveals the token balance of a specified address.
totalSupply(): Reveals the total supply of the token
transfer(): Transfers a specific amount of tokens from the creator of the message to another address.
approve(): Gives another address approval to transfer tokens.
allowance(): Specifies the amount of tokens allowed to be transferred from a certain address, by another.
transferFrom(): Transfers tokens from an allowance to a specified address.
-
Tokens that are created can communicate with each other, with exchanges and wallets.
-
totalSupply(), how many tokens are in circulation.
balanceOf(address account) how much tokens a certain balance has.
transfer(address recipient, unit256 amount).
etc.
- The benefits of setting a token standard like ERC20 it makes it easier to integrate programs with less friction.
- The functions in the ERC20 are total supply, balance(adress account), transferring and allowance on the tokens.
-
Some of the benefits of setting a token standard is that it makes it easy for others to build their own Dapps and tokens on top of Ethereum. The standards ensure that all of these projects will be compatible with ERC20 wallets. Also, having the standard set up in this way incentivizes ownership and use of ETH, since every ERC20 project requires ETH to function.
-
The functions in the ERC20 Token Standard Interface are totalsupply() which indicates the total circulating supply of the token, blanceOf(account address) which displays the balance of an account, and transfer() which allows someone to transfer their tokens from one address to another.
-
All wallets, platforms and exchanges can add the token easily
-
balanceOf() shows how much tokens an address is holding
transfer() transfers tokens from one address to another
totalSupply() shows how much tokens exist
- What are the benefits of setting a token standard like ERC20?
The benefits of setting a token standard like ERC20 is that when we have the same naming and parameter conventions we can all build applications that can talk with each other. Otherwise everyone would be building their own version of their tokens that will not be able to communicate with one another and that will lead to a lot of friction and inefficiency - What functions are in the ERC20 Token Standard Interface and what do they do?
There are a large number of functions in the ERC20 token standard interface but to give a few examples there are:
totalSupply which gives you how many tokens there are in circulation as well as
balanceOf which when given the address of the account that you want to get the balance of it will give you the total amount of tokens in that account has on their balance to spend.
-
What are the benefits of setting a token standard like ERC20?
ERC20 is a standard that guides smart contract programming with rules so there is consistency in token design. That way there is efficiency in exchange. -
What functions are in the ERC20 Token Standard Interface and what do they do?
totalSupply() for max tokens in existence
balanceOf() for balances of addresses containing ERC20 tokens
transfer() transfer of ERC20 tokens to another address
allowance() number tokens transferred between addresses allowed
approve() user approval to spend tokens from owners account
transferFrom() address of sender, address of receiver, number of tokens to transfer, with
output indicating success or failure of the transfer
-
What are the benefits of setting a token standard like ERC20?
Standards allow interoperability between wallets exchanges and other tokens. -
What functions are in the ERC20 Token Standard Interface and what do they do?
- totalSupply() ->Get the total token supply
- balanceOf() ->Get the account balance of given address
- transferFrom() -> sends funds from an address to another
- approve() ->Allow another address to transfer funds from another
- allowance()->max amount thatβs allowed to be transferred by another address
Homework on ERC20 token standard.
- What are the benefits of setting a token standard like ERC20?
It means all the different t programs and wallet s that need two interact with the token or each other can easily do so as they all have the same language.
- What functions are in the ERC20 Token Standard Interface and what do they do?
Many like :
totalSupply() for max tokens in existence
balanceOf() for balances of addresses containing ERC20 tokens
transfer() transfer of ERC20 tokens to another address
allowance() number tokens transferred between addresses allowed
approve() user approval to spend tokens from owners account
transferFrom() address of sender, address of receiver, number of tokens to transfer, with
output indicating success or failure of the transfer
-
Using a standard such as ERC20 allows for tokens and smart contracts to have uniformity and thus compatibility with one another and with all ETH wallets.
-
balance(): Displays the total balance of tokens held by a specified address
transfer(): Sends tokens from one address to another
approve(): Gives another address permission to send a specified amount of tokens, called an allowance
transferFrom (): Used by an address to accept tokens alloted by another by use of the approve() function
allowance(): Displays the amount of tokens alloted to by one address to another using the approve() function
- Exchanges and wallets will support tokes.
- Totalsupply and balanceof.
- It allows different wallets and applications to communicate in the same language.
-
- totalSupply() is the token supply of the token
- balanceOf() is the account balance of a given address
- transferFrom() sends funds from an address to another
- approve() allows another address to transfer funds from another if the contract is fulfilled
- allowance() is the maximum amount that is allowed to be transferred by another address
-
Because it has a naming standard so all users can benefit from this rather than having to create their own unique code.
-
A couple of examples of functions within ERC20 are balanceOf & totalSupply.