Homework: ERC20

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

Ethereum has made it very easy for anyone to create and issue virtual tokens on its blockchain. This is done with the help of standardized Ethereum smart contracts, such as ERC20. In this way, people, businesses, or governments can issue their own virtual currencies, assets, or application tokens using the Ethereum blockchain, without the need to build their own blockchains.

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

There are various functions within the ERC 20 token standard such as:

balanceof() which will provide a balance of the particular token at a given address

transfer() which will transfer a number of tokens from the sender to another address.

totalSupply() This function returns the number of the total supply of tokens

transferFrom() This function takes from the sender’s address, to the recipient’s address), and the value (amount).

approve() This function takes the recipient and the value (number of tokens) is used to authorize the spender’s address to make transfers on behalf of the token owner up to the approved amount (value)

allowance() This function takes the address of the token owner and the spender’s address and returns the remaining number of tokens that the spender has approval to withdraw.from the token owner.

3 Likes
  1. What are the benefits of setting a token standard like ERC20?
    Exchanges and wallets will be able to support the token. ERC20 is the standard for fungible tokens - so that we can have many tokens and they are all the same from day 1.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply - lets you know total tokens in circulation.
    balanceOf - this function combined with the address give you the token balance in that address.

    Basically, all ERC20 tokens have standard functions that work the same across all tokens - this helps to build application that can talk to one another.

1 Like

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

All the exchanges and wallets will support the projects from etherum network.

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

Balance(): provides the number of tokens held by a given address.
Transfer(): Is a transfer from x wallet to y wallet, is NOT used as a payment method since the smart contract is not available to check the total transfer amount .
doSomething: When the request is allowed to transfer tokens
Approve(): When the tx is approved
TransferFrom() : Linked to the doSomething() and Approved() once is allowed to transfer.
Allowance(): the function that allows a transfer

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    ERC20 is effectively a programming interface that any application can work with; a 3rd party does not need to change code to work with different tokens, they all provide the same interface even if the implementation may be different.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Functions include:
    name (get the name of the token)
    balanceOf (gets the balance of an address)
    Transfer (value from one wallet to another)
    Symbol (get the symbol of the token e.g. ABC)
    Decimals (the number of decimals used in the token)
    totalSupply (gets the total supply of the tokens)
    Transfer (from callers address to another)
    transferFrom (from one named address to another)
    Approve (protects against attacks)
    Allowance (provide an amount the spender is allowed to withdraw)

In addition there are events that can be triggered e.g. transfer and Approval.

2 Likes
  1. What are the benefits of setting a token standard like ERC20?
  • ERC20 standard basically defines how we all program the tokens on top of the ethereum smart contract platform. If all tokens look the same if they function in the same way if the code is laid out in the same way it means that all exchanges and all wallets will be able to support these tokens from day 1, so having this standard way to program, deploy tokens on the ethereum smart contract platform is beneficial for the entire space, also ERC20 is a standard for fungible token and this means that all tokens are identical and have the same value. In ERC20 standard many people can easily deploy tokens on top of Ethereum and launch their own cryptocurrencies.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • ERC20 Token Standard Interface have
    function totalSupply - is a function that all ERC20 tokens have and it just gives you information on how many tokens are in circulation.
    -function balanceOf and it gives us the address of the account that we want to get the balance of and we will get how many tokens that balance has. Meaning that exchanges and wallets when they want to check how much balance we have they will use this function. In order to get the balance of a particular address we use balanceOf function that is present in all ERC20 tokens
  • function transfer - exactly the same in all ERC20 tokens
1 Like

The benefits of a standard token is that all functions for ERC20 are written the same and this makes it easier for everyone to write code.

One of the functions is total of balance this allows you to know the total balance of the address that you want.

1 Like
  1. Provides efficiency and easy integrations for any new or current token within exchanges, wallets, etc.

2.totalSupply() gives maximum number of tokens that exist
balanceOf(address account) gives a public addresses’ balance of ERC20 tokens
transfer() allows someone to transfer their ERC20 tokens to another public address

1 Like
  1. What are the benefits of setting a token standard like ERC20?Allows wallets to communicate with each other and a standard allows everyone to integrate & interoperate to become more efficient and reduce friction.

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

  • function total supply() = Gives you total number of tokens in circulation
  • function balanceOf() How much tokens that balance has
1 Like
  1. By creating standards that are followed by all developers we remove the friction of the development and integration of new projects, thus helping boost the progress of the networks and its products on top of it.

  2. (Not certain for the validity of all the answers)

  • totalSupply : returns total supply of tokens
  • balanceOf : returns the balance of a given wallet
  • transfer : transfer funds from one contract to another
  • transferFrom : transfer funds to between addresses using a third party (eg an exchange)
  • approve : The owner of the contract approves the transfer of funds inside the contract to another party.
  • allowance : Defines the funds that will be transferred from the approve function
1 Like

Answers for Homework on ERC20 token standard:

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

This allows new tokens designed to run on the Ethereum blockchain to be developed quickly and easily in a manner that is compatible with other tokens and contracts in the Ethereum ecosystem. Tokens developed using this standard are also easily implemented on popular exchanges and wallet applications.

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

balanceOf()
Queries the total balance of a token associated with a given address.

transfer()
Sends a given amount of a token from one address to another.

approve() and transferFrom()
These two functions go hand in hand in invoking a smart contract. First, a user uses the approve() function to give a smart contract application permission to use a limited amount of tokens he currently has available on his address. Then, the smart contract begins to execute the user’s request and calls the transferFrom() function to spend the tokens it was allowed to use.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    The ERC20 standard solves a significant problem, as blockchain-based marketplaces and crypto-wallets have a standard set of commands to communicate with the range of tokens they manage. It simplifies things across the network including purchases between different tokens making it more efficient as well.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    The standards in the ERC2- token are:
    balanceOf; provides account balance of the owner’s account
    totalSupply; provides information about the total token supply
    transfer: executes transfers of a specified number of tokens to a specified address
    transferFrom; executes transfers of a specified number of tokens from a specified address
    approve; allow a spender to withdraw a set number of tokens from a specified account
    allowance; returns a set number of tokens from a spender to the owner

1 Like
  1. Token standards ensure that different applications are able to interact with different smart contracts in the same way and this brings consistency and interoperability.
  2. totalSupply -> returns the number of the total supply of that token
    balanceOf -> provides the account balance for a given address
    transfer -> transfers an amount to a specified address and returns true if successful
    approve -> approves a transaction
1 Like

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

  • One benefit of a token standard is that all tokens can easily interact with markets and wallets.

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

  • Some functions are:
    balanceOf() - provides the account balance for a given address
    transfer() - transfers an amount to a specified address and returns true if successful
    approve() - approves a transaction
1 Like

By setting a token standard it means that when people create tokens they will be compatible with everything and much easier to use within the network.

balanceOf() – provides number of tokens held by an address

transfer() – used for sending tokens between addresses, not used for payment to a smart contract

approve() – token holder can approve if he does want to send a certain amount of tokens (known as an allowance) to the smart contract

transferFrom() – after approve() user can send tokens within their allowance into the smart contract

allowance() – how many tokens the user wants to approve to be able to send to contract.

1 Like
  1. The benefit of having a token standard like ERC20 is that interoperability of tokens is possible.

  2. The functions in the ERC20 Token Standard Interface are:

  • balanceOf() : provides the number of tokens held by an address
  • transfer() : transfers tokens from sender to recipient address
  • transferFrom() : similar to transfer(), but used to transfer tokens that are used as payment for a function in a smart contract
  • approve() : provides information to be used in the transferFrom() function
  • allowance() : provides the number of tokens to be transferred from sender to recipient
1 Like

ERC-20

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

The benefit is that all tokens based on the same standards will be interoperable. Wallets, exchanges, even developers and projects can share operability if desired.

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

Function:

name() - The name of the token i.e. “Ethereum.”

symbol() - The token abbreviation i.e. “ETH”

decimals() - The number of decimals the token uses i.e. 0.12345678 vs 0.0

totalSupply() - The total number of tokens in circulation.

balanceOf(address _owner) - The total number of tokens credited to a specific address

transfer(address _recipient, _amount) - Transfers tokens from the sender’s account to another user’s account address (_recipient), a specified number of tokens (_amount)

approve(address _contract, _amount) - Allows the specified smart contract (_contract) to withdraw tokens from the user’s account, up to a specified amount (_amount)

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    It increases efficiency and interoperability bc it allows all wallets and exchanges to be programmed to support any token.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    function totaSupply() - it gives you the total number of tokens in supply
    function balanceOF(adress account) -for wallets to check the balance of a specific account
    function transfer(address recipient, unit 256 amount) - transfer tokens from one address to another
1 Like
  1. It brings efficiency to the network as everyone is talking “the same language” so nobody needs to adapt to some other interpretations of functions. Common standard helps to interact between applications easily.

totalSupply() function returns the number of the total supply of tokens.

totalSupply() function returns the number of the total supply of tokens

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(0) function to transfer a number of tokens from one wallter to another

approve() the first step a token holder gives another address (usually of a smart contract) approval to transfer up to a certain number of tokens, known as an allowance.

allowance() function takes the address of the token owner and the spender’s address and returns the remaining number of tokens that the spender has approval to withdraw from the token owner.

1 Like
  1. All wallets and exchanges can support any token that uses the standard.
  2. balanceOf() - return the balance of the provided address.
    approve() – enables the owner of the contract to authorize, or approve , a given address
    to withdraw instances of the token from the owner’s address
    transfer() - lets the owner of the contract send a given amount of the token to another
    address just like a conventional cryptocurrency transaction
    transferFrom() - allows a smart contract to automate the transfer process and send a
    given amount of the token on behalf of the owner.
1 Like

1 All tokens behave the same. This allows for example erc20 wallets to work with every token created with the standard.

balanceOf() - get balance of an address
transfer() - transfers token from one address to another
approve() - gives approval from one address to another to transfer a certain amount of token
transferFrom() - transfers a certain amount of approved token to an address
allowance() - provides number of approved tokens

1 Like