Homework: ERC20

  1. What are the benefits of setting a token standard like ERC20? By having a set standard for coding smart contracts it allows for tokens deployed on the Ethereum network to already be supported by exchanges and wallets.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    • totalsupply: Equals sum of all balances
    • balanceOf(): Provides number of tokens held by given address
    • transfer(): Transfers number of tokens directly from message sender to another address. No checks made on recipient address.
    • approve(): Token holder gives another address (usually of a smart contract) approval to transfer up to a certain amount of tokens (allowance) as part of the contract’s operation.
    • transferFrom(): Takes tokens from account
    • allowance(): Provides number of tokens allowed to be transferred from given address. Can exceed address’ balance
1 Like

1- the token settings are standardized and allow them to communicate easily
2-totalSupply-in all cases shows maximum number of tokens that exist
balanceOf-gives available token balance for an account
transfer- allows user to approve and send tokens to another account

1 Like
  1. Standard like ERC20 allows interoperatibility between tokens and it is easier to make transaction between different wallets.

  2. Basic functions are:
    totalSupply () - determine the total amount of tokens
    balanceOf () (address account) - balance of the token in the address
    transfer () - this function allows to transfer tokens from one address to te other.

1 Like

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 more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

1 Like
  1. ERC20 defines a common list of rules that all Ethereum tokens must adhere to. Some of these rules include how the tokens can be transferred, how transactions are approved, how users can access data about a token, and the total supply of tokens. It ensures compatibility between the many different tokens issued on Ethereum.
  • the balanceOf() function provides the number of tokens held by a given address.

  • the totalsupply equals the sum of all balances and shows how many tokens are in circulation

  • the transfer() function transfers a number of tokens directly from the message sender to another address.

1 Like
  1. What are the benefits of setting a token standard like ERC20?

All tokens created on top of Ethereum under the ERC20 standard would use the same syntax and commands. One benefit is that this allows all ERC20 wallets to interact with all ERC20 tokens in the same way.

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

The balanceOf() function tells you the balance in a given address.

The totalSupply() function tells you the total token supply on the network.

The transfer() function transfers a number of tokens directly from the message sender to another address.

The allowance() function provides the number of tokens allowed to be transferred from a given address by another given address

1 Like
  1. It’s a Common standard that provides basic features and functions to be used.

  2. totalsum provides the total amount of tokens under an adress. balanceOf returns the balance of a users account.

1 Like
  1. What are the benefits of setting a token standard like ERC20?

It is a universal language that can operate interactively with other compliant tokens. Allows wallets to provide token balances for hundreds of different tokens, is fast and efficient.

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

• Functions balance of
• Total supply
• Transfer
• Transfer from
• Approve
• Allowance

1 Like

1-The benefits of setting a token standard like is ERC-20 is that it defines how tokens are programmed. A token standard permits all exchanges and wallets to be programmed to support all tokens. This eases friction and allows scalability.
2-balanceOf() provides a certain address the number of tokens being held
-totalSupply() is the entire amount of a certain token’s supply
-transfer() permits transfer of their ERC 20 tokens from one public address to another
-doSomething() operates instructions
-allowance() -provides the number of tokens allowed to be converted/transferred from one address to another
-approve() - it authorizes a transfer of a certain amount of tokens to another address. It is a two step procedure

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Different wallets exchanges and interact with the various tokens because they use a common programming language.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Totalsupply gives number of tokens, balanceOf gives available token balance for an account, transfer is used to send to other account whereas approve allows user to approve the transfer to a function.

1 Like
  1. ERC20 tokens enable wallets and exchanges to implement with ease new tokes. Also it increases efficiency and permits token operability on platforms and wallets with ease.

balanceOf() - provides the number of tokens held by a address
transfer() - transfers a specific amount of tokens directly to another address.
approve() - give a address approval to transfer a specific amount of funds from the given address; it gives permision to take necessary funds to perform requests within a smart contract
allowance() - the maxium amount allowed to be transfered to a address by the approve() function
transferForm() - performs funds transfer by another address

1 Like
  1. Token standards increase efficiency. If tokens are made with the same conventions, they can be supported by 3rd parties in the same way, and those parties can deal with one another in the same way.

  2. The function balanceOf() provides the # of tokens at given address. The function transfer() updates account balances, sending tokens from one account to another. The function approve() gives a smart contract allowance to the assets so that it can receive any necessary payment for the execution of the smart contract. The function transferFrom() transfers approved assets. The function allowance() provides the # of tokens that a given address has approved for a smart contract.

1 Like

1: The benefits of setting a standard are that you have all the programmers working with the same code for the ERC20 tokens. This helps smart contracts workday one across the entire ETH network.

2: balence0f give the specific balance of the account, totalsupply gives the number of total fungible tokens they have.

1 Like

1.)What are the benefits of setting a token standard like ERC20?
-Standards for tokens allow for interoperability between smart contracts, tokens, wallets, exchanges, and other systems on the platform.

2.)What functions are in the ERC20 Token Standard Interface and what do they do?
-The totalSupply() function gives you how many tokens are in circulation
-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
-The allowance() function provides the number of tokens allowed to be transferred from a given address by another given address

1 Like
  1. It enables everyone in the ecosystem to support any token adhering to the standard, because they know how to communicate with its smart contract.

  • name(): returns the name of the token

  • symbol(): returns the symbol of the token

  • decimals(): returns the decimals to use for presenting the token to the user (Ethereum internally does not support decimals)

  • totalSupply(): returns the total token supply (sum of all balances of the smart contract)

  • balanceOf(address _owner): returns the balance of a given account (_owner)

  • transfer(address _to, uint256 _value): transfers a given amount (_value) of tokens from the caller’s account to another account (_to)

  • transferFrom(address _from, address _to, uint256 _value): transfers a given amount of tokens (_value) from one account (_from) to another (_to)

  • approve(address _spender, uint256 _value): allows another account (_spender) to repeatedly withdraw tokens from the caller’s account, up to a given amount of tokens (_value)

  • allowance(address _owner, address _spender): Returns the remaining amount that one account (_spender) is allowed to withdraw from another (_owner)

2 Likes
  1. A token standard ERC20 has lots of benefits what comes to communication on the network.
    It is as if everyone speaks english at work, versus every employee speaking different languages.
    If everyone speaks a different language, you wouldn’t get a lot done!

  2. Examples of functions in the ERC20 Token Standard Interface:
    balanceOf - retrieves a balance of a particular account
    totalSupply - finds tokens in circulation
    transfer - sends tokens to a different address

1 Like
  1. What are the benefits of setting a token standard like ERC20?

Allows for interoperability and seamless integration with other smart contracts, tokens etc on the network.

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

Balance of () Provides the number of tokens held by a given address.
Transfer () Transfers number of tokens to another address.
Approve () Approval of tokens from one address to another.
TransferFrom () Sends the transaction from specified address.
Allowance () Provides the number of tokens allowed to be transferred.

1 Like
  1. By setting a token standard such as ERC20 it enables developers to keep to the standard formats prescribed. This means tokens can be supported on many exchanges and servers and wallets. It promotes a high standard and reduces admin friction.
  2. It provides functionalities like:
    • to transfer tokens from one account to another, (transfer), (transferFrom)
    • to get the current token balance of an account (balanceOf)
    • to get the total supply of the token available on the network (totalSupply)
    • to approve that an amount of token from an account can be spent by a third party account (approve).
    Also such functions as (name), (symbols), (decimals).
1 Like
  1. The benefits of setting a token standard like the ERC20 are that the different wallets can use the same structure and that the tokens are fungible so that it can work efficiently.
  2. In ERC20 there are functions such as totalsuplly() and balanceOf(adressacount). The first specifies how many Tokens there are totally, and the second the amount of Tokens on a specific account…
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    It allows for sharing information & use of tokens across platforms more efficiently and with less friction. For instance it allows your wallet to show you balances in many different types of tokens because they use the same standards.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?

balanceOf function - provides number of tokens held by a given addresss

transfer function - transfers a number of tokens directly from the message sender to another address

approve and transferFrom function - token holder gives another address approval to transfer up to a certain number of tokens from them. Then doSomething() will use transferFrom() to take specific amount of tokens required for an action from that person’s address.
Summary: Approve function gives allowance for transfer, transferFrom function enables the transfer (granted there is enough tokens in the wallet to pay).

1 Like