Homework: ERC20

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
    Exchanges and wallets can support tokens easy if they all follower erc20 programming standards
  2. What functions are in the ERC20 Token Standard Interface and what do they do?

function name() public view returns (string)
function symbol() public view returns (string)
function decimals() public view returns (uint8)
function totalSupply() public view returns (uint256)
function balanceOf(address _owner) public view returns (uint256 balance)
function transfer(address _to, uint256 _value) public returns (bool success)
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
function approve(address _spender, uint256 _value) public returns (bool success)
function allowance(address _owner, address _spender) public view returns (uint256 remaining)

2 Likes
  1. Tokens using a particular standard allow other apps and exchanges to be compatible when using the same standard.

  2. totalSupply() gives maximum number of tokens that exist
    balanceOf(address account) gives the balance of a pubic address
    transfer() allows a transfer of ERC20 tokens to another public address

1 Like
  1. Facilitate tokenization of app in a blockchain.

  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. Having a standard like ERC20 allows for new tokens to be accepted on wallets and exchanges that support the coin it is built off of.

  2. totalSupply()- gives the total number of tokens
    balanceOf(address account) -returns the balance of tokens in a specific account address
    transfer() - allows for the sending of tokens to other addresses.

1 Like
  1. The benefits of setting a token standard like ERC20 are that such standards define how developers (should) program tokens on the ETH network. Significantly, the use of a token standard allows for extensive/systematic wallet and exchange support for a wide variety of tokens.

  2. The functions in the ERC20 Token Standard primarily relate to the balances of accounts and the transfer of tokens from one account to another. Firstly, the “balance0f” function provides the number of tokens held by a given address. Secondly, the “transfer( )” function transfers a number of tokens directly from the message sender to another address. In addition to these two primary functions, there are also functions pertaining to the payment of gas fees (which are required in order for the smart contract to actually execute instructions). Accordingly, the “approve( )” and “transferFrom( )” functions allow token holders to provide another address (usually of a smart contract) approval to transfer up to a certain number of tokens, known as an allowance. The token holder uses the “approve( )” function to provide this information. Once an allowance has been created the smart contract can take up to the allowed number of tokens from a user’s allowance as part of the contract’s operation. Finally, the “allowance( )” function provides the number of tokens allowed to be transferred from a given address by another given address.

2 Likes
  1. Having a token standard like ERC20 makes it possible for wallets and exchanges to understand what the token is for.
  2. The total supply function shows the total number of tokens in contract. BalanceOf function shows that there is enough tokens in account. The transfer function shows how much to transfer.
1 Like
  1. ERC20 is a standard for coding smart contracts as fungible tokens on the ethereum network. If tokens comply to a standard like ERC20, it makes it much easier, quicker and cheaper to deploy the token, because infrastructure such as wallets and exchanges will already support the token. Essentially, tokens compliant with ERC-20 will be able to interoperate with everything else that is ERC-20 compliant from day 1.

  2. Tokens are stored in accounts. So functions that are defined in the ERC20 Token Standard Interface include query account balances, transfer tokens from one account to another, and transfer tokens based on certain approved functions.

1 Like
  1. If all developers use the same standard (for example ERC20), all exchanges and wallets can support the token from day one without changing anything.

  2. Two functions presented in the lecture:

  • totalSupply() : no input, returns the total supply of the token
  • balanceOf(address account): address number as input, returns balance of the address’s token
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Standardization allows for easy deployment and adoption of tokens.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    balanceOf - Returns the account balance for the given address, public domain.
    totalSupply - Calculates and returns total amount of the token in existence.
    transfer - Allows the contract owner to transfer to another address.
    transferFrom - Automated function that transfers to an address on behalf of the contract owner.
    approve - Allows the contract owner to a given address to withdraw from the contract owner address
    allowance - Returns the quantity allowed to be transferred from from a given address to another given address.

1 Like
  1. there are many benefits to having a token standard, one benefit is uniforminity, which means no ambiguity in terms of what is necessarry for each token to be listed on an exchage or to be held in a wallet.

  2. ERC20 token standards are: the balance of() gives the number of token that are in an address.

Transfer() sending tokens from one address to another ( remember sending to the wrong address can result in a loss of funds)

Approve () and transfer () this is a two step ptocess that allows payment execution for function(s) in a smart conntract

Allowebce ()provides the number of tokens allowed to be transferred from a given address by another given address.

1 Like
  1. What are the benefits of setting a standard like ERC20?
    For easy adoption/deployment of the tokens.

  2. 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 () Emits details of 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. What are the benefits of setting a token standard like ERC20?
    By using ERC20 tokens you can rely on standard functions.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    BalanceOf(); totalSupply()
1 Like
  1. What are the benefits of setting a token standard like ERC20?

It sets consistency throughout the space as all ERC20 tokens must use these functions instead of implementing them their own way which could cause a lot of confusion and lead to potential fraud and security risks.

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

Functions like totalSupply which returns the amount of tokens in circulation and transfer() which allows tokes to be sent to other wallets

1 Like
  1. It makes it easier an more accessible for programmers and wallets to write code which is better for integration, communication and development

  2. BalanceOf()
    Transfer()
    Approve()
    TransferFrom()
    Allowance()
    TotalSupply() -

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

Everyone uses the same standards when programming their tokens which keeps the ETH ecosystem fast and efficient and makes it easy for exchanges to interact with tokens.

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

Here are a few:

totalSupply() - Gives the total supply of token

transfer() - For sending tokens from one address to another.

balanceOf(address account) - The balance of a token in an address.

1 Like
  1. ERC-20 token benefits are convenience of having the same standard that various tokens adhere to. Saving time and security. Any new tokens wishing to enter the ERC-20 protocol, have the ground work already established.

  2. totalSupply - identifies the total number of ERC-20 tokens created
    balanceOf - returns the number of tokens that the contract owner has in their account
    approve - checks the tx against the total supply of tokens to make sure none are missing or leftover.
    transfer - lets the owner of the contract send a given amount of token to another address.
    transferFrom - automate payment transfers to a specific account
    allowance - verifies the minimum amount of tokens required to do the transaction

1 Like
  • What are the benefits of setting a token standard like ERC20?
    It is like the same language what everybody understand.
    Reduce missunderstanding and friction
    Promotes best practice programming
    can easier interact with Exchanges, wallets, webservers

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    Manage ownership of the token
    Total supply
    Balance of the Tokens
    Issue or burn token

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    makes it easier for wallets, exchanges, etc. to interact with tokens which leads to easy adoption and easy deployment

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply ()- gives the total number of tokens
    balanceOf (address account) -returns the balance of tokens in a specific account address
    transfer () - allows for the sending of tokens to other addresses.

2 Likes
  1. All wallets can deal with them in the same way.

    1. totalSupply(): sets maximum number of tokens
      balanceOf(address): tells a public addresses’ balance of ERC20 tokens
      transfer(): allows transfer of ERC20 tokens to another address
      doSomething(): operates instructions.
      allowance(): provides the number of tokens allowed to be transferred
2 Likes
  1. What are the benefits of setting a token standard like ERC20?
    Without such a standard, we would have friction, meaning everybody could program their tokens with different code for with the same function/result. Therefore every exchange/wallet can store this token.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    There are many functions, which we did not discuss yet, but we know already about i.g. the the TotalSupply function, which set the total supply (amount) of a certain token.

1 Like