Homework: ERC20

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

The benefits are that if you create an ERC20 token it will be readable by all wallets that can interpret ERC20 standards, it also creates better communication in the community.

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

function totalSupply() - Returns the token total supply.

function balanceOf(address _owner) - Returns the balance of an especific account.

function transfer(address _to, uint256 _value) - Transfer tokens to another account.

function transferFrom(address _from, address _to, uint256 _value) - For transfer tokens from an specified account to another.

function approve(address _spender, uint256 _value) - Allows spender to withdraw from your account multiple times.

function allowance(address _owner, address _spender) - returns the total amount of tokens that an account can transfer to another account.

event Transfer(address indexed _from, address indexed _to, uint256 _value) - to transfer tokens from the sender’s address to another address.

event Approval(address indexed _owner, address indexed _spender, uint256 _value) - When aprove function is succesfull, this event is needed for triger that call.

1 Like
  1. Having standards like ERC20 means that all developers will create tokens in the same way, so all exchanges and all wallets will be able to support them, becouse they will all have the same fungible standard.
  2. The functions that ERC20 Token Standard Interface have are:
    1. totalSupply: Shows how many tokens are in circulation.
    2. balanceOf : You give the address of the account that you want to get the balance.
    3. transfer: Transfers amount of ERC20 tokens from owner to recipient.
    4. approval : A number of address give the approval (permission) to transfer an amount of funds from the given address.
    5. allowance: Checks if the address has enough balance to send the specific amount to another address.
1 Like

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

Token standards allow all projects that comply to communicate with the entire crypocurrency ecosystem, such as wallets, exchanges and applications

2. What functions are in the ERC20 Token Standard Interface and what do they do?
see https://eips.ethereum.org/EIPS/eip-20#methods

function name() public view returns (string).
Returns the name of the token - e.g. “MyToken”.

function symbol() public view returns (string)
Returns the symbol of the token. E.g. “HIX”.

function decimals() public view returns (uint8)
Returns the number of decimals the token uses - e.g. 8, means to divide the token amount by 100000000 to get its user representation.

function totalSupply() public view returns (uint256)
Returns the total token supply.

function balanceOf(address _owner) public view returns (uint256 balance)
Returns the account balance of another account with address _owner.

function transfer(address _to, uint256 _value) public returns (bool success)
Transfers _value amount of tokens to address _to, and MUST fire the Transfer event. The function SHOULD throw if the message caller’s account balance does not have enough tokens to spend.

function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
Transfers _value amount of tokens from address _from to address _to, and MUST fire the Transfer event.

function approve(address _spender, uint256 _value) public returns (bool success)
Allows _spender to withdraw from your account multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value

function allowance(address _owner, address _spender) public view returns (uint256 remaining)
Returns the amount which _spender is still allowed to withdraw from _owner.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Building dapps that rely on tokens is much easier when there are standardized functions for each token.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
1 Like

1. What are the benefits of setting a token standard like ERC20? The benefits are that it will make it much easier to communicate with one another, when theres a standard everyone must follow it can be easily implemented in different places, for example: Wallets & Exchanges.

2. What functions are in the ERC20 Token Standard Interface and what do they do? two functions i will use are balanceOf that gives balance of a specific account. And totalsupply which is the number of total fungible tokens.

1 Like
  1. it gives a foundation when creating all fungible tokens
  2. total supply and balance of are functions in the ERC 20 token, total supply tells the total supply of ETH and balance of gives the balance of the user
1 Like
  1. Token standards (ERC20 tokens) are favorable through providing easier adoption by wallets and exchanges, and over all efficiency.

  2. Some functions being-
    transfer() - function to send tokens to ones wallet
    totalSupply() - function to get total token supply
    balanceOf() - function to get ones token balance
    approve() - function for one to allow another account to withdraw tokens
    allowance() - function provides a given number of tokens allowed to be transferred from ones address to anothers

1 Like
  1. Standards are important for mass intergration and interoperability.

  2. The main fuctions in the ERC-20 token are all the tokenomics that you would need for a coin or token.
    Eg.
    TotalSupply()
    Transfer()
    Balance ()

1 Like
  1. Standards ensure all apps are interoperable and brings consistency to community by increasing efficiency.
  2. totalsupply, balanceOf(account), transfer, approve are few functions which are part of erc 20. Totalsupply gives number of tokens, balanceOf gives available token balance for an account, transfer is used to send to other account whereas approve allows user to approve the transfer to a function.
1 Like

1Wallets can communicate with different apos in the same way. It also prevents friction.

totalSupply: the total supply of the tokens

balanceOf: gives the balance of a specific adress

1 Like
  1. It allows developers and dapps to communicate seamlessly in an expected way.
  2. Here are the functions:
    totalSupply - Returns total token supply
    balanceOf - returns the account balance of another wallet address
    transfer - transfers value from one wallet to another
    approve - allows spender to withdraw from an account a certain number of times up to a value.
    allowance - returns the amount spender is able to withdraw from owner
1 Like
  1. Frictionless communication across wallets and contracts.
  2. The main functions:
    balanceOf: returns the balance of an account
    transfer: transfer tokens
    approve: approve spending the tokens
    transferFrom: transfer tokens from the account
    allowance: the amount of tokens that are approved to be spent
1 Like
  1. What are the benefits of setting a token standard like ERC-20?

It’s good to have token standards like ERC-20 because it allows all developers to create tokens exactly the same way and if all tokens look and function the same it means all exchanges and all wallets will be able to support these tokens from day one.

  1. What functions are in the ERC-20 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.

  • doSomething() - Operates instructions.

  • approve() - A token holder gives another address approval to transfer up to a certain number of tokens (known as allowance).

  • transferFrom() - Allows transfer of certain tokens from an allowance set by another address.

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

1 Like
  1. There are two main advantages with setting a token standard. The first is that more people can make tokens. If there are agreed upon standards that every token has to perform in a specific way, then more people can learn and understand the basics of building a token. This makes it easier for more tokens to come to market. Standards also make the tokens fungible. It’s easy to change currency with tokens, because I know that your token will act in the same way as every other token on the Ethereum platform.
  2. There is a "totalSupply) function that tells you how many tokens exist. There is a “balanceOf” function that gives you the balance of the tokens you have in your address. Tokens also have a transfer function that is included in their standards.
1 Like
  1. So that tokens are uniform and can communicate with each other.

  2. Functions include

  • total supply: looks to see how many tokens are in circulation

  • balanceOf: checks to see how much money is in a stated account

  • approve: The owner approves a spender to withdraw stated amount of funds from a stated address

  • allowance: checks to see how much spender is still allowed to withdraw from the owner

  • transfer: provides framework for transferring funds to a stated address

  • transferFrom: initiates actual payment

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

This standard system has made it possible for so many tokens on top of the Ethereum network to be created. Any token made under ERC20 will use the same functions and more or less the same lines of code. With ERC20, newly created tokens will automatically have the means to be accessible to any wallet that supports ERC20 tokens.

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

BalanceOf() represents the total number of tokens in an address, transfer() is used for transfer x number of tokens from one address to another, approve() is used to approve a transaction from one address to another and allowance() represents the number of tokens to be transferred from one address to another.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    The benefit to make the standards help the eco system become uniform and create unification, ease of deployment, ease of interaction in infrastructure, less admin issues and applications can be built that all can work together.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Total Supply = totalSupply()
    Balance of address account = balanceOf()
    Transfer Tokens = Transfer()
    Mint of tokens = Mint()
    Uniform functions have the same naming conventions and standards to work cohesively across the ERC20 ecosystem.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    It promote the space by facilitating integration, communication between exchanges and wallet owners.

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

  • balanceOf () = show the balance of token held by a given address
  • do something () = operate instruction
  • transfer () = transfer a number of token 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)
  • allowance () = gives the number of tokes allowed to be transferred from a given address to another

`.

1 Like
  1. So all Wallets/Exchanges can understand the same language and easy to process the transactions rather than decoding them to ERC20 standards used by all the rest of the tokens.
  2. Transfer - Currency transfer from One address to other, BalanceOf - Currency available in the address
1 Like
  1. Imposing standards allows wallets, etc to communicate and transact with each other easier, as they share common structure in their code.

  2. balanceOf() gives the user the balance of any specific account, whereas totalSupply() gives the maximum number of tokens.
    transfer() allows people to transfer their ERC20 tokens to someone else, another address.

1 Like