Homework: ERC20

A token standard allows for abstraction and polymorphism. In computer science polymorphism allows for a code to be able to operate with several different objects using the same functions on each of them and having each of the functions work as intended. Therefore a wallet could use the same code for every type of token and have everything run as intended (the same can be said for any program that accepts different tokens).

The 3 functions shown to us are:
totalSupply()
Which tells you the total supply of the token currently in circulation

balanceOf(address_account)
Which requires an address account input and returns the balance of that account

transfer(address_recipient, uint256_amount)
This transfers an amount to a recipient, taking both of them as an input to the function

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

This ensures that the same naming conventions and various other parameters are used when programming a smart contract. An ERC20 token is a non-fungible token.

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

transfer() This function sends tokens from one address to another.

transferFrom() Specifies the address from which to send.

balanceOf() This function shows the set of tokens of a given address.

approve() authorises a token fetcher to send tokens to an address.

allowance() Specifies the amount of tokens that may be sent.

1 Like
  1. Standardized guideline on how to program and deploy new tokens on network. Better interoperability between exchanges and wallets.

  2. balanceOf = get balance of specific address.
    totalSupply = Total Supply of the token
    transfer = transfer token to address
    transferFrom = transfer from address to another address
    approve = approve (e.g. spending)
    allowance = remaining token available for transfer/spending

1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • efficiency! makes many surrounding and directly involved applicatons easy to develop and interface, such as new ccy’s, wallets,
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • many different ones. balanceOf was one - gives you the balance of an account.
1 Like
  1. Setting a token standard like ERC20 allows for these kinds of tokens to be supported by different wallets and exchanges that have been programmed to that standard.
  2. Functions of the ERC20 Token Standard include: totalSupply(), which gives you the number of tokens in existence, balanceOf() gives you the number of tokens in particular address, and transfer() and transferFrom() transfers number of tokens from one address to another, approve() allows the with withdrawal of token from your account
1 Like

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

Interoperability

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

totalSupply returns total supply, balanceOf returns balance of account… etc

1 Like

Homework on ERC20 token standard.

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

Token standards like ERC20 allow the various part of a blockchain system, for example various applications, to more easily communicate with each other and do things together. Such standards also make developing blockchain applications easier. With such standards, there are basic functions which are the same for all tokens, etc., that are used on a particular blockchain, and software developers can quickly find out the various functions, know what they are called, and add the parameter amounts which they want. Wallets and exchanges can quickly and easily add new tokens. Exchanges can easily get wallet balances for a wide variety of wallets and tokens.

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

Some of these functions are: balanceOf (address account), used to get the balance information of a particular account, and a function for the total supply of a particular token.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    They have the same conventions, all functions are uniformed across contracts using this standard, hence allows easier communication between one another. It makes the process much more efficient as there is a fixed guideline to write the contract, and it reduces frictions in the ecosystem.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply() = the total supply of the token that’s circulated
    balanceOf() = the balance held by a particular address
    transfer() = sending a certain amount of tokens from one address to another

1 Like
  1. The benefits are we can easily communicate to each other and also they are programmed in ERC20

  2. totalsupply() no of tokens exist
    balanceOf() gives balance of address

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Efficiency, reducing cost, more security ( the standard is already tested), consistency, universal communication…

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

totalSupply

Returns the total token supply.

balanceOf

Returns the account balance of another account with address _owner .

Transfer

Transfers _value amount of tokens to address _to

transferFrom

Transfers _value amount of tokens from address _from to address _to

approve

Allows _spender to withdraw from your account multiple times, up to the _value amount.

allowance

Returns the amount which _spender is still allowed to withdraw from _owner .

1 Like
  1. This makes it easier for wallets and exchanges to host/integrate with all of the tokens.
  2. totalsupply = find sum of all balances; balanceOf = find balance of specific address; transfer = send tokens from one address to another
1 Like
  1. it means that all can follow similar tested path as a result it will be easy for implementation and increase efficency of makeing a new token.
  2. ERC20 token standard is used to program fungible token there are diff function such as totalsupply()-used to know our total supply.
    balanceOf() used for to know the balance of the account. etc
1 Like
  1. A standard means that tokens will be easily understood by different programmers, and that token contracts can interact with one another.

  2. There are lots of them, but the most basic ones will be BalanceOf, which gives you the number of tokens held by address, TotalSupply, which will set the maximum number of tokens in existance, and transfer(), which will allow people to send their tokens to other wallets.

1 Like
  1. Having one standard allows uniformity and interopability.
  2. balanceOf() get the balance of x account and total supply shows the total of a token.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • All wallets and exchanges support them from scratch.
  • We all help the ecosystem grow and reach efficiency
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • 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
  1. What are the benefits of setting a token standard like ERC20?
    everyone know how they work and interact with them and makes i easier for programmers to understand how things work.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?

totalSupply = total amount of coins for this contract
balanceOf = address and give you the balance fo that address
transfer = allows you transfer token to one address to another

1 Like
  1. Setting token standards makes it easier for developers/ wallets to communicate with one another and to reduce friction in development

  2. The ERC20 Token standard has the balanceof() function which tells you the balance of different addresses once you query it, transfer() which transfers tokens from one address to another, approve() which grants the smart contract the ability to transfer a specified number of your tokens.

1 Like
  1. Having standards allows wallets, exchanges etc to easily add all ERC 20 tokens as they have common naming in their code.

  2. balanceOf() Gives balance of a specific account, totalsupply the number total fungible tokens.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • if you follow the standards everyone can use the token to add in wallets, dex, or another services, if you dont use the standard ERC20 this can’t be possible, another thing that is important is anyone can read easily the smart contract ERC20 if wanna call some function or develeop over the token
  • you can transfer , approve and anothers functions like balanceOf, all this functions are usefull to interact with the token ERC20, for example, if you wanna transfer you can use the simple ( transfer ) function, if you wanna se your balance of that token you can use ( balanceOf ) , all this functions can be called using web3 but also you can use etherscan in the section “contract” and you can use it to call functions there, the only requirement to do this is using web3 to interact with the smart contract ( because metamask inject web3 )
    :slight_smile: :heart:
1 Like

Homework on ERC20 token standard.

  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 of a token standard allow all smart contracts to have a known way to interact with tokens. Without some standard every different token would create a new standard and this would be huge technical overhead for any developer looking to interact with multiple tokens with their smart contract.

  • balanceOf() : that returns the balance of tokens on a particular address.
  • transfer() : increases the recipient’s account by the amount that the sender’s account specifies for transfer. The sender’s account also pays the network gas fee for this operation.
  • approve() and transferFrom() : These two functions work in tandem to allow a user to pay for a smart contract to do something with tokens.
    • approve() allows a smart contract to use up to an approved amount of tokens from the user, with information provided from that user.
    • transferFrom() allows a smart contract to take up to the approved amount of tokens from the user’s account and otherwise will fail if the approved amount or balance is insufficient.
  • allowance() : provides the amount of tokens that are allowed to be transferred by an account.
1 Like