Homework: ERC20

it allows exchanges and wallets to add a ERC20 Token

total balance returns the total number of tokens in circulation, transfer is sending tokens from one account to another account balance just returns the number of tokens in this account

1 Like

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

Having a standard such as ERC20 allows for smart contracts to be structured in the same manner, allowing for much easier interoperability between tokens, smart contracts, wallets, etc.

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

The following functions are contained in the ERC20 Token Standard Interface:

totalSupply() - returns the total circulating supply of the token.

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

transfer() function - transfers a number of tokens directly from the message sender to another address.

approve() - gives another address (usually that of a smart contract) approval to transfer up to a certain number of tokens, known as an allowance.

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. This allows all tokens to be accepted by wallets built using ERC20 standards.
  2. balanceOf, totalSupply, transfer are all functions of fungible tokens, this allows all tokens to be programmed the same way.

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 more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

totalSupply gives you how many tokens are in circulation

balanceOf (of the address) how many tokens for that address

transfer = transfer’s from owners account to another account

Peter

image003.jpg

image004.jpg

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    wallets, exchanges etc can easily add all ERC 20 tokens as they have common naming in their code, Without standards it would be chaos and interaction to different tokens would be impossible, ie to check a balance you would call a function which all tokens will have.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply(), balanceOf(), approve(), transfer(), transferFrom(), Token Name, Token Symbom, Number of Decimals,
  1. What are the benefits of setting a token standard like ERC20?
    A: Standards for ERC20 removes friction in communication of smart contracts.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    A: One of the standard functions is totalSupply() and designates the maximum number of tokens that exist.
    Another function if balanceOf(address account) gives a public addresses the balance of ERC20 tokens
    An additional function is transfer() and this allows the transfer of ERC20 tokens from one address to another address
1 Like
  1. What are the benefits of setting a token standard like ERC20?

The benefits of setting a token standard like ERC20 are greater efficiency and better compatibility with wallets and exchanges as the standard streamlines the process of token implementation.

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

The functions in the ERC20 Token Standard Interface are as follows:

name()
name of the token contract

symbol()
symbol of the token contract

decimals()
number of digits following the decimal place when displaying token values

totalSupply()
total supply of tokens available

balanceOf()
number of tokens held by a given address

transfer()
transfers a number of tokens directly from the sender to another address

doSomething()
executes a task with a number of tokens

approve()
gives approval to another address to transfer a number of tokens

transferFrom()
transfers a number of tokens directly from one address to another address; used with approve() in a smart contract

allowance()
number of tokens allowed to be transferred from one address to another address

1 Like
  1. The main benefit of setting a token standard like ERC20 is that they allow for the whole space –Exchanges, Wallets, Applications– to communicate with each other easily, which has propelled entire crypto industry to advance faster and further. Setting a standard for how everyone programs SCs, which are done repeatedly, will facilitate for everyone to integrate and inter-operate with each other, without friction, thereby attaining a more efficient economy.

  2. There are a bunch of functions present in all ERC20 Token Standard Interface, including: (1) totalSupply that tells you how many tokens are in circulation; and (2) balanceOf(address account) that Exchanges / Wallets use to know how much is your balance for a(ny) token. These functions are so important for ERC20 tokens to have as standards so that SCs are not structured differently and with many versions. Otherwise, Wallets / Exchanges will have to talk differently with tokens if there are various conventions that could be problematic, time-consuming, resource-depleting, and costly.

1 Like
  1. Setting a token standard allows for different tokens to work together on the same network, exchanges, etc…

  2. An ERC20 token must show the address of the contract and the total number of tokens available. Functions are:
    totalSupply() total number of tokens available
    balanceOf(address_owner) shows account balance
    transfer() moves tokens from one account to another
    approve allows an account owner to approve withdrawals from their account
    allowance provides the number of tokens allowed to be transferred

1 Like
  1. What are the benefits of settings a token standart like ERC20?
    It enables communication between tokens and wallets by setting standarts.
  2. What functions are in the ERC20 Token standart interface and what do they do?
    *function total supply ()=get the total token supply
    *function balanceOf ()=get the account balance of another account with address owner
    *function allowance ()=send value amount of tokens to address to
    *function transfer ()=send value amount of tokens from address to address
    *function aprove ()= 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 function transferFrom()=returns the amount which spender is still allowed to withdrawn fro owner.
1 Like

1. What are the benefits of setting a token standard like ERC20?
A. ERC20 Protocol sets standards for tokens that are created on ethereum which brings consistency in the space. When everyone follows a particular standard, it is easy to create wallets, maintain good practices etc.

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

  • 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
  1. Having standards makes it easier for wallets, exchanges and so on to add the tokens as they use functions and variables with the same name. For programmers, stuff like inheritance and interface

totalSupply(), returns the supply of tokens

balanceOf(address tokenOwner), checks the balance of ERC20 tokens in the corresponding public address

allowance(address tokenOwner, address spender), checks how much the address is able to spend

transfer(address to, uint tokens), transfers tokens between adressess

approve(address spender, uint tokens), approves transactions

transferFrom(address from, address to, uint tokens), transfers tokens from one address to another

1 Like

to get in contact with interfaces/wallets standards are needed, if no standards are considered - a standard-wallet is not able to manage balancing-, sending- functions etc…
2)
balance of The balanceOf() function provides the number of tokens held by a given address.
, transfering : The transfer() function transfers a number of tokens directly
from the message sender to another address. ,

minting, burning, paying dividents, approval, allowance

1 Like
  1. A token standard helps in wallets to interact in the same way i.e. interoperability is possible between tokens.

  2. totalsupply - total token supply

    balanceof - number of tokens in given address

    transfer() - transfer of tokens from sender to rx address but doesnot work well when tokens are used to pay for function in smart contract.

    dosomething() - to execute instructions.

    approve() - approval given to other address to transfer fixed number of tokens.

    transferFrom() - transfers the tokens from an address.

    allowance() - tokens allowed to be transferred from a given address by another given address.

    Transfer() - It emits out details of movement.

    Approval() - emits Details of the details of approval from one address to another.

1 Like
  1. The benefits of setting a token standard include ensuring that all token operation and functions are the same and for example wallets and exchanges will communicate in the exact same way with the smart contracts which comply with the standard.
  2. The ERC20 functions are as follows:
  • balanceOf() - query the balance of a specific address
  • totalSupply() - returns the total supply of a token
  • transfer() - transfer tokens to an address
  • transferFrom() - transfers tokens from one address to other
  • approve() - approve a transaction based on specific check/condition
  • allowance() - returns the allowance which can be spent by an address
1 Like
  1. Benefit is efficiency, wallets and exchanges can handle all tokens the same way, from the start, without additional, specific development.
  2. The ERC20 standard defines functionality for accessing information like total supply, or account balance, etc, related to a token, and the syntax is the same for all ERC20 tokens.
  1. New tokens created on the Ethereum blockchain under these standards benefit because it will be available since day 1 to integrate new tokens in exchanges and wallets. Also potential for interoperability with other Ethereum token standards.

  2. totalsupply (sum of all balances), balanceOf (provides number of tokens held by a given address), transfer (transfers a number of tokens directly from message sender to another address), transferFrom (takes x amount of tokens from account and carry on work), approve (gives another address approval to transfer up to a certain amount of tokens) , allowance (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?
    Introduces a certain uniformity into the contracts meaning that wallet understand them and find them easy to process. It’s adds efficiency and reduces friction in the system of crypto. There are thousands of tokens being produced, it would be chaos if they all denoted similar functions in a slightly different way.
  2. What functions are in the ERC20 Token Standard Interface and what do they do.

Balance functions which allow wallets to check balances. Functions which set the total amount of the token in existence.

1 Like

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

  • By setting a standard like ERC20 it allows interoperability between everyone on the network. Everyone knows (or can learn😉) the function names and code needed to issue a token on the network and it be excepted. As well as exchanges and wallets being able to except it.

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

  • balanceOf() returns balance of given address
    transfer() sends a given amount from one address to another
    approve() and transferFrom() are used in smart contacts scenarios
    allowance() function provides the number of tokens allowed to be transferred from a given address by another given address.
1 Like