Homework: ERC20

I thought balanceOf gave you the address of an account.

1 Like

Wouldn’t it give you the address of the account and the balance in it?

1 Like

I suppose one comes with the other.

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

A:It ensures interoperability between wallets and applications

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

A:
Balance= Number of tokens in any given address
Transfer= Send X Tokens from owners address to address B
Approval= Checks smart contracts for readiness to deploy
Total supply= Tokens in Circulation

1 Like

BalanceOf function returns the amount of tokens that an account (address) holds on that smart contract.

For example, if you hold DAI token, you can use the balanceOf function here (the # 4) to check how many tokens your address hold (just paste and click on query), the amount will be showed in decimals.

https://etherscan.io/token/0x6b175474e89094c44da98b954eedeac495271d0f#readContract

Hope you find this useful.
If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

2 Likes

1 A standard allows new people to make tokens that can communicate with wallets. It allows for inoperability.

2 totalsupply ( )- Tells us the total supply of ETH
balanceOf ( ) - tells us the balance of ETH in a wallet
transfer ( )- transfers from the message sender to a receiver wallet
allow ( ) transferFrom ( ) - 2 step process to send to a smart contract

2 Likes
  • What are the benefits of setting a token standard like ERC20?
    all tokens created with this standard can be used in current exchanges and wallets; ERC20 is also a set of standard names for functions to communicate with other entities

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    for example:
    totalSupply() - returns the total supply of the token
    balanceOf() - returns a number of tokens held by a given address
    transfer() - transfers a number of tokens directly from a message sender to another address
    allowance() - returns a number of tokens allowed to be transferred from one address to another

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    It makes easier the creation of valid tokens.
    Makes possible verifying all kind of smart contracts.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply () the sum of all balances
    balanceof()number of tokens of an address
    transfer() sending tokens from one user to another
    approve() approval to transfer up x number of tokens
    transferFrom() takes tokens from a specific address
    allowance () number of tokens allowed to be transfered from a given adress by another given adress

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

When they function with the same standard, all exchanges and wallets can support them without any problem.

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

totalsupply() how many tokens are in circulation.

balanceOf() the number of tokens held by a given address.

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

doSomething() a function that requires something to perform.

approve() approval to transfer up to a certain number of tokens.

transferFrom() approval to transfer from a certain account. ``

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

1 Like
  1. token standard allows to create coding standard. It’s easier to code and to read code. It also helps with adoption on Exchanges and wallets. It’s easier to add an asset to Exchange if it’s standardized.
  2. there are standard functions in the ERC20 Token like:
    transferFrom(), approve(), balanceOf(). They are easy to read and understand the meaning.
1 Like
  1. The benifits on setting a standard with a token are primarily the adoptability of the tokens, when everything knows how to interact within the standard everyone can use the tokens.

balanceOf() : provides the number of tokens held by an address
transfer() : transfers a number of tokens from one address to another
approve() : gives approval to transfer tokens
allowance() : allows a specified number of tokens to be transfered to the given address

1 Like
  1. By setting a token standard all wallets and smart contracts can be read without any friction/issues as they are all speaking the same language.

  2. Some of the functions in the ERC20 token standards are, Total supply to give you the amount of tokens that are in circulation. Another function is BalanceOf which gives you the balance of a particular address.

1 Like

1.Most of the wallets and exchanges can support and interact with the tokens.It also reduces frictions. And it is important for token to be standard to propel the entire block chain network forward.
2.totalSupply() which shows the total amount of tokens in the cryptocurrency created, balanceOf() gives a balance of a specific account. allowance- returns the amount remaining

1 Like
  1. The benefits of setting a token standard like ERC-20 is that all Ethereum smart contract developers have the same language structure in which to program, also making it easy and quick to deploy across different trading platforms and wallets because they all already support the same ERC-20 standard.

  2. ERC-20 functions include:

  • totalSupply = how many tokens are in circulation
  • balanceOf = gives the balance of an address
  • Some others: transfer, allowance, increaseAllowance, approve, decreaseAllowance, mint.
1 Like

1- A token standard such as ERC20 allows to have common ground upon which tokens are built. It facilitates communication between contracts and interoperability

2- Many functions are embedded in the ERC20 token standard. There are:

  • BalanceOf() - to provide the balance of a given address

  • transfer() - to send tokens directly from a holder address to a recipient address

  • approve() - to grant permission to send tokens from a holder address to an allowance address (smart contract address)

  • transferFrom() - to execute the approve() function by transferring tokens from the holder address

  • allowance() - to check the number of tokens allowed to be transferred by a given address

1 Like
  1. The standard allows for the network and wallets to easily interact with all tokens.

  2. totalsupply - returns the total amount of that token in circulation
    balanceOf(account address) - returns the balance of that specific account
    transfer - moves tokens to another account address

1 Like

With a standard all exchanges, wallets and apis know how the contract is used. Thus eliminating the need for special treatment of each contract.

balanceOf , totalSupply , transfer , transferFrom , approve , and allowance

  1. It sets the standards and parameters the tokens use, making it easier to integrate with wallets and exchanges and facilitating adoption.

  2. The standard functions of ERC20 are:

  • totalsupply() fetches the total supply of the token;
  • balanceOf() returns the balance of a specific address;
  • allowance() provides the how many tokens can be transfered from one account;
  • transfer() makes a transfer from one address to another.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Compatibility

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply returns the amount of those tokens.
    balanceOf returns the balance of the given account.
    transfer, transfers sends money to another account.

1 Like

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.

1 Like