Homework: ERC20

  1. ERC20 is basically a language standard and a set of rules that helps integrate a new token. Meaning that a token built with an ERC20 interface, it can be recognised and used by wallets and exchanges that accept this standard.

Functions of ERC20:

  • 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() a token holder gives another address (usually of a smart contract) approval to transfer up to a certain number of tokens;

  • transferFrom(): takes tokens from the sender’s account;

  • doSomething(): simply operates an instruction;

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

1 Like

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

If all tokens use same standards, its much easier to add your tokens too wallets and exchanges

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

balanceOf()

totalSupply()

transfer()

allowance()

transferFrom()

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

    The benefit of setting a token standard like ERC20 all apps built on the blockchain are inter-operable.

  2. 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(): transfer a number of tokens directly from the message sender to another address.

    approve(): a token holder gives another address approval to transfer up to a certain number of tokens(allowance)

    transferFrom(): take certain tokens from senders account and moves them to the receivers account

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

Standard programming language for tokens means that the market can operate efficiently. If every contract was written in a unique way, the system would operate more slowly.

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

balanceOf() shows the token balance belonging to an account.
transfer() moves tokens from one address to another address.
doSomething() can use another function like transfer () to execute a command.
allowance() sets the maximum transaction size from an account.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • This makes it as friction free as possible and allows developers, exchanges and wallets to easily add there tokens.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • Transfer: transfers a number of tokens directly from the message sender to another address.
    Approve: Token holder gives another address (usually of a smart contract) approval to transfer up to a certain number of tokens, known as an allowance.
    Allowance: Provides number of tokens allowed to be transferred from a given address to another given address.
1 Like

1 - It promotes best practices, its easy to interact with other parties such as exchanges, wallets, and other contracts, and it reduces admin friction.

2 - The functions are: Balance inquiry balanceOf(), issue/burn tokens, Manage token ownership, totalSupply()

1 Like
  1. Enhances token liquidity, reduced risk of contract breaking, reduces the complexity of token
    interaction, uniform and fast transaction, confirms the transaction more efficiently.

  2. The balanceOf() function provides the number of tokens held by a given address.
    The transfer() function transfers a number of tokens directly from the message sender to another
    address.
    The doSomething()
    approve() and transferFrom() are two functions that allow the above scenario to work using a two-
    step process. In the first step a token holder gives another address (usually of a smart contract)
    approval to transfer up to a certain number of tokens, known as an allowance. The token holder
    uses approve() to provide this information.
    The allowance() function provides the number of tokens allowed to be transferred from a given
    address by another given address.
    ERC-20 defines two events that must be triggered when the contract takes the relevant action. The
    first event is Transfer() which emits details of the movement of tokens from one address to another.
    The second event is Approval() which emits details of approvals of tokens from one address to
    another.

1 Like
  1. Having standards like the ERC20 allows wallets and exchanges to be programmed to support any token that uses that standard. Moreover, standards allow different applications to talk to each other, promoting interoperability and integration among different tokens.
  2. Functions in the ERC20 Token Standard Interface describe and allow to deploy certain operations, like:

totalSupply(): gives maximum number of tokens that exist

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(): a token holder gives another address approval to transfer up to a certain number of tokens(allowance).

transferFrom(): take certain tokes from sender’s account and carry on its work.

doSomething(): to operate instructions.

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?

It sets a common mode of interaction, interface, and engagement via smart contract features within the network ecosystem

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

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

1 Like

Homework ERC20

  1. What are the benefits of setting a token standard like ERC20?
    This allows all wallets and exchanges to support new tokens from the outset

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

  1. efficiency
  2. totalSupply, balanceOf, transfer, allowance… they execute inside the smart contract and talk to each other

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

The benefit is that by using the same standard in programming, commonality is assured in writing the computer code. Imagine you are trying to build a multi-storey building and all the workers speak the same language and this language is used to build all the floors all the way to the top.

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

  • 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. What are the benefits of setting a token standard like ERC20?
    Having a standard like ERC20 allows all wallets, exchanges, etc to be able to communicate with each other. It increases efficiency and allows tokens of the same standard to be compatible.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    a few are: totalSupply() this give the total supply of tokens that exist.
    balanceOf(account) the balance of which ever account is passed in as the argument.
    transfer() will transfer their ERC20 tokens to the public address they desire.

1 Like
  1. Setting standards like ERC20 allows all systems to act upon the token code the same way, creating interoperability between all systems on the network.
  2. Function list of the ERC20 standard:
    • balanceOf()
    • transfer()
    • approve()
    • transferFrom()
    • allowance()

[quote=“filip, post:1, topic:8440, full:true”]
Homework on ERC20 token standard.

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

ERCs (Ethereum Request for Comments) are technical documents used by smart contract developers at Ethereum. They define a set of rules required to implement tokens for the Ethereum ecosystem.

ERC20 the protocol Standard list of benefits:

  • Token implementation and execution become easy for developers.
  • ERC20 is a protocol standard that defines and maintains certain rules and standards for issuing tokens on Ethereum’s network; it is a simple interface that allows for the creation of tokens on Ethereum that can be re-used by other applications, from wallets to decentralised exchanges.
  • ERC20 tokens offer high liquidity.
  • Smart-contracts ensure that transactions are risk-free.

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

The functions in the ERC20 Token Standard:

  • ERC20 defines the functions
  • balanceOf: the account balance of another account with address
  • totalSupply: total token supply
  • transfer: Send value amount of tokens to address.
  • transferFrom: Send value amount of tokens from address.
  • approve: Allow 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.
  • It also has a few optional fields like the token name, symbol, and the number of decimal places with which it will be measured.
1 Like
  1. Setting standards means that we can create new applications and everyone can then talk to everyone else. All wallets can talk to all tokens.

  2. totalSupply - total amount of tokens
    balanceOf - account owner balance
    transfer - transfere a certain amount of tokens
    transferFrom - transfere a certain amount of fund from an address

1 Like

Good answers, just keep in mind that its ERC20 Token, not ERC320. Keep the good job! :slightly_smiling_face:

Carlos Z.

Hello sir(s), if you can please describe what it does each function, if you have any doubt on them, let us know so we can describe it together! :slight_smile:
@Eivissa , @samjd , @Jody

Carlos Z.

I will expand in my previous thread.

1 Like

balanceOf() - provides the number of tokens held by a given address.
transfer() - sends tokens directly from one the message sender address to another
approve() - allows the smart contract to take up to the allowance amount from the wallet
transferFrom() - is usually used by the smart contract to consume the amount needed to perform its operation. This amount must be less then or equal to the allowance defined by the approve() method
alllowance() - returns the amount of allowance defined by the approve() method. It also must respect the available balance of the wallet.

1 Like