Homework: ERC20

  1. The benefits of the ERC20 token standard and token standards in general are, supportability amongst varying wallets and exchanges.

  2. totalSupply() returns the total supply of tokens; balanceOf() returns the balance of the given address; transfer() sends funds from msg.sender to a given recipient address;

1 Like
  1. The benefits of having a token standard like ERC20 are that all tokens that comply to the standard are easily accepted by wallets exchanges because of the common naming and function standards.
    2 Balance of : number of tokens at a given address
    transfer: transfers specified tokens to an address
    approve : allows a user to approve transfer of tokens to another address
    transfer from : allows a user to transfer tokens from an address to another address, used in conjuction with transfer from
1 Like

What are the benefits of setting a token standard like ERC20?
ERC20 = Standard way to program and deploy token on ethereum platform (Fungible)
The benefit of make token standard is we can develop in the same way and easily integrate with each other.

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

function name() public view returns (string)
This is an optional field, but many popular tokens include it so that popular wallets like Mist and MyEtherWallet are able to identify them.

function symbol() public view returns (string)
Another optional field used to identify a token, this is a three or four letter abbreviation of the token, just like BTC, ETH, AUG, or SJCX.

function decimals() public view returns (uint8)
An optional field used to determine to what decimal place the amount of the token will be calculated. The most common number of decimals to consider is 18.

function totalSupply() public view returns (uint256)
this function allows an instance of the contract to calculate and return the total amount of the token that exists in circulation.

function balanceOf(address _owner) public view returns (uint256 balance)
This function allows a smart contract to store and return the balance of the provided address. The function accepts an address as a parameter, so it should be known that the balance of any address is public.

function transfer(address _to, uint256 _value) public returns (bool success)
This function lets the owner of the contract send a given amount of the token to another address.

function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
This function allows a smart contract to automate the transfer process and send a given amount of the token on behalf of the owner.

function approve(address _spender, uint256 _value) public returns (bool success)
When calling this function, the owner of the contract authorizes, or approves, the given address to withdraw instances of the token from the owner’s address.

function allowance(address _owner, address _spender) public view returns (uint256 remaining)
The allowance() function provides the number of tokens allowed to be transferred from a given address by another given address.

refer: https://github.com/ethereum/ethereum-org-website/blob/dev/src/content/developers/docs/standards/tokens/erc-20/index.md

https://medium.com/blockchannel/the-anatomy-of-erc20-c9e5c5ff1d02

1 Like

1- It’s about conventions and talking the same language, wallets and exchanges can support any token uses the standard with no difference, also for interoperability.
2- totalSupply() gives the total of fungible tokens, balanceOf(address) returns the balance of the address,
transfer() send funds from sender to recipient

1 Like
  1. Having a standard like ERC20 allows wallets and exchanges to be programmed so it can support a token that uses that standard. This is much simpler than having each token having its own code. This brings consistency to the network, therefore, increasing efficiency.
  2. totalSupply() gives the maximum number of tokens that exist in a particular wallet.
    balanceOf(address account) gives the public address of the ERC20 Token
    transfer() allows a wallet to transfer ERC 20 tokens to a public address.
1 Like
  1. What are the benefits of setting a token standard like ERC20?

It’s a standard way in which we can program and deploy. It makes it so we can create smart contracts not just for money, but tokens, new currencies, new economies, new models, etc.

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

totalSupply (each ERC token will have a TOTAL SUPPLY because it’s a standard. You cannot name this function anything else. It gives you how many are in circulation.)

balanceOf (You give the address you want the balance of- meaning if exchanges want to check how much of a balance you have, they will use this. Also wallets will use the balanceOf. If you’re doing your own project and you want to use the balance of an address you have to use the balanceOf function.)

transfer (When tokens are transferred from one account to another, the token contract transfers a number of tokens directly from the message sender to another address and updates the balance of the two accounts.)

approve (Allows the above scenario to work using a two-step process. In 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.)

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

We have the same naming conventions and parameter standards. Without doing it this way, everyone would be building different versions, it wouldn’t be efficient, we wouldn’t be able to integrate and work together.

1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
    ERC20 standards allows to build applications that can talk to each other, makes it efficient for wallets and exchanges to able to support this tokens.

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

  • function totalSupply()
    Returns the amount of tokens in existence.

  • function balanceOf(address account)
    Returns the amount of tokens owned by an address ( account ).

  • function allowance(address owner, address spender)
    The ERC-20 standard allows an address to give an allowance to another address to be able to retrieve tokens from it. This getter returns the remaining number of tokens that the spender will be allowed to spend on behalf of owner .

  • function transfer(address recipient, uint256 amount)
    Moves the amount of tokens from the function caller address ( msg.sender ) to the recipient address. This function emits the Transfer event defined later. It returns true if the transfer was possible.

  • function approve(address spender, uint256 amount)
    Set the amount of allowance the spender is allowed to transfer from the function caller ( msg.sender ) balance. This function emits the Approval event. The function returns whether the allowance was successfully set.

  • function transferFrom(address sender, address recipient, uint256 amount)
    Moves the amount of tokens from sender to recipient using the allowance mechanism. amount is then deducted from the caller’s allowance. This function emits the Transfer event

  • event Transfer(address indexed from, address indexed to, uint256 value); This event is emitted when the amount of tokens (value) is sent from the from address to the to address.

1 Like
  1. Adoption of tokens by wallets, exchanges, and users because of standard coding commands.

  2. ERC20 Token Standard Interface functions:
    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. To make the token compatible on exchanges, and able to talk to each other.

balanceOf = Get the balance of specific address.
totalSupply = Total Supply of the token
transfer = transfer the token to address/addresses
transferFrom = transfer from address to another address
approve = approve (e.g, spending)
allowance = remaining token available for transfer/spending.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • to make the economy more efficient - enables easy communication between wallets, exchanges, etc.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • balanceOf : get the balance of an address
  • totalsupply : get the total supply of a coin/ token
1 Like
  1. When a standard is set, it allows a quicker adoption and a faster interaction of wallets/exchanges with new tokens, as no additional integration is necessary.
  2. totalSupply() - returns the total supply of tokens
    balanceOf(address) - returns the balance of the selected address
    /…/ as well as /…/
    transfer() - permission to send,
    transferFrom() - permission to send funds automatically,
    approve() - authorisation,
    allowance() - granting permission to spend tokens on your behalf.
1 Like

all tokens are working on the certain rules and standards,and they are all fungible,they can be stored in one walllet also…

  1. transfer of tokens from wallet to another,giving info on full supply of the token,giving info on total token balance of the account
1 Like
  1. It allows the developing community to be able to speak the same language, which will result in many apps being developed. It also allows for interoperability, e.g. wallets, exchanges, etc can handle all ERC 20 tokens.

  2. totalsupply gives the number of total fungible tokens; balanceOf() gives the balance/number of tokens of a specific account/address

1 Like

Creates a common language for all users.

function totalSupply() = Get the total token supply
function balanceOf() = Get the account balance of account address

function transfer() =
function approve() =
function transferFrom() =

  1. What are the benefits of setting a token standard like ERC20?
  • It allows all wallets and exchanges to support the tokens from day 1 and creates a standard way to program and deploy the tokens.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • totalsupply: returns the total supply of tokens in circulation
  • balanceof: returns the balance of the address specified
  • transfer, allowance, approve, transferfrom, increaseallowance, decreaseallowance, mint, and many more
1 Like
  1. What are the benefits of setting a token standard like ERC20?

A standard would allow efficient processes for all parties interacting with ERC20.

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

balanceOf() : returns the number of tokens held by the given address
transfer(): transferring tokens from one address to another
allowance(): returns the number of tokens allowed to be transferred from a given address by another given address

1 Like
  1. It makes it easy to support other tokens with the same standard.

  2. There are functions like:
    totalSupply() which gives total number of tokens in circulation
    balanceOf(address account) which shows the balance of tokens in a particular public address
    transfer() which allows you to transfer tokens to other public addresses.

1 Like

Did you forgot to post your answers here ? :nerd_face:

Carlos Z

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

The token will be more effective for it is able to communicate with all wallets and other tokens because it all runs off of the same standard.

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

You have a function such as totalsupply() that all ERC20 tokens have that will tell you how many tokens are in supply.

1 Like
  1. It makes it easy to interface with each other and it makes it easy for wallets and exchanges to add the tokens because they all have the same codes.

  2. 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, not used in paying for functions within the smart contract. To pay for these functions we have to use approve() to allow SC use tokens defined as “allowance” and when any function is called SC is using transferFrom() to take tokens from allowance as a payment.
    The allowance() is providing info about how many tokens are in the allowance.

1 Like