Homework: ERC20

o The functions defined as standard in ERC20 will be available in all tokens using it. Applications interacting with functions in one ERC20 token, will be able to interact with another ERC20 based token as well, using the functions defined in the standard.

o ERC20 standard functions:

  • 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 with no check of the recipient address.
  • approve() and transferFrom() are two functions that does the the transfer using a two-step process.
    approve() is the first step: A token holder gives another address (usually of a smart contract) approval to transfer up to a certain number of tokens, known as an allowance. The token holder uses approve() to provide this information.
    The contract can use transferFrom() to for instance transfer the fee for some execution done by the user of the contract.
  • name() - Returns the name of the token
  • symbol() - Returns the symbol of the token. E.g. “HIX”.
  • decimals() - Returns the number of decimals the token uses - e.g. 8 , means to divide the token amount by 100000000 to get its user representation.
  • totalSupply() - Returns the total token supply.
  • balanceOf(address _owner) - Returns the account balance of another account with address _owner .`
  • allowance(address _owner, address _spender) - Returns the amount which _spender is still allowed to withdraw from _owner .
1 Like
  1. It allows for integration and interoperability to happen easily on the Etherum network. This allows for efficiency.
  2. “Total Supply” function which allows for the ability to check for the total supply of tokens in circulation. “balance Of” is used to get account balances of any given address. “transfer()” is used to send tokens between users. It also has the “doSomething”,“approve” and “transferFrom” functions. Those functions allow for tokens to be sent to do something and approval has been met for the tokens to be received.
1 Like
  1. The benefits of having a token standard like ERC20 is it allows the community to build on top of an already existing infrastructure which will excel innovation/adoption. With a unified standard, developers do not have to build a new token from scratch, but can use the standards already set up by erc20. This will lead to a much more streamlined and coherent ecosystem. Because all erc20 tokens have the same underlying infrastructure, any token that is ERC20 can be easily swapped with one another, easily added to exchanges, and building apps on top of it is simpler.
  2. a) balanceOf() - Checks the balance of tokens for an address
    b) transfer() - Transfers tokens from one address to another
    c) approve() - Lets one address to allow another address to transfer a variable amount of tokens that address. Also known as an allowance. This is typically used when a smart contract function requires a certain amount of tokens to execute. The address will “allow” the smart contract to take up to X amount of tokens to execute the function.
    d) transferFrom() - This function is related to the above©. Once a address has “allowed” another address to take a set amount of tokens to operate a function, this is the function that is called to actually transfer to the tokens.
    e)allowance() - This function sets a number which is the max amount of tokens an address can take from the address that calls it.
1 Like
  1. Benefits for setting a token standard like ERC20 are to provide a common set of features and interfaces for token contracts in Ethereum. Wallets with different ERC20 tokens are able to communicate with each other.

  2. Some ERC20 tokens functions are:
    A. totalSupply() : Allows an instance of the contract to calculate and return the total amount of the token that exists in circulation.
    B. balanceOf(): Allows a smart contract to store and return the balance of the provided address.
    C. approve(): The owner of the contract authorizes the given address to withdraw instances of the token from the owner’s address.
    D. transfer(): Lets the owner of the contract send a given amount of the token to another address.
    E. transferFrom(): Allows a smart contract to automate the transfer process and send a given amount of the token on behalf of the owner.

1 Like

functions of ERC20

  • balanceOf() - shows number (balance) of tokens
  • transfer() - sends (transfers) tokens from one address to another
  • approve() - gives permission to allow transfer of tokens
  • doSomething() - coded instructions
  • allowance() - sets the limit for transferred tokens
  • transferFrom() - a command for use of address to address token payment in a contract
2 Likes
  1. Uniformity standards with other projects,
    increase support from exchanges and wallets as well,
    interoperability and compatibility,
    and all of those I mentioned above will have a positive impact when it comes
    to innovation, adoption and efficiency to different projects that have set a token
    standard like the Ethereum ERC20 token standard.

  2. The functions that are in the ERC20 Token Standard are the following:

totalSupply - It is the function that will give you how much token are there in circulation.

balanceOf - is the function to check how many token is held by a particular address.

transfer - transfers a token directly from the sender to another address.

doSomething - to operate an instruction.

approve - is the function for approval to transfer up to a certain number of tokens, known as an allowance.

allowance - provides the number of tokens allowed to be transfer from one address to another.

transferFrom - is a function to be used after the approval function has been done, this transferFrom function will be the next step to transfer the number of tokens directly from an account to another address.

1 Like

1)the simplicity of how the wallets and exchanges operate with the token’s information , simplicity decreases resources needed for processing the information and improves speed
2) balanceOf transfer approve transferFrom allowance
doSomething() is the function’s name ?

1 Like

Homework on ERC20 token standard.

  • What are the benefits of setting a token standard like ERC20?
    The benefit are that all tokens based on the same standards will be able to communicate in a known and expected way.
    Also Efficiency. Having the same naming, parameters conventions, meaning we can build applications that can talk with each other.

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    An economic and efficient monetary system needs to function flawlessly and without friction as much as possible that can’t be achieved without common standard language between the comtracts (i.e programs).

    balanceOf() = number of tokens held by address
    transfer() = send token from user1 to user2.

    In order to send tokens to a local function in a contract we use 2 stage procedure:

    approve() = send token to the holder’s another address

    transferFrom() = send from adress to function.

    allowance() = numbers of tokens allowed to be transferred

1 Like
  1. Having a standard like ERC20 allows wallets and exchanges to be programmed to support any token using that standard. This is much simpler and scalable than each token having its own personalized code.
  2. Totalsupply gives number of tokens, balanceOf gives available token balance for an account, transfer allows someone to transfer their ERC20 tokens to another public address.
1 Like
  • What are the benefits of setting a token standard like ERC20?
    A token standard like ERC20 enables wallets and exchanges to function in the same and to communicate with each other. It increases efficiency and creates room for scalability.

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    Some of the functions include:
    balanceOf(address account) to show the balance of ERC20 tokens in an address.
    totalsupply() to show the sum off existing tokens.

1 Like
  1. It is important to have token ERC20 standard so that all tokens will be identical between themselves so that can be supported by changes and wallets. And also - the power is in the standards, we do not want to have frictions, we want t o build a stabile economy.
  2. The code of ERC20 standard has a lot of functions. Some of the functions are identical (the same naming and parameters conventions) in all tokens. Some of functions common for all tokens are- totalSupply (determine how many of tokens are in circulation), balanceOf (represent the unique address account), transfer (transfer some amount to some address)

1 Like
  • What are the benefits of setting a token standard like ERC20?
    The majority of wallets and exchanges have already adopted this standard. It allows tokens to be quickly usable throughout the crypto space.

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    balanceOf , totalSupply , transfer , transferFrom , approve , and allowance. The allow for the basics and self expalnatory, balanceOf = balance, totalSupply = the total amount of token in circulation etc.

1 Like

1.The benefit is that all tokens based on the same standards will be able to communicate in a known and expected way, meaning interoperability between the tokens is possible.

2.totalSupply() gives maximum number of tokens that 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

Homework on ERC20 token standard.

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

Answer: Compatibility in a word, including allowing wallets to provide token balances for hundreds of different tokens and creating a means for exchanges to list more tokens by providing nothing more than the address of the token’s contract

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

Answer: Functions: An example: The balanceOf() function provides the number of tokens held by a given address.

1 Like

1 What are the benefits of setting a token standard like ERC20?
It means that all tokens are coded in the same way ensuring compatibility with wallets, exchanges and protocols

2 What functions are in the ERC20 Token Standard Interface and what do they do?
TotalSupply() - calculates total supply in circulation
BalanceOf() - stores and returns the balance of an address
Approve() - checks and approves withdrawal of tokens from the owners address
Transfer() - send tokens to another user/account
TransferFrom() - automated transfer function
Allowance() - checks account balance and cancels transactions where the user has insufficient funds

1 Like
  1. By having a standard it makes it much easier for the industry to grow if everyone speaks the same language. And allows for everyone to easily create, coins, wallets, exchanges, and smart contracts.

  2. totalsupply give you the amount of all of the coins in circulation.

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

Basically, it makes everything more simple. Exchanges and wallets needed to build their platforms to accommodate for each one token’s code. With a universal standard, new tokens can be put on an exchange or transferred to a wallet automatically, once it’s been created.

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    totalSupply - Returns the amount of tokens in existence.
    balanceOf - Returns the amount of tokens owned by account
    transfer - Moves amount tokens from the caller’s account to recipient
    allowance - Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through {transferFrom}. This is zero by default.
    approve - Sets amount as the allowance of spender over the caller’s tokens.
    transferFrom - Moves amount tokens from sender to recipient using the allowance mechanism. Amount is then deducted from the caller’s allowance.
1 Like
  1. Having standards allows wallets, exchanges to add all ERC 20 tokens as they have common naming in their code.
  2. totalSupply - Returns the amount of tokens in existence.
    balanceOf - Returns the amount of tokens owned by account
    transfer - Moves amount tokens from the caller’s account to recipient
    allowance - Returns the remaining number of tokens that spender will be allowed to spend on behalf of owner through {transferFrom}. This is zero by default.
    approve - Sets amount as the allowance of spender over the caller’s tokens.
    transferFrom - Moves amount tokens from sender to recipient using the allowance mechanism. Amount is then deducted from the caller’s allowance.
1 Like

What are the benefits of setting a token standard like ERC20? This enforces other fungible Tokens that are built on top of the Ethereum network to communicate effectively with each other.

What functions are in the ERC20 Token Standard Interface and what do they do? totalsupply() this sets the limit in the number of tokens that will ever be supplied. balanceOf() provides the balance of an address.

1 Like
  1. Setting a token standard makes it easier for developers to integrate new tokens into their platforms and wallets.
  2. totalSupply() will return the total supply of specified token. balanceOf() will return the account balance of specified address.
1 Like