Homework: ERC20

Using a standard like ERC20 has multiple benefits such as all tokens speaking the same coding language, reusing functions that have previously been made, and has the fastest transaction times compared to other coins.

The following are a review of the functions within the ERC20 Token Standard Interface:

  • balanceOf() - Shows the balance of the account in the argument. Can be done for any account as the information is publically available on the blockchain.

  • transfer() - Transfers a certain amount of the ERC20 token to another user. Not a great function to send to a smart contract.

  • approve() - Provides information to allow a transfer of tokens to a smart contract.

  • transferFrom() - Allows a smart contract to transfer the tokens from the owner of the smart contract to the recipient.

  • totalSupply() - Allows for a calculation of the total supply of the token.

  • allowance() - Provides the number of tokens that allowed to be transferred by one address to another.

Here’s a link that goes in better detail about the functions.

1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
    – Setting standards like ERC20 provides a consistent way (features and interfaces) for any wallet or exchange to talk to a class of tokens built on a particular platform such as the Ethereum Smart Contract platform

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    – The ERC20 Token Standard Interface includes function such as:
    balanceOf() - provides the number of tokens held by a given address.
    transfer() - transfers a number of tokens directly from the message sender to another address
    approve() - allows the token holder to give another address (usually of a smart contract) approval to transfer up to a certain number of tokens, known as an allowance.
    transferFrom() used to provide the allowance
    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?
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
  1. The benefits are that all token created with the same set of functions allows to talk to each other, and wallets and exchanges will be able to support the tokens fairly easily.
    function totalSupply(): It sets up the total supply.
    function balanceOf(address account): It gets the balance of token owner
1 Like

It increases efficiency and allows Token to operate on platforms and wallets seamlessly.

totalSupply (provide information about the total token supply)

balanceOf (provide account balance of the owner’s account)

transfer (execute transfer of a specified number of tokens to a specified address)

transferFrom (execute transfer 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 (return a set number of tokens from a spender to the owner)

1 Like
  1. Takes advantage of network effect and creates a more efficient network ecosystem.
  2. totalsupply- designates total token supply, balanceOf- shows wallet address balance, transfer- allows funds to be sent from one address to another
1 Like

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

Hello sir, did you forgot to type your descriptions?

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

  1. all exchanges etc, speak the same “language” for ease of support like balance,
  2. standardized functions, they provide include: balance, transfer etc. (Balance) provides the balance. (Transfer) would provide the details of the movement of tokens from one address to another.
1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
    It is easy for exchanges and wallets to accept all ERC 20 tokens from day 1 instead of wasting time to figure out each token one at a time
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Totalsupply() – show total supply
    balanceOf (address account) – display an eth address balances
    transfer() – send tokens
1 Like
  1. ERC20 tokens have the benefit that all tokens based on the same standards it enables wallets and exchanges to easily implement a new token that is built on a standard that is common knowledge and true for all ERC20 tokens.

  2. TotalSupply(): Maximum number of tokens that exist.
    BalanceOf(address): A public addresses’ balance of ERC20 tokens
    Transfer(): Allows transfer of their ERC20 tokens to another public address
    DoSomething(): Operates instructions.
    Allowance(): Provides the number of tokens allowed to be transferred from a given address by another.
    Approve(): Numbers of tokens allowed to be transferred.

1 Like

The main benefits of setting token standards such as ERC20 are that the standard creates rules and defines how we can program new tokens in exactly the same way, and also so they are deployed in the same fashion. This introduces compatibility. The comparability factor makes it possible to create new currencies and nfts that can interact on the same network without confusion. This innovation has, for example made it possible to nnot only create new currencies and non fungible tokens, but also to have them listed frictionlessly on exchanges. This quality also allows for a simple integration of the new token into wallets by simply providing the smart contract address.
ERC token standards supply a variety of built in functions that are very useful in the construction and functionality of the smart contract. For example, the balanceOf () function allows anyone querying on the chain to retrieve the balance of any ethereum address. This enables the contract to see if the sender or recipient actually has enough funds to execute the conditions of the contract. the transferFrom () function elicits the actual transaction of the funds once the contract details are executed, although this funtion is limited only to sending from one address to one other address. For more complex transactions, doSomething () allows for the user to call for a specific task, and uses allowances to set a limit on how much the transaction can incur.Furthermore, transferFrom( () allows for the contract to take an allowed number of tokens from an account to execute its work. The allowance () function creates the ability to to set a specific number of tokens to taken from one address to another address. Finally, the approval () function makes possible the emission of the actual specific tokens that were transacted between two accounts. This function is the final event of the smart contract and is the function that provides the ability to balance the ledgers and keep the balances correct

1 Like
  1. Setting a standard is important in order to allow exchanges, wallets and all entities that would be able to support such token, to do in the same “standard” way. In fact as soon as a new ERC-20 token comes out it can be handle by all entities that already support such standard, without having to integrate with it in a new way.
  2. There are several functions that ca be used in the ERC20 Token Standard Interface. One is balanceOf() says the number of token held by a given address (everyone can do it since all data in the blockchain are public). Transfer() is a function that simply transfer a certain specified number of token from one address to another. Other functions are more related with the functionality of the smart contract, like doSomething() that act or not based on allowed token (that has to previously provide using approve() funciton).
1 Like
  1. Standards make it much easier for apps like Wallets to know how to read the code of ANY ERC20 token

  2. totalSupply = total available supply of the token
    balanceOf (address account) = How much of said token you have in your Wallet

1 Like
  1. Everyone can build using the same commands and therefore all the “apps” and other programs will in some way be compatible with each other.

  2. balanceOf(x) gives the balance of a wallet,
    totalsupply(x) gives the total supply of the ERC20 token,
    transfer(x) transfers token to another wallet

1 Like
  1. The benefits of setting a token standard like ERC20 are that tokens are easy to create, implement. They are fungible and identical, they are supported by wallets and exchanges from the word go. Exchanges and wallet providers only have to implement ERC20 code once after that they can list all ERC20 base tokens also they can add new token quickly.
  2. ERC20 has 9 functions which can be divided into two categories: 1) optional which gives identity to a token. These functions are name - the token name, symbol - unique symbol of the token e.g. TYK and decimal - divisibility of the token most common 8 & 18. 2) mandatory which define a tokens structure. These functions are total supply - maximum number of tokens to spend in SC, balanceOf - SC wallet with total number of tokens, approve - approval to send tokens to another wallet, transfer - the act of transferring tokens to another wallet, transferFrom - helps holders to spend their tokens automatically and allowance - the minimum allowed to spend.
1 Like
  1. Helps the industry to develop more rapidly. For example wallets and exchanges will be able to more easily add tokens as there’s a standard and costly bespoke solutionswont be necessary.

  2. There are a number of functions including total supply, which gives the number of tokens that exist. Balance of, gives the balance of a particular address, and transfer, which allows people to send transactions between addresses.

1 Like
  1. Interoperability.
  2. balanceOf() gets an address’s balance.
    totalSupply is to get total Supply
    transfer transfers
1 Like
  1. Having a common standard allows wallets and exchanges to be programmed to support any token using that standard, such as the ERC 20. This is more efficient than each token having its own code, which would be more costly and time-consuming to build around.

  2. totalSupply() specifies the maximum number of tokens that exist.
    balanceOf(address account) specifies the balance of an ERC20 account
    transfer() allows users to transfer an ERC20 token to another ERC20 wallet

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    It makes the creation of smart contracts much easier and ensures that all programmers use the same structure making it compatible!

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    There are quite some functions described, such as totalsupply, which gives you the total number of tokens; balanceOf gives the balance of a specific account and transfer let’s you transfer from one account to another.

1 Like

1.Benefits of setting a token standard like ERC20 is that it makes all tokens have the same standard codes, making it easy for the exchanges to adopt them.

  1. Functions in the ERC20 token standard interface are , total supply, adding, multiply, divide, transfer, balance. They allow the executions of transactions in a standard way for the ERC20 tokens.

-The benefits of setting a token standard like ERC20 is that it increases efficiency and allows tokens to operate on platforms and wallets seamlessly.

-The functions that are in the ERC20 are:

  • totalSupply() which gives a number as an output. This number is the total supply of the token
  • balanceOf() which takes the address of an owner as the input and gives the balance of the users as output
  • allowance() function takes in the address of the tokenOwner and the spender and gives as output, the number of tokens allowed to be transferred from a given address by another given address.
  • transfer() function simply takes in the address of the receiver and the funds which are to be sent to the account
  • approve() function. You can approve someone to spend from your account.
  • transferFrom() function. It takes in three inputs — the address of the sender, the address of the receiver, as well as the number of tokens to be transferred. And gives an output of the success or failure of the transfer.
1 Like