Homework: ERC20

Hey @DinS

Well done, just a little integration to the transferFrom answer:
transferFrom() - transfers a certain amount of approved token to an address in behalf of the token owner :slight_smile:

1 Like
  1. Standards ensure compatibility with wallets, exchanges; interoperability between tokens and less friction within the network in general
  2. totalSupply() - Establishes how many tokens will be in circulation; balanceOf() - function allow for checking balance of a particular address; transfer() - transfers ownership of a token amount to another address; transferFrom() - used to automate the transfer of funds from one account to another; approve() - gives approval of another address to transfer funds
    allowance() - gives balance remaining in account, and what can be transacted, transferred or withdrawn
1 Like

Homework on ERC20 token standard.

What are the benefits of setting a token standard like ERC20?
Efficiency. Interoperability, integration. No friction. In opposit of everyone structuring differently.

What functions are in the ERC20 Token Standard Interface and what do they do?
totalsupply. Tracks sum of all balances.

balanceOf()

Provides the sum of tokens held by a given address.

transfer()

Transfers tokens directly from the message sender to the recipent address.

approve()

Token holder uses this for giving allowance to another address.

transferFrom()

?

allowance()

provides the number of tokens allowed to be transferred from a given address by another given address

1 Like
  1. Interoperability between tokens. Efficiency for the network as a whole. Reduced friction since everyone is moving in a unified fashion.

  2. totalSupply() - Establishes how many tokens will be in circulation
    balanceOf() - function allows for checking the balance of a particular address
    transfer() - transfers ownership of a token amount to another address
    transferFrom() - used to automate the transfer of funds from one account to another
    approve() - gives approval of another address to transfer funds
    allowance() - gives balance remaining in the account, and what can be transacted, transferred or withdrawn

1 Like
  1. All tokens and smart contracts built on the Ethereum network can communicate with each other.
  2. Balance Inquiry balanceOf() - gives balance of a specific account,
    totalSupply() - gives total number of fungible tokens.
1 Like
  1. By setting a token standard for ERC20 you can allow for proper communication for the projects being built on Ethereum to act as intended and also allow for effective troubleshooting to use the standards as a reference.
  2. Some examples are ERC20 functions are:
    totalSupply() - fetches the total token supply
    balanceOf() - allows a smart control to store and return the balance of an individual address
    trasnfer() - allows user to transfer a specified amount of currency to another user
1 Like
  1. Provide a common set of features and interfaces for successful token contracts, allow wallet tokens balances, create a means for exchanges to list more by providing address of the token’s contract, and lastly, almost every token are created in that way.

  2. Implementation APY standard within the SC, basic functionality to transfer tokens, approved to be spent by another on-chain party and a standard interface allows any tokens to be re-used by other apps to decentralized exchanges.

1 Like
  1. They are fungible and go across the entire ethereum platform making it easier and more scalable.
  2. balanceOf(address account) Public view returns (unit 256) return_ balances [account];
1 Like
  1. ERC20 enables wallets and exchanges to be interoperable with all tokens created using the standard.
    2.totalSupply- shows the amount of tokens in circulation
    balanceOf- lists the balance of a particular address
    tansfer- moves tokens from one address to another
1 Like

If you set a token standard like ERC20 it allows the whole space to interact with each other. If we use the same standards it will allow us to make programs that can talk to each other.

One of the functions in ERC20 is totalSupply, this function needs to exist otherwise the token will not have a supply. A few other standard functions are: BalanceOf, transfer, allowance.

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

It allows everyone to speak the same language and to be able to interact with each other to create a frictionless, efficient ecosystem. Existing wallets or exchanges already know how to support a new ERC20 token.

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

Example of ERC20 functions are –

totalSupply() – which creates the total token supply
balanceOf() – to check the balance of a particular address

transfer() – transfers money to another address

1 Like
  1. Benefits: Increase of efficiency. All tokens will be able to communicate with eachother in a known and expected way. It allows wallets, exchanges and platforms to support any tokens using the same standard. It makes the life easier for programmers since they work in the same enviroment.

  2. function toatalSupply() = Provides information about the total token supply.
    function balanceOf() = Provides the number of tokens held by a given address. Anyone can
    query any adress’ balance, as all data on the blockchain is public.
    function allowance() = Return a set number of tokens from a spender to the owner.
    function transfer() = Execute transfers of a specified number of tokens to a specified address.
    function approve() = Allow a spender to withdraw a set number of tokens from a specified
    account.
    function transferFrom() = Execute transfers of a specified number of tokens from a specified
    address
    Additionally, these function will trigger up to two events, including the transfer event and the approval/validation event.

1 Like
  1. Every wallet and exchange will be able to handle and accept any new token with the standard from launch day without any issues.

  2. balance0f() queries a wallet for the amount of tokens held in that specific wallet.

transfer() sends an amount of tokens from the message sender to the recipient.

approve() gives approval to an address to transfer a certain amount of tokens.

transferFrom() transfers the allowed amount of tokens from an address.

allowance() queries the amount of tokens allowed to be transferred from an address by another address.

2 Likes
  1. What are the benefits of setting a token standard like ERC20?
    A standard defines how tokens are programmed. It is important they are programmed the same way, so all exchanges and wallets can accept them.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply - how many tokens are in circulation
    balanceOf - shows balance of an address
    transfer - transferring money to different address

2 Likes

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

It creates common rules that programmers can follow that result in each token created can interact within the same programming environment. This allows increases scalability and eases development in the space.

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

Here’s just a few:

totalSupply() : provides the total supply of the tokens.
balanceOf(): provides the balance of tokens in an address.
transfer(): transfers tokens from one address to another.

2 Likes

1- It can be easily added to an exchange. It can be used in same wallets. it can be sent by the same network.
2. balanceOf(): provides the number of tokens held by a given address.

  • approve() --> part of a 2step transfer: authorizes to transfer an amount of tokes to another
    given address
2 Likes
  1. Integration and interoperability, this is how we achieve efficiency.
  2. function totalSuplly()
    function balanceOf()
    function transfer()
    function allowances()
    function approuve()
    function increaseAllowance()
    function decrease allowance()
2 Likes
  1. What are the benefits of setting a token standard like ERC20?
    Standarization is important; it ensures all the tokens created within ERC20 use the same language and makes it scalable and “easy” to build upon it.
  2. What functions are in the ERC20 Token Standard Interface and what do they do? TotalSupply - Returns the total #of token that have been supplied; balance0f - returns the balance of a specific address (used by wallets for example); transfer - transfers tokens from one address to another.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    It makes it easy to connect to a wallet or exchanges since they have common naming in the code.

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

totalSupply() equals the sum of all balances.

balanceOf(address account) 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() emits details of approvals of tokens from one address to another

allowance() provides the number of tokens allowed to be transferred from a given address by another given address

1 Like

1: It allows the interoperability of all tokens on wallets and exchanges. It also, creates tokens that are fungible, ie identical to one another.
2: There are many functions like adding, subtracting, multiply, divide,. When creating a new token you must also specify total supply, and you can query balances of addresses and also transfer these balances from one address to another.

1 Like