-
Setting a token standard like ERC20 increases efficiency and gives us the opportunity to create our own new applications.
-
totalSupply and balanceOf are the functions in the ERC20 Token Standard. They determine how to solve or create new applications, therefore increasing efficiency.
Hello sir, here is a website that can give you a better understanding of the allowance function: The ERC-20 Token Allowance Function
Hope you find this useful!
If you have any doubt, please let us know so we can help you!
Carlos Z.
2. What functions are in the ERC20 Token Standard Interface and what do they do?
Yes sir(s), but could you please describe what those functions do?
If you have any doubt, please let us know so we can help you!
Carlos Z.
I am sorry, but the way I stated it is the best way I can answer the question. Sometimes I cannot write and listen at the same time. Like, when Iâm writing something important down I miss something else Ivan is talking about that might also be important. Itâs not always easy to stay on task.
I know you understand this material I have never been taught can be both overwhelming and confusing.
Thank you,
Joanna Gentry
- All of the ERC20 tokens are following the same standard so they can all be programmed the same. An example is an exchange. It can write trading methods that are the same for all tokens.
contract ERC20 {
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);
}
And here is what they do: https://medium.com/blockchannel/the-anatomy-of-erc20-c9e5c5ff1d02#:~:text=ERC20%20defines%20the%20functions%20balanceOf,of%20an%20example%20ERC20%20contract.
-
What are the benefits of setting a token standard like ERC20?
A standardized token setting makes all tokens to interact seamlessly with the same standard -
What functions are in the ERC20 Token Standard Interface and what do they do?
balanceOf() shows the balance of tokens in an address
transfer() transfer tokens from ownerâs address to another address
approve() allow token owner to give a smart contract an approval to send a certain amount of token as allowence.
doSomething() execute an instruction
transerFrom() allow to take tokens from ownerâs account and carry on its work.
allowence() allow tokens to be transfer from given address to another given address
-
What are the benefits of setting a token standard like ERC20?
A standard, like ERC20, allows for efficiency between multiple tokens and wallets. -
What functions are in the ERC20 Token Standard Interface and what do they do?
totalSupply will indicate how many of a specific token are in circulation. balanceOf will indicate the amount of a specific token held in that wallet.
2. 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.
- transferFrom() : transfers a number of tokens directly from an account to another address. Used with approve() function.
- approve() : approval to transfer up to a certain number of tokens, known as an allowance.
- allowance() : provides the number of tokens allowed to be transferred from a given address by another given address.
Hope this gives you a clear view of the subject, keep learning!
If you have any doubt, please let us know so we can help you!
Carlos Z.
Hi Carlos - thanks very much!
1 so that it Is recognized through exchanges and wallets
2 totalSupply for the number of fungible tokens and balanceOf for specific accounts
By allowing wallets to provide token balances for hundreds of different tokens and creating a means for exchanges to list more tokens
The balanceOf()
function provides the number of tokens held by a given address.
The transfer()
function transfers a number of tokens directly from the message sender to another address.
Doer
has a function doSomething()
that requires 10 Do tokens to operate. Joe wants to call doSomething()
and has 50 Do tokens in his account. How can Joe pay Doer so that it can run doSomething()
successfully?
approve()
and transferFrom()
are two functions that allow the above scenario to work using a two-step process.
-
Standards help the industry to grow faster, because adoption is faster. The interoperability of different developments/tokens in an ecosystem with standards is simply better. Firstly, it is easier for programmers, since they can rely on certain standards and do not have to start from zero. Secondly, it is easier for users, since their infrastructure (in this case wallets) work immediately with new developments/tokens
-
ERC20 functions:
- Transfer() transfers tokens from one account to another
- Approve() approves that a specific amount of tokens can be transferred to another account
- transferFrom() is used to take the allowed tokens, specified by the approve()-function
- allowance() shows how many tokens can be transferred from one account to another (allowed by the approve-function) when a specific event takes place. However only if the sender account has enough funds. If not the transaction is not taking place.
- balanceOf() shows the # of tokens a particular account has
- What are the benefits of setting a token standard like ERC20?
The benifit is that all tokens based on the ERC20 standard can be treated in a uniform manner by the users/clients of the Token, as you know that certain functions and variables always are available - hence it is easy for an exchange to implement a new coin based on the ERC20 standard, in an existing framework - What functions are in the ERC20 Token Standard Interface and what do they do?
Examples of functions in the ERC20 standard:
- balanceOf: The number of tokens held by a given address - adjusted by the decimals parameter in the current ERC20 contract definition
- transfer: just transfers from one address to another a specified number of tokens
- approve: Gives the right to another address to transfer a given amount of tokens from the issuer of the allowance call to the specified address
- transferFrom used by the allowance address specified in 4. to transfer x amount of tokens from the from address issuing the approve call
- allowance - query an given address for the allowances given to other addressess - this is public information on the blockchain
-
Easier for wallets communicate with all tokens when they share the ERC20 standard. More efficient.
-
There are several functions in ERC20.
balanceOf() - gives balance
transfer() -details of movement of tokens
approve() - emits details of approval of token
transferForm()- used to pay for smart contract when you want it to do something
doSomething() - it does something
allowance() - allows a particular address to transfer a set amount of tokens
-
What are the benefits of setting a token standard like ERC20?
All tokens have same standards, same construction -
What functions are in the ERC20 Token Standard Interface and what do they do?
totalSupply - max possible token supply
balanceOf - balance of tokens on wallet
transfer - transfer of certain amount of tokens to specific address
transferFrom - transfer of specific amount of tokens from one address to the other address
approve - owner allows to send tokens from wallet to other address
allowance - states how many tokens are allowed to be transferred by another address
-
benefits are similar as in every field of technology (e.g. ports and interfaces in computer hardware). Standards are created to unite applications, developers and environments in terms of ease of use, compatibility, economy and performance.
In particular ERC20 standard is used for smooth interaction of ethereum network with all the tokens and smart contracts built on top of that (e.g. wallets and exchanges will not have to adapt for newly created tokens in slow and difficult way and won´t have to build and update for every single one, instead new token can be adopted and used immediately because of standardised functions). -
functions in ERC20 standard:
- totalSupply() - Get the total token supply
- balanceOf() - Get the account balance of another account
- transfer() - transfers a number of tokens directly from the message sender to another address
- approve() - approval to transfer up to a certain number of tokens
- transferFrom() - Send value amount of tokens from address to another address
- allowance() - provides the number of tokens allowed to be transferred from a given address
by another given address
-
Benefits of using a token standard mean that there is a âconstantâ in all fields of an ERC20 token, meaning that it is universally accepted by all wallets to recognize the fields that are set.
-
Some examples of functions in ERC20 standard include:
âbalanceOf()â - Provides the balance of an address.
âtransfer()â - Allows the owner of a smart contract to send a transaction.
âtotalSupply()â - States the total supply of tokens.
-
Benefits being they can operate on the ETH network. Erc-20 has a standard and it helps a frictionless market.
-
Total supply⌠Iâm not 100% on full answer. Is it the ability for wallet to talk to them⌠Help appreciated
Rob
- the standard allows for token applications to communicate more efficiently with each other as they use a common glossary of functions
- totalSupply() - gives the total token supply of tokens possible
- balanceOf() - gives a specific accountâs balance
- transfer() - transfers tokens between addresses
- approve() - approves the transfer of tokens
- transferFrom() - the address from which tokens are sent from
- allowance() - limits the number of tokens allowed to be transferred from an address
- Every wallet and exchange can communicate with a erc 20 token. Because everyone uses programming language erc 20
2.balanceOf(): provides the number of tokens held by a given address.
transfer(): transfers tokens directly from the message sender to address.
Approve(): a token holder gives address approval to transfer up to a certain number of tokens(allowance).
TransferFrom(): take tokens from senderâs account and carry on its work.
DoSomething(): to operate instructions.
allowance(): provides the number of tokens allowed to be transferred from a address to an other address