Homework: ERC20

  1. Benefits are that we speak the same language which means that wallets etc understand the codes.
    2.(totalsupply) Available supply of tokens.
    (balanceOf) balance checker of a user or/and address.
    (transfer) transferring an amount from sender to receiver
1 Like
  1. This enables developers and firms to follow the same rules for token development thus making it easier for developers, deployment of code to networks, management of tokens by exchanges etc
  2. There are various functions e.g.
    a) totalsupply() - used to define the total supply of Tokens for a network
    b) balanceOf() - obtain the number of coins in a particular token wallet
    c) transfer() when transferring token directly between two address (but not suitable for transfering token used in a smart contract
    d) approval() used with transferFrom() combined are used for transferring to a smart contract.
1 Like

Hello Carlos,

Ok, Thank you for correcting me. The function balanceOf(dress account) is needed if someone or an exchange want to know how many tokens does an ETH address have.
The standardized totalSupply function indicates the number of the same typ of token in circulation.

1 Like

1- Sot that everyone uses the same naming conventions and the whole community is able to communicate with each other

2- balanceOf() Returns a count of the token balance a particular account has
totalSupply() returns a count of the total supply of tokens in circulation
transfer() Allows the owner of the smart contract to transfer a given amount of tokens to another address.
transferFrom() Allows the owner of a contract to send a given amount of tokens to another address without the owner’s intervention. Like paying a monthly bill.
approve() Allows the owner of the contract to authorize the given address to withdraw a given amount of tokens from the owners address
allowance() After the owner of a contract approves an address, the allowance function allows that address a given amount of tokens to be used

1 Like

Homework on ERC20 token standard.

What are the benefits of setting a token standard like ERC20? By having standards this allows all wallets, exchanges and coders to easily add all ERC20 tokens. The code is consistent and will be able to communicate in an expected fashion.

What functions are in the ERC20 Token Standard Interface and what do they do?
The total Supply () function of the token must be set. After the maximum is reached, no more tokens may be created by the smart contract.
The balanceOf () function assigns an initial number of tokens to any given address, usually the owners of the ICO.
The transfer () function moves tokens from the total supply to an individual user who purchases during the ICO
The transfer () from function is used to send tokens from one person to another.
The approve () function checks that a smart contract can distribute tokens, based on the remaining supply.
The allowance () function makes sure that an address has enough of a balance to send tokens to another address. These 6 simple steps have allowed wallet providers and exchanges to create a single codebase, which can interact with any ERC-20 smart contract.

1 Like

Q1: The ERC20 Standard allows exchanges and wallets to accept fungible tokens from Day 1.

Q2: totalSupply() gives maximum number of tokens
balanceOf(address account) gives a public addresses’ balance of ERC20 tokens
transfer() allows someone to transfer their tokens to another public address

1 Like
  • What are the benefits of setting a token standard like ERC20?
    The benefits of setting a token standard is efficiency, which means it is easier to create new tokens and the wallet can provide support to them from day 1.

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    -balanceOf ( ) - provides the number of tokens held by a given address.
    -transfer ( ) - It allows to transfer a number of tokens directly from the message sender to another address.
    -allowance ( ) - it 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?
Setting any type of standard creates order in a chaotic world. Without standards, you could have an infinite number of unique variables, making it difficult to produce products that work together. Standards in regards to ERC20 create a set of rules for people to follow, making it much easier for developers to code multiple types of applications.

2. What functions are in the ERC20 Token Standard Interface and what do they do?
Balance - The total amount of tokens in an account - balanceOf()=
Approve - Authorize a transfer - approve()=
Transfer - Transfer tokens - transfer()=

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Setting a token standard is beneficial because it allows exchanges, platforms and wallets to easily add all ERC20 tokens as they have common naming in their codes. Also it allows easy interactions between all the tokens.

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

  • balanceOf ( ) - It provides the number of tokens held by a given address.
  • allowance ( ) - It provides the number of tokens allowed to be transferred from a given address by another given address.
  • transfer ( ) - It allows to transfer a number of tokens directly from the message sender to another address.
  • Approval ( ) - It emits details of approvals of tokens from one address to another
1 Like
  1. This makes it “universal” in that all components on the blockchain can operate with the token. Any wallet or exchange can be programmed such that it is compatible with any other token of the same standard.

  2. totalSupply : Returns the total circulating amount of tokens.

balanceOf: Returns how many tokens exist in an account.
transfer: Transfer an amount of tokens from token owner’s account to another account.

approve: A token owner can approve for spender to transferFrom tokens from the token owner’s account.

allowance: Returns the amount of tokens approved by the owner that can transferred to the spender’s account.

transferFrom: Allows a spender account to transfer an amount of tokens on behalf of the token owner to another account.

1 Like

The benefits are that exchange and wallets they can interface with the tokens in one standard way , without the standard ERC20 instead they should adapt to every single token differently.

The functions allows users to find out the balances of accounts as well as to transfer them from one account to another based on specific conditions. The 6 mandatory fuctions for each ERC20 token are totalSupply , balanceOf , approve() , transfer() , transferFrom() , allowance() .

1 Like

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

Yes sir, those are the correct functions, but could you please describe a little bit what those functions do?

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

Carlos Z.

Hi,
yes no problem, from what i read:

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

  • balanceOf this function allows a smart contract to store and return the balance of the provided address. The function accepts an address as a parameter, so the balance of any address is public.

  • approve() with this function the owner of the contract authorizes, or “approves”, the given address to withdraw instances of the token from the owner’s address.

  • transfer() this function lets the owner of the contract send a given amount of the token to another address.

  • 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.

  • allowance() this function allows to transfer the number of allowed tokens when an action is executed on the contract.

1 Like
  1. The benefit of setting a standard like ERC20 is to ensure everyone has a template and guidance to follow. This ensures consistency in the industry and a baseline to compare and comply with.

  2. ERC20 token has many functions, for example;

TotalSupply - returns a unit that shows total supply of a token

balanceOf - Given an input, it returns a balance of that account

1 Like
  1. Setting a token standard for ERC20 tokens allows each token to communicate efficiently with the network and each other.
  2. Functions like totalSupply, balanceOf, transfer, and mint are some of the functions in the ERC20 standard interface. These functions allow the network to run smoothly with all the tokens and perform the transactions and smart contracts with these tokens.
1 Like
  1. What are the benefits of setting a token standard like ERC20? >> every wallet or exchange is able to handle the code of the smart contract without any instructions
  2. What functions are in the ERC20 Token Standard Interface and what do they do? as an example the function BalanceOf() generates the Balance of the address… thee are many of them… as an other example TotalSupply()
1 Like

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

  • With a standard token everyone must program something following the same rules of writing. This allows the any token to be supported in any exchange or wallet.

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

  • balanceOf(), provides the number of tokens held by an address;
    transfer(), sends tokens to another address;
    approve() and transferFrom(), with these functions the receiver approves to transfer some tokens from an address;
    allowance(), provides the number of tokens allowed to get transfered from an address to another address
1 Like
  1. Having a standards allows wallet and exchanges to add all ERC 20 tokens. In other cases every token must have own code and the communication between them it is going to be much difficult.
  2. totalSupply(): can give us maximum number of tokens that exist, balanceOf(address): shows public addresses balance of ERC20 tokens,transfer (): allows transfer of tokens to public address, doSomething (): instructions for operate and allowance(): how much tokens are allowed to be transferred.
1 Like

Yes sir, those are the correct functions, but could you please describe a little bit what those functions do?

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

Carlos Z.

No problem! I misunderstood.
totalSupply provides the total number of existing tokens on the network.
balanceOf shows the balances of individual wallets on the network.
transfer instructs a the nodes to update balance values of sender/recipient.
mint I would assume is telling the network that new tokens have been created?
Let me know if I’m missing anything from the functions I listed!
Thanks!

1 Like