Homework: ERC20

  1. The ERC20 standard was shaped by the programming of Ethereum. Having a standard means that different tokens existing on the Ethereum network can all communicate frictionlessly with each other, and allows these tokens to be compatible with pre-existing wallets and exchanges. This unifying standard really propelled the success of the crypto ecosystem dramatically. Other standards include ERC721 and ERC1155. Both of these standards deal with non fungible tokens (NFTs).

  2. Examples of functions in the ERC20 Token Standard include:

  • totalSupply() - returning the supply of the network
  • balanceOf(address account) - self-explanatory
  • transfer() - used to send tokens from one address to another
  • approve() - a token holder allows another address to transfer (take) a certain amount of tokens from the token holder to the specified address
1 Like

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

Standards including many benefits, setting a token standard helps the exchange and wallets to interoperability because they share the same syntax. It also helps developers to read ongoing token codes…

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

Totalsupply() = how many token are in circulation.

balanceOf() = gives adress of the account you want to have the balance from, and you will got how much token that balance has.

Transfer() = allows someone transfer their ERC20 token to another adress.

1 Like
  1. Easy life :smiley: eg. Easy programing, transfer of value, automated payments, saving mining costs, zero maintenance, easy exchange listing, setting rules for close ecosystem.

  2. Best of function : - Dosomething !

  • totalSuply
    -balanceOf
    -transfer
    -transferFfom
    -approve
    -allowance

`

1 Like

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

By using coding standards, smart contracts can be developed using a set of common best-practices, and this in itself strengthens the development ecosystem around smart contracts and Ethereum itself. This is also a mark of maturity and gives non-crypto enterprises such as fiat financial entities a bit more comfort in adopting/interoperating in some manner with the crypto ecosystem. It also can lead to wallet designs that can support a wide range of coins because the smart contracts themselves are developed using a uniform standard, making it possible to have a single wallet that supports a range of coins.

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

totalSupply: returns amount of coins in existence
balanceOf: returns amount of coins owned by account
transfer: emitted when value tokens are moved from one account to another
transferFrom: moves amount tokens from sender to recipient using allowance mechanism; amount is then deducted from the caller’s allowance. Also, returns a boolean value indicating whether the operation succeeded.
approve: Sets amount as the allowance of spender over the caller’s tokens. Also returns a boolean value indicating whether the operation succeeded.

1 Like
  1. Consistency of standards allows for tokens and wallets to understand and execute same functions with same code across multiple Token’s and Smart Contracts.
  2. Total Supply is mentioned, the fact that ERC20 tokens are fungible
  1. it work whit the wallet and the exanges fram the strat

  2. balanceOf(): shows how many tokens the acount have

1 Like

Source: https://eips.ethereum.org/EIPS/eip-20 :smiley:

1.)
A standard interface allows any tokens on Ethereum to be re-used by other applications: from wallets to decentralized exchanges.

2.)

  • name
    Returns the name of the token - e.g. “MyToken”.
    OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.
    function name() public view returns (string)

  • symbol
    Returns the symbol of the token. E.g. “HIX”.
    OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.
    function symbol() public view returns (string)

  • 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.
    OPTIONAL - This method can be used to improve usability, but interfaces and other contracts MUST NOT expect these values to be present.
    function decimals() public view returns (uint8)

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

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

  • transfer
    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.
    Note Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event.
    function transfer(address _to, uint256 _value) public returns (bool success)

  • transferFrom
    Transfers _value amount of tokens from address _from to address _to, and MUST fire the Transfer event.
    The transferFrom method is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf. This can be used for example to allow a contract to transfer tokens on your behalf and/or to charge fees in sub-currencies. The function SHOULD throw unless the _from account has deliberately authorized the sender of the message via some mechanism.
    Note Transfers of 0 values MUST be treated as normal transfers and fire the Transfer event.
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)

  • approve
    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.
    NOTE: To prevent attack vectors like the one described here and discussed here, clients SHOULD make sure to create user interfaces in such a way that they set the allowance first to 0 before setting it to another value for the same spender. THOUGH The contract itself shouldn’t enforce it, to allow backwards compatibility with contracts deployed before
    function approve(address _spender, uint256 _value) public returns (bool success)

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

  • Events Transfer
    MUST trigger when tokens are transferred, including zero value transfers.
    A token contract which creates new tokens SHOULD trigger a Transfer event with the _from address set to 0x0 when tokens are created.
    event Transfer(address indexed _from, address indexed _to, uint256 _value)

  • Events Approval
    MUST trigger on any successful call to approve(address _spender, uint256 _value).
    event Approval(address indexed _owner, address indexed _spender, uint256 _value)

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

Using a token standard means that it is easy to integrate and interoperate with others on the network. It improves efficiency because there is no “friction” with users having their own way of doing things.

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

totalSuppply() - calculates the total amount of the token that exists in circulation

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

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

approve() - provides approval to transfer up to a certain number of tokens (allowance), it is used by the token holder to give another address the approval

transferFrom() - takes certain tokens from the sender’s account and carries on it’s work

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

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Having everyone using the same standard in their code ensures communication between programs/tokens can occur - essentially, everyone is speaking the same language

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    some examples of functions within the standard are…
    balanceOf() - returns the balance (number of tokens) held by an address
    transfer() - instruction to move tokens from A to B
    approve() - gives an explicit instruction to authorise a tranfer/action

1 Like
  1. Benefits of token standard is it defines how we all program the tokens and so these have common naming codes.
  2. Total supply () gives the max total tokens
    Balance of (address account) gives public address
    Transfer() allows for transfer of ERC20 tokens to another
    address
1 Like
  1. Token standards allow applications and exchanges to be completable with all tokens using a particular standard.
  2. balanceOf() Gives balance of a specific account, totalsupply the number total fungible tokens.
1 Like
  1. Setting a token standard allows the tokens to all understand each other. If we didn’t have it it would be like Spanish talking to English program and then we would need a translation intermediary.
  2. totalSupply - total supply in circulation
    balanceOf - returns balance of a wallet
    Approve - the owner approves the given address to withdraw
    Transfer - let’s owner of contract send a given amount too other address
    TransferFrom - automatically transfers without owner intervention

Token name
Token symbol
Number of decimals

1 Like
  1. By holding a standard, it allows wallets access to ERC 20 tokens, it make building more efficient, and it also unifies by reducing people from building with different functions.
  2. The balanceOf( ) function gives you the number of tokens held by a given address.
    The transfer( ) function transfers a number of tokens directly from the message sender to a different address.
    The totalSupply( ) function gives you the maximum number of existing tokens.
    The doSomething( ) function operates specific instructions.
    The allowance( ) function gives you the number of tokens that are allowed to be transferred between two specific addresses.
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

[quote=“filip, post:1, topic:8440”]

  • What are the benefits of setting a token standard like ERC20?
    that once you build a token, it can be all ERC-20 wallets can have it and and is easier for exchanges to list it …

  • What functions are in the ERC20 Token Standard Interface and what do they do?
    totalsupply, receive token, send token,getbalance,…

1 Like
  1. Setting a token standard like ERC20 allows all programmers to be on the same page when they create new tokens. It also allows all exchanges and wallets to support these new tokens.

  2. Some of the functions in the ERC20 token standard interface are:

  • 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.
  • The approve() function provides approval to transfer up to a certain number of tokens, known as an allowance, usually to a smart contract address.
  • the transferFrom() function then allows the smart contract to transfer a specific amount of tokens from the allowance.
  • The allowance() function provides the number of tokens allowed to be transferred from a given address by another given address.
1 Like
  1. The ability to have a communication with wallets and exchanges to easily adopt new tokens as they enter the crypto space.

  2. ERC20 programming standard has the ability for all developers to program fungible tokens, to be supported and adopted easily…

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

Setting a standard token allows projects to scale because when participants in the project follow a standard convention it reduces friction which generates efficiencies. Exchanges and wallets can talk to all ERC20 tokens in the same language. For developers, it reduces confusing and doubt when programming and probably also leads to better end user experience.

  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 a public addresses’ balance of ERC20 tokens
transfer() allows someone to transfer their ERC20 tokens to another public address

1 Like
  1. You have an existing framework for coding and do not have to invent it and have partners adopt it every time there is a new token.
  2. Total supply and balance
1 Like
  1. The benefit is that people can make and name their own tokens, and use them for different things.
    2, We have tokenSupply which shows the amount of tokens in circulation. And balanceOf which shows the balance of an address. These 2 functions are in all ERC20 programs.
1 Like