Homework: ERC20

  1. What are the benefits of setting a token standard like ERC20? Standards provide clarity about the properties of the space and provide a uniform format for coding. This means that the code interface behind any one token with look and act like any other token in the ERC20 standard. Thus, once a wallet or exchange is set up for one ERC20 token, it is automatically set up for all other ERC20 tokens.
  2. What functions are in the ERC20 Token Standard Interface and what do they do? ERC20 defines the functions balanceOf, totalSupply, transfer, transferFrom, approve, and allowance.
1 Like
  • What are the benefits of setting a token standard like ERC20?
    The benefits of setting a token standard is that it increases the efficiency and allows tokens to operate on platforms and wallets seamlessly.

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    The function balanceOf() will return the number of tokens in a given address.
    The function transfer() will transfer a specified number of tokens from one address to another.
    The function approve() gives another address approval to transfer a certain amount of funds from given address.

1 Like

It makes the development of the applications to interact with tokens way easier and faster because everyone use the same conventions for function names etc

For instance balanceOf gives the balance of a specific account and totalSupply returns the maximum number of tokens that exist

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Security - If a token conforms to a known standard it is less likely to contain bugs or be vulnerable to exploits.
    Efficiency - Once a standard exists then that part of the task of creating a token has essentially been automated and the developers can focus on the difficulties that exist on the next layer up.
    Interoperability - When you have lots of tokens following the same standards you can then develop products that can utilise all the different tokens on that standard, or products that all the different tokens can use.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    balanceOf() - Returns the balance in tokens of a specified address.
    transfer() - Simple transfer function to send tokens from one address to another.
    approve() - Gives permission to an address to spend a certain amount of tokens.
    transferFrom() - Transfers tokens from an account that has been granted an allowance by the
    callers account.

1 Like
  • What are the benefits of setting a token standard like ERC20?
  • standardization means wallets interpret the token’s in the same way and don’t have to be able to interpret different versions of functions
  • What functions are in the ERC20 Token Standard Interface and what do they do?
  • totalSupply - maximum number of tokens in existence
  • balanceOf(address account - the balance of tokens in a particular public address’ wallet
  • transfer() - moves tokens from one public address to another
1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
    Standards and conventions are used for efficient communication and easy integration of tokens in the network
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply() function for the total ammount of coins that can exist
    balanceOf() function to show account balance
    transfer() sends tokens from account A to account B
    approval() emits details of approvals of tokens from one address to another. These can be used to keep track of balance and allowance changes for addresses without needing to poll the blockchain.
    allowance() sets the amount that can be withdrawn from the holder
1 Like
  1. A standard allows interoperability between tokens and makes sure that once a new ERC20 token is created it is already compatible with all the ERC20 supporting wallets and systems.

balanceOf - “This function allows a smart contract to store and return the balance of the provided address”

totalSupply - “this function allows an instance of the contract to calculate and return the total amount of the token that exists in circulation.”

transfer - “This function lets the owner of the contract send a given amount of the token to another address just like a conventional cryptocurrency transaction.”

transferFrom - “This function allows a smart contract to automate the transfer process and send a given amount of the token on behalf of the owner.”

approve - " When calling this function, the owner of the contract authorizes, or approves , the given address to withdraw instances of the token from the owner’s address."

allowance - " Returns the amount which _spender is still allowed to withdraw from _owner"

1 Like

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

ERC-20 provides a common set of features for token contracts in Ethereum. Benefits include allowing wallets to provide token balances for hundreds of different tokens. It also makes it easy to list the tokens on exchanges by simply providing an address to the token’s contract.

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

The totalsupply() function equals the sum of all balances.

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 approve() function gives a smart contract approval to transfer up a certain number of tokens.

The transferFrom() function transfers approved tokens from a token holders address so the smart contract can perform its work.

The allowance() function 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 token standard like ERC20?

  • Having standards reduces friction
  • i.e. any token that conforms to ERC20 will work with existing wallets and exchanges from the get-go
  • existing software will be able to handle tokens that comply to the ERC20 standard because these tokens comply with a standard that the software already knows about
    2. What functions are in the ERC20 Token Standard Interface and what do they do?
    1. totalSupply:

      • function totalSupply() constant returns (uint256 totalSupply)
      • get the total token supply
    2. balanceOf:

      • function balanceOf(address _owner) constant returns (uint256 balance)
      • get the account balance of another account with address _owner
    3. transfer:

      • function transfer(address _to, uint256 _value) returns (bool success)
      • send _value amount of tokens to address _to
    4. transferFrom:

      • function transferFrom(address _from, address _to, uint256 _value) returns (bool success)
      • send _value amount of tokens from addresss _from to address _to
    5. approve:

      • function approve(address _spender, uint256 _value) returns (bool success)
      • allow _spender to withdraw from your account, multiple times, up to the _value amount.
      • if this function is called again it overwrites the current allowance with _value
    6. allowance:

      • function allowance(address _owner, address _spender) constant returns (uint256 remaining)
      • returns the amount which _spender is still allowed to withdraw from _owner
1 Like

Having a token standard allows devs to make a new token that can be easilly accepted by other wallets or exchanges. So, it makes easier both development and adoption of new projects.

Most common functions of ERC20 are :

  • functions used for transferring tokens
    • transfer(addressB, N)
      sends N number of tokens to addressB (using tokens from the address that calls it)
      Returns True or False, depending if it succeeded or not
    • approve(addresB,N)
      called from an address to give permition to addressB (usually a smart contract) to take up to N amount of tokens from the first.
      Returns True or False, depending if it succeeded or not
    • transferFrom(addressA, addressB, N)
      transfers specified Namount of tokens from addressA to addressB (as long as there is permission to take that amount)
      Returns True or False, depending if it succeeded or not
  • Queries
    • balanceOf(AddressA)
      returns the number of tokens held by AddressA
    • allowance(AddressA,AddressB)
      returns the number of tokens AddressB can take from AddressA
  • Events
    • Transfer(AddressA, AddressB, N)
      emits details of the movement of N tokens from AddressA to AddressB
    • Approval(AddressA, AddressB, N)
      emits details of approval of N tokens to be transferred from AddressA to AddressB
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Setting standards like ERC20 ensures that any new tokens follow a common naming convention for functions that will ensure instant integration and compatibility with wallets and exchanges.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Source: Anatomy of ERC20
    totalSupply() - allows an instance of the contract to calculate and return the total amount of the token that exists in circulation
    approve() - When calling this function, the owner of the contract authorizes, or approves , the given address to withdraw instances of the token from the owner’s address
    balanceOf() - allows a smart contract to store and return the balance of the provided address
    transfer() - transfer tokens from one user to another
    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. What are the benefits of setting a token standard like ERC20?

As with web standards like FTP and HTTPS token standards allow for interoperability between many different applications. Simply stated a token standard is a technical and social agreement on how a given set of functionality is defined and used.

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

Name() - The friendly name of the token

Symbol() - Better known as ‘ticker’. Like ‘ETH’

Decimals() - To what decimal the token is divisible, a maximum of 18

Approve() - Approve a third party to call the transferFrom() function on your behalf

Transfer() - Send funds from your wallet to a contract or EOA

TransferFrom() - Allows a contract to transfer funds on your behalf. Used by exchanges.

BalanceOf() - Check the balance of an address

TotalSupply() - Check the number of tokens in existence

Allowance() - Used in conjunction with Approve() this allows you to specify the amount of tokens another party may send on your behalf. Without Allowance() specified it is assumed the Approve() party can send an unlimited amount.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    quicker, easier development of wallets, exchanges, etc.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Copied from https://ethereum.org/en/developers/docs/standards/tokens/erc-20/ …
    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)

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

It creates a standard that allows things like wallets and exchanges to interact with each crypto currency more easily. Programing this interface makes it possible for more start up currencies to get access to trading networks and use more than they would otherwise have.

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

blanceOf is function used to give the balance of any account queried. The totalsupply function gives the amount of all tokens of each individual queried.

1 Like
  1. Setting a token standard like ER20 gives standard way for development and easily integrate tokens into the wallet.

  2. balanceOf provides balance of account and TotatSupply provides total number of coins fungible coins exits

1 Like
  1. Standardization
  2. balanceOf and totalSupply
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Reduces friction in the network for understanding what you are specifically programming and also this allows for convenience in storing for wallets as even upon launch of a token onto the Ethereum network it can just be stored on an ERC 20 wallet, this same convenience applied to exchanges as well.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    • Function total supply ()
    This function defines the total max supply of the token (number of tokens there can ever be)
    • Function balanceOf(address account)
    This function is used to be able to check the balance of a given address.
1 Like

1.) It allows communication between the different projects built on Ethereum for interoperability and to avoid friction in the economy, it allows developers to help add to the ecosystem

2.)balanceOf() gives the balance of the given address, transfer() sends tokens directly from the message sender to the given address

1 Like

Yes sure,
balanceOf() returns the token balance of an account
totalSupply() sets the total supply of the tokens

1 Like
  1. What are the benefits of setting a token standard like ERC20? Everyone knows that there is particular way of working across an industry everyone is working to a coherent level of understanding/ education and communication. You can build application that can talk with each other increasing cross chain activity.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    TotalSupply: Returns total circulating amount of tokens. balanceOf: Returns how may Tokens exist in an account transfer. Transfer an amount of token from tokens owner’s account to another account.
1 Like