Homework: ERC20

  1. It ensure functionality and acceptance with all wallets and exchanges.
    2.balanceof() Provides the number of tokens held by an address
    transferfrom() a token holder gives another address approval to transfer up to a certain number of tokens, known as an allowance.
    approve() The token holder uses approve() to approve the trasnferfrom()
    transfer() Transfers tokens from one address to another
    allowance()- provides the number of tokens allowed to be transferred from one address to another
1 Like

What are the benefits of setting a token standard like ERC20?
It provides a common and consistent way of interacting with tokens, wallets, exchanges and dapps
What functions are in the ERC20 Token Standard Interface and what do they do?
function balanceOf(): # of tokens in an address
function transfer(): move tokens from one address to another
function approve(): approval to transfer tokens
function allowance(): # allowed to be transferred to another address

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

ERC20 is a standard interface for tokens that work on Ethereum, it provides a way to make different tokens fungible, this allows new tokens to used with existing wallets that support ERC20. Simplifies creation of new tokens because they all follow a standard.

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

balanceOf() - number of tokens held by a particular address.
transfer() - sends tokens to an address without checking if the address is valid.

approve() and transferFrom()- sends tokens to approved address

totalSupply - gives total number of tokens

1 Like
  • What are the benefits of setting a token standard like ERC20?
  • What functions are in the ERC20 Token Standard Interface and what do they do?
  1. Setting a token standard means uniformity in coding, no matter who writes it. This means that all computers will recognise the code (assuming they know the standards because they are connected to the network of course).

  2. Some of the functions in the ERC20 Token Standard Interface are as follows:
    (I have not yet learned what all of these are, the only ones mentioned in the lecture were ‘totalSupply’, ‘balanceOf’ and ‘transfer’. Having said that I spotted these on a website and while I believe there is more to it, thought I’d start with these and have a guess.)

    • function totalSupply()
      this is the total supply of tokens available

    • function balanceOf(address tokenOwner)
      this would be the balance of tokens of the address owner

    • function allowance(address tokenOwner, address spender)
      I think this is the amount of GAS you allocate for the execution of the contract

    • function transfer(address to, uint tokens)
      this would be where the tokens are being sent and how many

    • function approve(address spender, uint tokens)
      this would be the approval for the transfer to take place (I’m guessing)

    • function transferFrom(address from, address to, uint tokens)
      this would be where the tokens are coming from

    • event Transfer(address indexed from, address indexed to, uint tokens)
      I would imagine this is is the transfer process once the event (contract obligations) have occurred, maybe?

    • event Approval(address indexed tokenOwner, address indexed spender, uint tokens)
      if my last point was correct, then I would assume this would be the approval of said transfer.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • It means all tokens that use the standard are accepted by all exchanges and wallets that accept ERC20.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • totalSupply() - brings the total amount of tokens in circulation.
  • balanceOf (address account) - brings the amount of tokens in the account.
  • transfer() - sends tokens directly from one address to another.
  • approval() - approves a given address to take tokens from another given address.
  • allowance() - specifies the amount of tokens that the approved address can take.
1 Like
  1. What are the benefits of setting a token standard like ERC20?

Standards allows the entire ecosystem to communicate with each other. For a new cryptocurrency to enter circulation and expand its adoption it must become compatibile with popular wallet software and get listed by cryptocurrency exchanges. This process is greatly streamlined by token standards such as ERC20.
This standard ensures that the same lines of code can be used to add any coin built on the ethereum platform and perform basic interactions with it such as balance queries or payments.

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

The following functions are in the ERC20 Token Standard Interface:

  • totalSupply() is the only mandatory parameter to define a new ERC20 token contract. When called it returns an integer representation of the sum of all balances. Balances are internally stored as integers so if the contract has fractionable tokens the total supply is the sum of all balances multiplied by 10^(decimals). The ‘decimals’ constant will be used by wallets to place the decimal point before displaying a balance on a user interface.

  • balanceOf() will return the token balance of any given address. This is publicly accessible information.

  • transfer() can be performed by any wallet to send a number of tokens to a given address.

  • approve() is a two step transfer process where sender wallets can allocate some tokens to be sent. The recipient wallet may then use transferFrom() to recieve the tokens that have been approved.

  • transferFrom() works in tandem with approve() to recieve funds. However a check must be made that the sender has enough tokens on balance as senders may approve funds they don’t actually have on hand.

1 Like
  1. The benefits of setting a standard like ERC20 is that when users want to build and distribute their own tokens, they will be instantly compatible with all exchanges and wallets as the code will be written the same throughout.

  2. The functions that can be found in ERC20 are:

  • totalSupply() Its gives you the amount of tokens in circulation
  • balanceOf() This will get the balance of a particular address
  • transfer() This sends tokens from one account to another
  • approval() This approves an address to take tokens from another address.
  • allowance() details the amount of tokens that an approved account can take.
1 Like

1)all wallets and exchanges can read this code, so it makes it easier and universal
2) there are lots of them : total supply and balanceof are 2 examples that are always in the code

  1. ERC20 standardization allows for wallets and exchanges to add new tokens.
  2. function totalSupply() - Get the total token supply; balanceOf - Get the account balance of another account with address _owner; and transfer - Send _value amount of tokens to address _to
1 Like
  1. What are the benefits of setting a token standard like ERC20?

All are equally programmed which allow for reuse by other applications like wallets/exchanges, which therefore can support the token from day 1.

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

Some of them are:

TotalSupply() – how many tokens there are in circulation

balanceOf() - provides the number of tokens held by a given address

transfer() - send tokens from one address to another

1 Like

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

Yes sir, 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.
[/quote]

  1. It creates more efficiency and it allows wallets and all participants to communicate easier. ERC-20 standard also creates interoperability between all ERC-20 tokens.
  2. totalSupply() gives total number of tokens that exsist, balanceOf() gives available balance of each account, transfer() enables transfer of tokens from sender to receiver
1 Like
  1. so that you dont have conflicting syntax in the coding of different tokens.

balanceOf() function shows number of tokens in a given address
transfer() function sends tokens to another address but cant be used to pay smart contract
TransferFrom?—very confusing in article
allowance() function gives the amount of tokens you can potentially send to another address
Approval() details on approval of tokens from one address to another

1 Like
  1. It makes interoperability easier meaning wallets and exchanges can adopt new tokes instantly as they all have the same code.
  2. totalSupply returns a unit of the total supply of that token
    balanceOf - given an address it returns their account balanceOf
    transfer - transfers an amount to a specified address from the owner of the contract (return bool success)
    transferFrom - specifies a from address, to address and a value to transfer (return bool success)
    approve - When called the owner of the contract authorizes the address to withdraw tokens from the owners address
    allowance - returns the amount remaining
2 Likes

Having the token standard allows for all tokens to communicate effectively with exchanges, wallets and other platforms that are capable of reading their standard, such as ERC20, ERC721 or ERC1155.

Some of the Functions that are in the ERC20 Standard are as follows:

balanceOf() - gives the total number of tokens held by a selected address.

transfer() - is used to send tokens from one users wallet, directly to another wallet address.

approve() and `transferFrom() - work together to allow tokens to be sent to a smart contract for a particular task.

While “Allowance()” tells the smart contract how much the recipient address is able to receive from the sender.

1 Like
  1. Everyone is working with one standard so it’s easier for everyone
  2. Check the total balance of the account and also transfer that balance form one account to another
1 Like
  • the benefits of setting a token standard like ERC20 is improves understanding, brings about transparency
  • What functions are in the ERC20 Token Standard Interface and what do they do?
    [for example you can use the balance of account function to get the balance of the account. Another example is the total supply. The exchange and the wallet can all use the same function without having to write your own code.
1 Like
  1. To make it easier communicate
  2. balanceOf (address) - > get balance of specific address
1 Like
  1. reduces friction between contracts and streamlines the functionality of the ethereum network
  2. balance, total supply, transfer and many others
  1. ERC20 standard promotes consistency throughout the ETH network. Allowing a standard for all fungible tokens.
  2. totalSupply() - gets total token supply
    balanceOf() - gets the balance of tokens in an address
    transfer() - transfers tokens to another address
2 Likes