Homework: ERC20

  1. The ease of compatibility and interoperatibility between diferent smart contratcs
  2. balanceOf() provides the number of tokens held by a given address.
    transfer() transfer tokes from the message sender to another address
    approve() gives another address aproval to transfer up to a certain number of tokens.
    transferFrom() tranfer token from a given address that previous had given approval for that
1 Like
  1. Many applications can be built that can communicate easily with each other. One wallet can accommodate different applications. Efficiency can be attained in a frictionless environment because all contracts are stuctured in one standard way.

  2. totalsupply function shows the amount of tokens in circulation
    balanceof shows the balance of a particular address
    transfer shows what has been transferred and where

1 Like
  1. Big benefit for all crypto space is standard ERC20 tokens witch use the same programming language
    and functions, because it easy to communicate between.
    2 TotalSupply() gives maximum number of tokens that exist
    balanceOf() gives a public addresses balance of ERC 20 tokens
    transfer () allows someone to transfer their ERC20 tokens to another public address
1 Like

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

dApps can easily communicate with the ETH ecosystem and everything that interacts with it.

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

[Not functions, but these are helpful to know. Functions below]
Name: name of the token
Symbol: akin to stock ticker symbol
Decimals: how divisible a token can be. Defines how balances are displayed.
Totalsupply: the sum of all balances

Functions
balanceOf(): # of tokens @ an address
transfer(): move tokens from one address to another
approve(): approval to transfer tokens
allowance(): # allowed to be transferred to another address

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    -> Different applications can be built on one standard, which ensure that all parts / constituents of the network are able to communicate and interact.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    -> totalSupply() - Get the total token supply
    -> `balanceOf() - Get the account balance of another account
    -> transfer() - transfers a number of tokens directly from the message sender to another address
    -> approve() - approval to transfer up to a certain number of tokens
    -> transferFrom() - Send value amount of tokens from address to another address
    -> allowance() - provides the number of tokens allowed to be transferred from a given address by another given address
1 Like
  1. One of the benefits of setting a token standard include interoperability between wallets and applications for all tokens that abide by the standard. The advantage of the interoperability include less confusion and more speed in developing programs that deal with these tokens.
  2. a) balanceOf() is a function that gets the balance of the number of tokens on an address.
    b) transfer() is a function to transfer tokens from one address to another.
    c) totalSupply() is a function that notes the total supply of the tokens.
1 Like
  1. Thal all wallets and exchanges will support the token
  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, not used in paying for functions within the smart contract.
    To pay for these functions we have to use approve() to allow SC use tokens defined as “allowance” and when any function is called SC is using transferFrom() to take tokens from allowance as a payment.
    The allowance() is providing info about how many tokens are in the allowance.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    ERC20 is one of the most important standards for Ethereum: It defines how we call all program tokens. It’s good that all developers program in the same way. It means that all exchanges and wallets will support these tokes from day 1, it’s beneficial for the entire space.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    balanceOf() - gives the number of tokens held by someone.
    transfer() - moves funds from one address to another
    aprove() and transferFrom() are 2 functions that work together in case that the tokens to be transfered are being used as payment in a smart contract
    The items in the token contract are:
    name - is the name of the token contract is the long name by which the token contract should be known
    symbol - is the symbol by which the token contract should be known
    decimals - because Ethereum does no support support decimals. If the token contract represent an indivisible entity then decimals should be 0.
    totalsupply - is the sum of all balances

1 Like

Can interact with other contracts, wallets and exchanges and its becomes easier for programmers to work if everything has a standard to follow.

totalSupply - total token supply.
balanceOf - account balance of another account.
transfer- transfers a number of tokens directly from the message sender to another.
approve - allows spenders to withdraw from your account multiple times.
transferFrom - transfers value amount of tokens from address to address.
allowance - returns the amount which spender is still allowed to withdraw from.

1 Like

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

Having a standard (ERC20) all tokens speak the same language this helps programmers to understand and provide improvements, as well as exchange and wallets can support the token from day 1.

2-What functions are in the standard interface of the ERC20 token and what do they do?

For ERC20 tokens we have many functions among which we can mention:

  • Transfer () this function is used when sending tokens from one address to another.
  • Allowance () this function gives us the number of tokens allowed to be transferred from one address to another address.
1 Like
  1. each wallet can support erc20 tokens from the beginning of supply. there are defined several standard functionalities, which would be supportet from each token and each wallet
  2. balaceOf() returns balance of a specific axxount
    totalSupply() returns the number of tokens which exists
    transfer() transfers a number ob tokens from A to B
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    -It creates efficiency. Standards allows communication within the network. Without standards wallets could not recognize different tokens.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply() which checks the total supply of the tokens. balanceOf() gives the balance of specific account.
1 Like
  1. Setting a token standard like ERC-20 enables different developers, working on different projects, to write smart contracts for tokens which have the same naming and syntax conventions, even though the different tokens and smart contracts themselves have been created for a wide variety of different purposes and to achieve different outcomes. This enables interoperability between different smart contracts and applications, which in turn leads to more efficiency within the ecosystem as a whole. For example, by programming a new token according to the ERC-20 standard, this will automatically make it compatible with wallets and other applications which already interact with smart contracts for other ERC-20 tokens. Therefore, existing wallets will be able to display account balances for the new token, and it will be much easier for exchanges to list it. In addition, once a developer has learnt to write smart contracts according to a particular token standard, the same task then becomes easier and quicker to perform, leading to an increase in the developer’s productivity in that particular area.

  2. Functions in the ERC-20 Token Standard Interface:

function name()
Returns the name of the token e.g. “Basic Attention Token”.

function symbol()
Returns the abbreviation used to represent the token e.g. “BAT”.

function decimals()
Returns the number of decimals the token uses.
e.g. ‘8’ means that when displaying the token amount to users, the decimal point is placed before the last 8 digits of the corresponding numerical value in Ethereum.
e.g. ‘0’ means that a token is indivisible.

function totalSupply()
Returns the total number of tokens in circulation. This is equal to the sum of all address balances for the token.

function balanceOf(address _owner)
Returns the total number of tokens held in a specified account address (_owner).

function transfer(address _recipient, _amount)
Transfers a specified number of tokens (_amount) from the sender’s account to another user’s account address (_recipient).

The following two functions enable a user to pay a smart contract for performing operations:

(i) function approve(address _contract, _amount)
This first allows a specified smart contract address (_contract) to withdraw tokens from the user’s account multiple times, up to a specified limit (_amount) i.e. the user is effectively setting a budget, and giving the smart contract an allowance, for future operating costs.

(ii) function transferFrom(address _user, address _contract, _amount)
Whenever the user asks the smart contract to perform a certain operation, the smart contract now has the necessary permission to transfer a set number of tokens equal to the cost of that particular operation (_amount) from the user’s account address (_user) to the smart contract address (_contract), provided that both the user has sufficient tokens in their account to cover the cost and the smart contract’s allowance limit will not be exceeded.

function allowance(address _owner, address _contract)
Returns the amount of tokens a specified smart contract address (_contract) is still allowed to withdraw from another specified account address (_owner) i.e. the funds a smart contract is still entitled to withdraw from another account.

1 Like
  1. All tokens implementing the ERC20 standard conform to an interface which is understood by the various software which handle them, such as exchange platforms and wallets.

  2. The ERC20 token standard defines the following functions:

   // gets the total supply of the token
   function totalSupply() constant returns (uint theTotalSupply);

   // gets the balance of a particular address
   function balanceOf(address _owner) constant returns (uint balance);

   // adds a given number of tokens to a given address
   function transfer(address _to, uint _value) returns (bool success);

   // moves a given amount of tokens from one address to another
   function transferFrom(address _from, address _to, uint _value) returns (bool success);

   // authorizes a given address to remove an amount of tokens from the owner's address
   function approve(address _spender, uint _value) returns (bool success);

   // gets the number of tokens allowed to be transferred from one address by another address
   function allowance(address _owner, address _spender) constant returns (uint remaining);
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. 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. Having a token standard like ERC20 allows the whole community to interact together and be in constant communication and harmony.

  2. We do have numerous function and the common one are:

tokenSupply: which give a detail report of the total token supply available.
balanceOf: This gives the total balance of an account.

1 Like
  1. When creating a standard that everybody use, then it will high the efficiensy of the whole space, becoase everybody buids the smart contracts in the same way.
  2. the total suply function is totalSupply()
    the balanses of the adress is balanceOf() and
    the transfer function is transfer()
    and I guess that it´s many more baced on the awnsers in this thred :sweat_smile:
1 Like
  1. common language promotes communication (=use)

-totalSupply() returns maximum number of tokens that exist;
-balanceOf() returns the balance of a specific address;
-transfer() transfers tokens from the sender to receiver address;
-allowance() shows the amount of tokens allowed to be transferred;

1 Like
  1. Benefits of setting an ERC20 token standard include, efficiency, universality, scalability, and an ability to add new tokens with ease instead of having to reinterpret new coding languages or conventions for each new token.

  2. balanceOf() provides the number of tokens held by a given address.
    transfer() function transfers a number of tokens directly from the message sender to
    approve() and transferFrom() are two functions that allow tokens to pay for functions on
    smart contracts.
    allowance() function provides the number of tokens allowed to be transferred from a
    given address by another given address.

1 Like