Homework: ERC20

Total supply : gives maximum number of tokens that will ever exist.
balanceOf address account: gives a 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?
    Makes the different tokens exchange easily, allowing wallets ti provide token balances for different token.
  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(): transfers a number of tokens directly from the message sender to another address. But it doesn’t work well when tokens are being used to pay for a function in a smart contract.

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. Having a standard like ERC20 allows wallets and exchanges to be programmed to support any token using that standard.
  2. totalSupply - returns a uint of the total supply of that token
    balanceOf - given an address it returns their account balanceOf
    transfer - transfers an amount to a specified address from the owner of the contract
    transferFrom - specifies a from address, to address and a value to transfer
    approve - When called the owner of the contract authorises the address to withdraw tokens from the owners address
    allowance - returns the amount remaining (I think)
1 Like
  1. What are the benefits of setting a token standard like ERC20?

This standard allows for all tokens and wallets to communicate effectively amongst each other. It also allows for all new tokens to be supported by exchanges and wallets immediately.

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

totalSupply - gives maximum number of tokens that exist
balanceOf(address account) - gives available ERC20 token balance for an account
transfer() - allows you to transfer ERC20 tokens to another account

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    A standard like ERC20 allows wallets, exchanges and platforms to interact with tokens seamlessly. This is also a benefit for programmers since all tokens based on this standard with have the same public interface.

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

  • balanceOf(account): returns the balance of the provided account
  • totalSupply(): returns the total supply of the token
1 Like
  1. Having the same ERC-20 standard allows exchanges to handle and communicate the tokens efficiently since it is has same features in the code.

  2. Some of the ERC-20 token standard includes:

    totalSupply() <- Programs the total supply of the token
    balanceOf(address) <- shows the balance of a given public address
    transfer() <- allows transferring of the tokens to given addresses from the owner of token.
    transferFrom() <- Transfer funds from address to an other
    allowance() <- Checks if a user has enough token balance to send to another in a transaction
    approve() <- Checks the balance against the total supply of token in a transaction

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    We can easily integrate in interoperate with each other achieving greater efficiency and that all exchanges and all of wallets will be able to support these tokens from day one.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply() - function provides the total number of tokens in the circulation.
    balanceOf() - function provides the number of tokens held by a given address.
    transfer() - function transfers a number of tokens directly from one address to another.

1 Like

1 The benefits of token standard are, it allows you to interact with Web servers , Exchanges and Wallets with out admin friction. It also promotes programming best practices.

2 totalsupply() allows contract to calculate and return the total amount of the toke that
exits in circulation.

balanceOf() allows a contract to store and return the balance of the provided address.

approve() the owner of the contract authorizes, the given address to withdraw
instances of the token from the owner’s address.

transfer() allows the owner to send a given amount off the token to another address

ansferFrom() allows a contract to automate the transfer process and send a given amount of the token on behalf of the owner.

1 Like
  1. Standards are good. Every entity mut follow the same standard. E.g. in case of Cryptocurrencies on ERC 20 - this means that every currency would have the same function etc. The standards help to make easier implementation of them on Wallets, Exchanges, and various platforms that might use smart contracts.
  2. ERC20 has several functions: totalsupply -> total supply of all tokens/coins (fungible = not unique), and balanceof -> provides a balance of a specific account.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    ERC20 standard is well-implemented in the whole ecosystem of cryptocurrencies like wallets, exchanges.
    Indeed, those smart contract implements the IERC20 interface that force programmers to use some exact function names like ‘totalSupply()’ for example.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply() -> returns the total supply of the token
    balanceOf(address account) -> returns the balance for the given account address
    etc …

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Having a standard, all of wallets and exchanges can communicate without having to go through translation layers.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply() - outputs the total number of tokens that exist
    balanceOf() - outputs a public address balance
    transfer() - used for transferring ERC20 tokens to another public address

1 Like
  1. The benefits of setting a token standard like ERC20
  • Exchanges and wallets can support new tokens from the day one.
  • All deafferent tokens have same structure by the standard, they can interact with each other efficiently.

  1. Functions in the ERC20
    ERC stands for Ethereum Request for Comments . ERC20 defines 6 obligatory functions your smart contract should implement, plus 3 optional ones.

Optional functions include:

  • name
  • symbols
  • decimals

Mandatory ones are trickier:

  • Total supply – the amount of tokens that exist at the moment
  • Balance of – shows the balance for the address
  • Transfer – sends a certain amount of tokens to the address
  • Transfer from – used for exchanging tokens among users who have these tokens
  • Approve – verifies that your the wallet address is eligible to send tokens to another user
  • Allowance – shows whether or not a user has a balance sufficient to send tokens to someone else

These 6 functions are recognized and identified by other smart contracts. In a nutshell, the ERC20 token plays well with other smart contracts, and that’s why it is so popular.

Source: How to Build Your ERC20 Token Quickly and Easily (applicature.com)

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

It allows a unique process that can be read by everyone that knows the standardized language. This way, the code can interact with wallets, exchanges, other smart contracts, etc.

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

Functions

- 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
- approve() function allows a token holder to give another address (usually of a smart contract) approval to transfer up to a certain number of tokens, known as an allowance
- allowance() function provides the number of tokens allowed to be transferred from a given address by another given address

Events

- Transfer() emits details of the movement of tokens from one address to another
- Approval() emits details of approvals of tokens from one address to another

Taken from ‘Understanding ERC-20 token contracts’, Jim McDonald 15/09/2017 https://www.wealdtech.com/articles/understanding-erc20-token-contracts/

1 Like
  1. Any exchange, wallet can interact with ERC20 tokens in the same way, if one token would have another functions or even different name of the function than standard, it will not be supported as exchanges and wallets support only standard smart contracts
  2. Transfer -> transfer a token from one address to another address.
    TotalSupply -> returns a total supply of the token.
    BalanceOf -> returns a total balance of a particular address
1 Like
  1. Having a standard like the ERC- 20 , will allow the industry to grow as there will be a uniformity and all contracts will be able to talk to each other in an efficient way.
  2. balanceOf() Gives balance of a specific account, totalsupply the number of total fungible tokens.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    All the tokens an projects are able to communicate with each other since the use the same standards and terminology in programming language

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Totalsupply: lets everyone know the actually supply of the token
    Balance: lets everyone know about the actuall balance of a certain account

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    If you do the standard ERC20 contract, wallets, exchanges and other platforms easily can interact with your token.

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

totalSupply - gives maximum number of tokens that exist
balanceOf(address account) - gives available ERC20 token balance for an account
transfer() - allows you to transfer ERC20 tokens to another account

1 Like
  1. Setting a token standard makes it easier for wallets and exanges to communicate with the tokens
  2. balanceOf(adress acc.) shows the balance of a specific account
1 Like
  1. What are the benefits of setting a token standard like ERC20?

It allows apps to communicate with tokens.

  1. 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() - transfers tokens from the sender’s address to a recipient’s address

approve() - gives a recipient’s address approval to transfer up to a certain amount of tokens (allowance) from the sender’s address to pay for the operation of the smart contract.

transferFrom() - takes a number of tokens up to the allowance from the sender’s address to the recipient’s address to pay for the operation of the smart contract.

allowance() - queries the approved amount to be transferred from a given address by another given address.

1 Like
  1. The benefit of setting a token in ERC20 is that it is easy to set and have a standard. This makes makes tokens capable to interact with others ERC20 tokens and platform that know how to interact with ERC20 tokens. It make easier the interaction between project and platform.

  2. They define the characteristic of the token as example, circulating supply, balance etc…

1 Like