Homework: ERC20

  1. Benefits of setting a token standard is that it allows developers to create smart contracts taht are specific to different platforms depending on its use case. This is why there is the ERC20 standard for fungible smart contracts that can be hosted in wallets and exchanges, and there is the ERC721 standard for NFTs that are hosted in video game platforms.

  2. All ERC20 tokens have the below functions:

totalSupply() sets a cap on the maximum supply to the number of tokens available.

balanceOf(address account) shows the number of tokens held by an address

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

approve() functions to allows a token holder the ability to give another address approval to transfer up to a certain number of tokens.

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

1 Like

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

Token standardisation. ERC20 help us provide to our token a standard interface that allows on Ethereum to our token to be re-used by other applications e.g. from wallets to decentralized exchanges.

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

1. Function that returns the token name
2. Function that returns the token symbol
**3. Function that returns the decimals the token uses **
4. Function that returns the total token supply.
5. Function that returns the balance
6. Function that executes transfers
7. Function that transfer money
8. Function that approves
9. Function that returns allowance

1 Like
  1. Some of the benefits of using a standard like ERC20 is that it makes the process of creating a new token more simplified. It also allows wallets and exchanges to support all tokens that use the same ERC20 standard.
  2. balanceOf() returns the number of tokens in a given address, transfer() transfers funds from one address to another, totalSupply() return the total number of tokens that exist.
1 Like

1.) They are built on top of the Ethereum network and enables the creation of new tokens by developers to operate on many platforms.

2.)
totalsupply() shows the sum of all token balances in a token contract.
balanceOf() provides the number of tokens held by a given address. Since all data on the blockchain is public, anyone can query any address’ balance.
transfer() transfers tokens directly from the message sender to another address.
approve() provides an address with approval to transfer a certain amount of tokens (allowance)
transferFrom() takes tokens in order to do something once approval has been given.
allowance() provides number of tokens allowed to be transferred from a given address by another address

I don’t understand the concept of gas and why I’m needed to pay a certain amount for functions in a smart contract, such as ADD costs 3 gas. I want to guess that it is similar to mining where execution of the SC is rewarded, but the EVM isn’t a miner, so I’m a little confused by this. Could someone help me understand this?

1 Like

Gas is basically used to manage the cost of some operations that a Smart Contract want to execute in a specific function (transfer for example), this mean that the smart contract needs to calculate the operations required to execute the function logic, the computer power needed for those calculations comes from the miners and the GAS cost of the operation is used to pay the miners their time to calculate those for the smart contract and append it in the blockchain.

The EVM just execute the function logic of the smart contract and create a transaction that must be mined to append it on the blockchain, so they are put in a “mempool” waiting for a miner to grab it, calculate it and get the GAS fees for execute it. So the GAS is just used as a reward for the miners to be interested in mining a transaction.

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

2 Likes
  • What are the benefits of setting a token standard like ERC20?
    It is a structure that everyone can implement and use for whatever they want to create and this brings efficiency to the system as wallets and exchanges can add these token and everything runs smoothly.

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    there are certain functions in the ERC20 that have specific instructions. totalSupply() gets the total amount of tokens there are in the supply.
    balanceOf() can give the number of tokens that an address has
    transfer() sends tokens from sender to the recipient’s address

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

The benefits of using a standard like ERC20 are that once one understands the standard anyone can write software to interact with the ERC20 conforming smart contract, there is no need to learn a custom way of doing the same interactions with other tokens.

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

totalSupply() returns the total number of tokens that exist

balanceOf() returns the balance of a particular account

allowance() returns the remaining tokens of an allowance that one account was previously granted to spend from another account.

transfer() moves the number of specified tokens from one account to another account

approve() grants an allowance from one account to another

transferFrom() moves the number of specified tokens from an account’s allowance previously granted by another account

1 Like

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

  1. Having a token standard like ERC20 means that all exchanges and all wallets will be able to support these tokens from day 1.

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

totalSupply() Gives you how many tokens are in circulation
balanceOf() Get the account balance of another account
transfer() Send specific amount of tokens to another address

1 Like
  1. A token standard assures that all tokens are transferable and smart contracts are legible on the Ethereum network. It makes it possible to have transactions take less time and consensus to be reached easily.

  2. The ERC20 Token Standard Interface allows transfer of Tokens on the Networks between wallets in whole number amounts. Decimials are not allowed to simplify the token contracts. Tokens can be both minted according to the standard and smart contract of the tokens. This allows for newly minted coins to be fungible and used as intended in their smart contracts. Tokens can also be burned by being sent to a zero address. Total supply of tokens to allow for token farming and coins locked in smart contracts for transferal allow for further development of tokens and functions of the Ethereum network. All valid transfers of tokens will be reflected on sites that track transactions on the Ethereum network. All transactions that are invalid or sent to the inncorrect address will be lossed and are not tracked on the network.

1 Like
  • Community makes sure that all developers are creating tokens the same way, and make it easier to support any token that uses this standard.
  • totalSupply() : returns the total supply of a token, balanceOf() : returns the balance of an address
1 Like
  1. What are the benefits of setting a token standard like ERC20?

ERC20 defines a common list of rules that all Ethereum tokens must adhere to, including how tokens can be transferred, transactions can be approved, and the total supply of tokens. The commonality of the rules means that wallets and exchanges can effectively support any token that uses that standard.

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

totalSupply() – provides information about the total token supply

balanceOf() – provides account balance of the owner’s account

transfer() – executes transfer of a specified number of tokens to a specified address

1 Like
  • All developers create tokens with the same basic standards
  • Exchanges, wallets are able to manage tokens in the same way, easy for interoperability and uptake in that particular coin
  • balanceof () - provides the number of tokens held by a given address
  • Transfer () - transfers a number of tokens directly from the message to another address
1 Like
  1. the language is the same for every token built on top of it, that means that all wallets and exchanges can accept that token . the ERC20 standard makes possible evolution of the smart contracts and ideas

  2. allows users to check balances of accounts and transfer those balances

1 Like
  • What are the benefits of setting a token standard like ERC20?
    All exchanges and wallets can list these tokens.
  • What functions are in the ERC20 Token Standard Interface and what do they do?
    The different functions allow to keep the balances of the accounts updated.
    totalSupply() equals the sum of all balances
    balanceOf() function provides the number of tokens held by a given address
    transfer() function transfers a number of tokens from the sender to the receiver
1 Like
  1. Having a standard is great because that way anyone that programs code that is meant to apply to any ERC20 token will be able to use the same standard functions and not worry about how a particular developer chose to name a function or procedure.

  2. totalSupply() gets the sum of all balances of a particular token
    balanceOf() retrieves the number of tokens held be an address
    transfer() transfers tokens from one address to another

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    By following a Token standard it reduces friction between tokens and allows wallets to post the balances of multiple tokens on Exchanges. It creates Fungible.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?

The balanceOf() function provides the number of tokes held at a given address. The transfer() function sends the token directly from the sender to another address. The approve() function; a token holder gives approval to transfer up a set number of tokens from the allowance(). doSomething(): Perform operations in the smart contract.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    it makes it easier for exchanges and wallets to add these tokens because they use the same functions
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply(): the total supply of the token
    name: the token name
    symbol: the token symbol
    balanceOf() gives the amount of tokens held by a address
    transfer() allows transfer of tokens to a other address
1 Like
  1. Token standard are beneficial as they bring common language/function structure and make tokens fungible all together which are on same standard.

  2. Functions like totalsSupply and balanceOf are example of standard interface and they return the total token supply and balance for the requested address.

1 Like

1.- The benefit is that there is a standard and it allows wallets and exchanges to support tokens that use that standard. Therefore it makes the whole ETH network more efficient because there are no frictions and hundreds of different program codes

2.- totalSupply() = maximum number of tokens that exist
balanceOf () = public addresses’ balance of ERC20 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?
    It creates a uniformity for all tokens to follow making it easier for wallets, and exchanges to interact with the tokens.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    balenceOf() - gives account balance of an address
    totalSupply() - gives the number of total tokens
    transfer() - moves tokens to a given address
    approve() - gives approval to another address to transfer up to a certain number of tokens.

1 Like