Homework: ERC20

  1. Standard ERC20 makes the whole token ecosystem more efficient. It enabled to merged thousands of tokens under one hood. Lets say, we have a wallet app and want to check balance of any account, to do that we could simply use a standard command in standard based system. In non standard system, we will probably have to write thousands of different command to get the same information for each different token.

  2. Just a few of them:
    Total supply () - Number of token created;
    BalanceOf () - account balance;
    Transfer () - transfers tokens from one account address to other.

1 Like

Greetings, and of course. I do not know all the functions but for example the [totalsupply] funciton gives one how many tokens are currently in circulation and [balanceOf(address account)] is used to find the balance of a designated account.The functions are used by buidlrs to communicate more efficiently with one another. With everyone on the same standard of naming conventions it becomes easier for the community to communicate with each other.

2 Likes
  1. It benefits the network to have a standard coding or language on all ERC20 tokes to run smoothly between wallets and exchanges

  2. ERC20 ( Ethereum request for comments)
    We have 6 required functions to follow 1. Total supply = when total supply is reached no new tokens can be produced . 2. Balance of = tells you how many tokens an addresses the contract has .3. transfer =it gives an amount of tokens from the total supply to a user 4. Transfer from = allows user to transfer to another user . 5. Approve = verifies that the smart contract can give a certain amount of tokens to a user verifying the total supply of tokens. 6. Allowance = to verify that the user has enough valance to transfer any amount of tokens to another user.

and three optional functions are =

  1. name
  2. symbol
  3. Decimals
3 Likes
  1. Standardization means all wallets can understand what’s written on the blockchain. They dont need to know many languages or variations.

  2. I assume there are many functions some of which include balanceOf, totalSupply

1 Like
  1. Those tokens will be recognized by wallets and exchanges in this way making them more available to the community.
  2. one function is totalSupply() for the maximum number of tokens in existence
    another one, balanceOf() balance of tokens for an public address.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • When its the standard it makes it easier for them to communicate with each other within the ecosystem for example wallets and exchanges
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • totalsupply - This provides the total amount of units or tokens in supply
  • balanceOf - Is the quantity or balance of the tokens for a particular address or wallet
  • transfer - stipulates the movement the balance or tokens to another address or wallet
  • allowance - would stipulate the amount of funds to be transferred between addresses or wallets
  • approval - The owner or token holder approves the allowance to be transferred between addresses or wallets
1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
    To provide a common set of features and interfaces for token contracts in Ethereum. The ERC-20 commands vital importance, because it defines a common list of rules that all Ethereum tokens must adhere to. Consequently, this particular token empowers developers of all types to accurately predict how new tokens will function within the larger Ethereum system. This simplifies and eases developers’ tasks, because they can proceed with their work, knowing that each and every new project won’t need to be redone every time a new token is released, as long as the token follows the rules. Fortunately, so far the vast majority of token developers have fallen in line with ERC-20 rules, meaning that most of the tokens released through Ethereum initial coin offerings are ERC-20 compliant.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    The functions are:

  • totalSupply : Returns the total circulating amount of tokens.
  • balanceOf : Returns how many tokens exist in an account.
  • transfer : Transfer an amount of tokens from token owner’s account to another account.
  • approve : A token owner can approve for spender to transferFrom tokens from the token owner’s account.
  • allowance : Returns the amount of tokens approved by the owner that can transferred to the spender’s account.
  • transferFrom : Allows a spender account to transfer an amount of tokens on behalf of the token owner to another account.
1 Like

1* The benefit is efficiency making different tokens exchange easily allowing wallets to provide balances for different tokens.
2* balanceOf(): provides the amount of tokens held at a given address.

transfer(): Allows tranafer of their ERC20 tokens to another public address.

doSomething(): operates instructions

approve(): Gives another address approval to transfer a certain number of tokens

1 Like
  1. It creates a common way of working in programming, e.g. a common naming convention for functions.
  2. Functions:
  • totalSupply is checking the total number of tokens in circulation
  • balanaceOf gets the balance of a certain address
  • transfer transfers tokens
1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
  • If we set a token standard like ERC20 it is so much easier because tokens then become fungible, and like this they immediately become accepted by all the wallets and network.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • function of totalSupply - it lets us know how many tokens there is in circulation
  • function of balanceOf (adress account) - it lets us know how many token balance is on this adress
  • function transfer - it is a function for transfer
  • function approve - it approves someone to spend tokens for certain purpose
  • function allowance- it tells us which adress is given what amount of tokens to be spent
    There is many more standards in ETC20 this are just couple of them mentioned :slight_smile:
1 Like
  1. Thanks to standards like ERC20, all exchanges and wallets will be able to support tokens from day one. And this makes everything more efficient.
  2. Tthe totalSupply function of the token must be set and, once the maximum is reached, no further tokens can be created from the smart contract.
    The balance0f function assigns an initial token number to any specified address.
    The transfer function moves the tokens from the total supply to any individual user who purchases during the ICO phase.
    The transferFrom function is used to send tokens from one person to another.
    The approve function verifies that a smart contract can distribute tokens, based on the remaining supply.
    The allowance function makes sure that one address has enough balance to send tokens to another address.
1 Like
  1. The same standards allow for easier and more efficient exchanges.
  2. total supply() - number of existing tokens
    balanceOf() - number of tokens in an account
    transfer() - move tokens from one address to another
    approve() - approval to transfer tokens
    allowance() - number of tokens allowed to be transferred to another address
1 Like
  1. All using same standard ERC20 will improve better Token implementation and execution become easy for developers. Will be easy adopted by all Exchanges and Wallets. Also ERC20 tokens offer higher liquidity.

  2. function totalSupply - total supply of Token
    function balanceOf - the account balance.
    function transfer - for sending tokens from one user to another.
    function doSomething - that requires tokens to operate.

    function alloowance - provides the number of tokens allowed to be transferred from one address to another address.

    function Transfer - movement of tokens from one address to another.
    function Approval - which specify a details of approvals of tokens from one address to another.

1 Like
  • What are the benefits of setting a token standard like ERC20? That the wallets and exchanges will support all tokens with this standard without problem as they have the same naming in their code.
  • What functions are in the ERC20 Token Standard Interface and what do they do?totalSupply() = the total existing number of tokens
    balanceOf() = balance of tokens held by a given address
    transfer() allows someone to transfer their tokens to another public address
    approve() = gives another address approval to transfer a an amount of funds from the given address. Smart contracts are given permission to take the necessary funds needed to perform requested operations .
    allowance()= how many tokens are in the allowance
    transferFrom()= request to perform the transferring of funds by another address.
1 Like
  1. Makes communication smooth and easy. Reduces friction in the economy.

  2. 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.
    allowance() provides the number of tokens allowed to be transferred from a given address by another given address

1 Like

Hello sir, the balanceOf() function does not let you control the wallet, it just show up the balance of the account. Also, please, would be great if you could describe more detail what every functions does.

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

No problem at all sir, we are here to help you clear every doubt you may have, don’t by shy to ask for help, we want you to truly understand everything about the course.

Check this one to give you a better idea: MyAnswers.

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

Much better sir, thank you and congratulations for describing some of the functions! :muscle:

Check this one to give you a better idea: MyAnswers.

Hope this gives you a clear view of the subject, keep learning! :slight_smile:

Carlos Z.

1 Like

2. What functions are in the ERC20 Token Standard Interface and what do they do?

Hello sir, could you please describe a little bit more what every function does exactly?

If you have any doubt, please let us know so we can help you! :slight_smile:

Carlos Z.

  1. A standard opens up ways for the whole eco-system to interact, even between different tokens. Furthermore, other applications like wallets can easily integrate new tokens when they adhere to the common interface.

  2. The ERC20 interface consists of the following functions

  • totalSupply()
    – Returns the sum of balances of all addresses in the contract.
  • balanceOf(address tokenOwner)
    – This function expects an address as parameter and returns the balance of tokens owned by it.
  • transfer(address to, uint tokens)
    – The owner of an address can use this function to directly transfer tokens to another address within the contract
  • approve(address spender, uint tokens)
    – If a user wants to execute a function in the contract, e.g iCost10Tokens(), they cannot just simply use transfer() for this. Instead they first allocate a so called allowance up to which the spender is allowed to consume.
  • transferFrom(address from, address to, uint tokens)
    – Continuing the example from approve(), transferFrom() would be invoked by iCost10Tokens() in order to cover the costs of execution. If the required amount is not present in the allowance, the execution of iCost10Tokens() will fail.
  • allowance(address tokenOwner, address spender)
    – This function returns the allowance that tokenOwner setup for spender
1 Like