Homework: ERC20

  1. It’s important to standardize tokens (like ERC20) in order to facilitate interoperability between wallets and smart contracts. Supporting a single standard for one token type accelerates adoption because, otherwise, each programmer would code functions using different naming conventions and developers would need to spend a lot of time and resources adding individual support for each smart contract.

  2. A few basic functions in ERC20 tokens include:

totalSupply () - specifies how many tokens can be in circulation
balanceOf () - reveals how many tokens belong to a specific address
transfer () - sends tokens from one address to another (can also be useful for burning tokens, by sending them to the 0 address; also useful for minting new tokens from the 0 address as the source)
allowance () - provides the number of tokens allowed to be transferred from a given address by another address (I read “Understanding ERC-20 token contracts” but am not 100% clear on the purpose of this function or how it works - can someone provide an easy-to-follow example of when this function would be needed?)

2 Likes
  1. Interoperability
  2. Supply, balanceOf, allowance, transfer, approve, transfer from
  1. setting a token standard makes the whole network run more efficiently by having a language that allows applications and wallets to “talk” to each other.

  2. Some functions in the ERC20 standard interface are:

balanceOf( ) - this allows you to view the balance of an address

transfer( ) - this allows you to transfer from one address to another

totalsupply ( ) - allows you to view total supply of tokens of someone

1 Like
  1. Setting a standard for ERC20 contracts makes all ETH tokens to be able to communicate.
    2)Functions in ERC20 are max coins and available coins and balances.
  1. Standards allow for far greater compatibility between tokens

  2. Total supply is the amount of tokens in circulation, issue/burn tokens either issue or burn tokens, balance inquiry check account balance, manage token ownership

1 Like
  1. This allows us to build applications that can easily and efficiently talk to each other.
  2. TotalSupply: This tracks the total supply of tokens in circulation. balanceOf: Gives account balances. Wallets use this function.
1 Like
  1. The benefits of setting a token standard is to move forward programming for building applications that can easily rely on their knowledge to communicate with other applications within the dixit standard. Allowing all new projects to speak and label the same things the same way as everyone knows in that standard.
  2. The functions in the ERC20 token standard are amongst those following :
  • function totalSupply() public constant returns (uint); is defining total token supply
  • function balanceOf(address tokenOwner) public constant returns (uint balance);is returning balance on token Owner address
  • function allowance(address tokenOwner, address spender) public constant returns (uint remaining); Owner Is allowing Spender address
  • function transfer(address to, uint tokens) public returns (bool success); is transferring to address
  • function approve(address spender, uint tokens) public returns (bool success); is approving spender to withdraw
  • function transferFrom(address from, address to, uint tokens) public returns (bool success); is allowing transfers
  • event Transfer(address indexed from, address indexed to, uint tokens); is testing event
  • event Approval(address indexed tokenOwner, address indexed spender, uint tokens); is testing spender ownership
2 Likes

It is easy to have support form day 1.
building is easy to learn as the set of code naming are standardized.

Totalsupply() - total Max supply that could exist.
Balanceof(address account)- the balance of the erc20 token in the given address
Transfer()- transfer of erc20 tokens to another address

1 Like
  • What are the benefits of setting a token standard like ERC20?
    So that all methods for getting balance, finding max supply and others are the same for every token

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

  • total supply - pulls total supply of the token

  • balanceOf(account) - finds the current balance of an account

  • transfer - move tokens in a transaction

  • approve - contract owner approves token withdrawal

  • allowance - provides number of tokens allowed to be moved to and from addresses for a transaction

1 Like
  1. The benefits are that there is a standard of how we program and deploy smart contracts. And that allows multiple tokens to be identical and be accepted by all exchanges and wallets from the first day.

  2. For example balanceOf() function shows the number of tokens hold by an address.
    The transfer() function transfers tokens from one address to another.
    Also there are functions like approve() gives an approval to transfer tokens, transferFrom() will take the tokens from the senders account if there is enough tokens. The allowance() function gives a number of tokens allowed to be transferred.

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

This helps with interoperability. In the case with ERC20 Token Standard you can, for example have different tokens working with the same wallet or exhanges without the need to constantly change and update the system in order to accommodate.

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

balanceOf() - Shows the number of tokens held in an ETH address

transfer() - transfers tokens from one address to another

transferFrom() - takes tokens for operations on smart contracts

approval() - how much tokens the user authorises an address to use

allowance() - the amount of tokens an address is allowed to own

1 Like
  1. It makes it easier to understand the programs other people wrote and especially for wallets to interact with newly deployed tokens. If the wallet understands the erc20 standard it can store all kinds of tokens. If they all used different code.
  2. totalSupply() shows how much tokens there are/will be. transfer() allows you to send tokens to someones public address. BalanceOf() shows the balance of a specific wallet
1 Like
  1. So that there’s no difference in structure of the smart contracts and the way they function to be accepted through Ethereum platform.
  2. totalSupply - existing number of tokens
    balanceOf address account - tokens available in the account
    transfer function - for transferring tokens between accounts
1 Like

1. What are the benefits of setting a token standard like ERC20?
Having standards such as ERC20 allows tokens to immediately be understood and supported by wallets and exchanges from day 1. This standard also means that implementation and execution become easy for developers which leads to greater adoption and ease of access.

2. What functions are in the ERC20 Token Standard Interface and what do they do?
i. balance(of) enables the SC to fetch and store the balance of an address. Since anyone can access the blockchain and fetch this balance, account balances are public.
ii. transfer() transfers tokens from one address to another address.
iii. totalSupply() calculates the total amount of the coin that exists in circulation.
iv. approve() is used for the SC owner to authorize a given address to withdraw tokens from the owners account.
v. transferFrom() automates the SC transfer process
vi. allowance() specifies which address is given what amount of tokens to be used

1 Like
  1. It’s good for efficiency. Having the same conventions (naming, parameters etc.) makes it easier for exchanges and wallets to communicate.

  2. Funtions in the ERC20 Token:
    ● totalSuply()
    ● balanceOf( address tokenOwner)
    ● allowance(address tokenOwner, address spender)
    ● transfer(address to, uint tokens)
    ● approve(address spender, uint tokens)
    ● transferFrom(address from, address to, uint tokens)

1 Like
  1. using standards allow for 3rd parties to easily integrate your token to the ecosystem. For example exchanges and other dapps

  2. totalsupply : Returns the total circulating amount of tokens .
    balanceOf : Returns how many tokens exist in an account.
    transfer : Transfer an amount of tokens from token owner’s account to another account.
    just a few

1 Like
  1. What are the benefits of setting a token standard like ERC20?**
    Having a standard like ERC20 allows wallets and exchanges to be programmed to use any token using that standard
  2. What functions are in the ERC20 Token Standard Interface and what do they do?**
    totalSupply() max number of tokens that exist
    balanceOf(address account) gives a public addresses’ balance in ERC20 tokens
    transfer() allows someone to transfer their ERC20 tokens to another address
1 Like
  1. that all use the same code even with different tokens. 2. Totalsupply ,balanceOf, transport.

1 The main benefit is the possibility to support (across all wallets and exchanges) any token that has been created using that standard.

2 some examples:

totalSupply > give the total supply of that token
transfer > transfers an amount to a specified address
transferFrom > transfers from an address to another one a N number of tokens
approve > allows to withdraw tokens from the owners address

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    The standard creates a situation where all developers can easily use and interchange tokens, wallets and programs using the same set of rules.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    balanceOf() gives balance of particular account
    transfer() allows the transfer of tokens to another address
    totalsupply() returns the total supply of that token
    doSomething() the instructions for the program to complete
    approve() where token holder allows the transfer of there tokens

1 Like