Homework: ERC20

  1. Benefits of setting a token standard-a common set of features and interfaces for token contracts that allows wallets to provide balances to hundreds of coins
  2. What are the functions?
    balanceOf ()-Number of tokens held by an address
    totalsupply ()-total supply of coins
    approve ()-token holder gives approval to transfer tokens which is known as an allowance to another address
    allowance ()-provides the number of tokens allowed to be transferred from a given address by another given address
    transferFrom() Takes in the address of the sender, the receiver and the number of tokens to be transferred and lets you know if the transfer was successful
    transfer() takes the address of the receiver and the funds which are to be sent to an account/address
1 Like

1- It can be supported by every exchanges and every wallet. This supporting keeps the friction low in the network. The standard code is approved, so it is best to use it in order to provide maximum security in our smart contract.

2-

totalSupply -> how many tokens are in circulation
balanceOf -> shows the balance of the specific address given
transfer -> sends token from one account to another one

1 Like

1.The benefits of setting a token standard like ERC20 is that once created they are supported by exchanges and wallets from day one.
2. ERC20 contains several functions that a compliant token must be able to implement. Source: Ethereum.org “ERC 20 Token Standard”
TotalSupply: provides information about the total token supply
BalanceOf: provides account balance of the owner’s account
Transfer: executes transfers of a specified number of tokens to a specified address
TransferFrom: executes transfers of a specified number of tokens from a specified address
Approve: allow a spender to withdraw a set number of tokens from a specified account
Allowance: returns a set number of tokens from a spender to the owner

1 Like
  1. Each wallet can talk to the tokens/smart contracts the same standardized way.
  • totalSupply() - returns the total supply of that token
  • balanceOf(address addr) - returns the token balance of the given argument
  • transfer(address recipient, uint256 amount) - transfers the specified amount of tokens to the recipient’s address
1 Like
  1. efficiency, easily add new tokens
    2.balanceof(), totalSupply(), transfer()

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

  • Having a token standard like ERC20 allows developers to program tokens in the same language or codes that allows efficiency and interoperability making the exchange of tokens easier.

What functions are in the ERC20 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

approve()

  • provide information

allowance()

  • provides the number of tokens allowed to be transferred from a given address by another given address
1 Like

creates standard and conventions which helps efficiency by creating less friction for the community as they can communicate better with each other.

Total supply-the number of tokens is supplie
balance of- balance of address
allowance- how many tokens are available
transfer-transfer from one address too another
approve- approve a transfer
do something- an operation to do something

1 Like
  1. Token standards allows to have and call common operations in the same way (with the same name and logic).
  2. totalSupply() - provides data about total supply of the tokens in the token contract
    balanceOf() - provides information about balance of specific address in token contract
    transfer() - allows to transfer tokens (but cannot be used with smart contracts which does not know how many tokens can be spend by specific address)
    approve() - provides an allowance to spend token holder’s tokens by e.g. smart contract
    transferFrom() - allows to spend tokens via function of smart contract or different address which is allowed to spend by approve() function
    allowance() - provides the number of tokens allowed to spend via approved address
1 Like

1- We can build applications that talk each other because they are using the same naming and parameter conventions.

2- Total supply is telling how many tokens are in circulation. BalanceOf is stating how much tokens a balance has.

1 Like
  1. It enables interoperability of all coins adhering to that standard
    2a. totalsupply() - returns the sum of all tokens in the accounts
    2b. balanceOf(account) - returns the balance of the specified account
    2c. transfer() - transfers money from one account to another
    2d. approved() - authorizes that another address to transfer an amount of coins called an allowance
    2e. doSomething() - is an interface function that the smart contract programmer codes to do some work like transfer some tokens
    2f. allow() -returns the allowance granted to an account
1 Like
  1. The benefit of having a token standard is that it can interact with several other facets of the web. Applications can inter-operate and it makes it simple to audit and manage the contracts of different tokens. The best benefit of a token standard can be seen with the ERC20 standard, where all wallets and exchanges can easily interact with an ERC20 token. This is a big reason why the Ethereum network has become so large.

  2. The ERC20 Token Standard has a vast range of functions. Whether that be mathematical (such as addition, multiply, divide etc.). On a contract level, you can set functions such as totalSupply() to retrieve the total supply of a token, or balanceOf(address account) to fetch the balance of a wallet.

2 Likes
  1. same standards can make the network grow faster since all wallets can easily communicate with each other
  2. totalSupply(): total amount of the token
    balanceOf(address): balance of ERC20 tokens
    doSomething(): operates instructions
    transfer() function: transaction from one account to another
2 Likes
  1. It defines a common list of rules that all Ethereum tokens must adhere to, referring to transfers, transaction approvement, data access, and total supply. This helps predict functionality within the larger Ehereum ecosystem.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    These functions ensure that Ethereum tokens of different types perform uniformly in any place of the Ehereum system. Functions names are selfexplanatory:
    interface ERC20 {
    totalSupply();
    balanceOf(address tokenOwner);
    transfer(address to, uint tokens) ;
    approve(address spender, uint tokens) ;
    allowance(address tokenOwner, address spender);
    transferFrom(address from, address to, uint tokens) ;
    }

1 Like
  1. An ERC20 standard allows for inoperability between projects. this creates a much more efficient and prosperous ecosytem.
  2. Example of ERC20 Standard Functions: total supply = total coins in circulation
    : balanceOf = balance of specified address
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    A: As all tokens will be built using the same standard, it will provide seamless integration with the Ethereum blockchain and enable all applications and devices to communicate with one another.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    A:
    • totalSupply: obtains the number of tokens currently in circulation on the Ethereum network
    • balanceOf: retrieves and records the balance of a particular address
    • transfer: enables the Smart Contract owner to sends tokens of stated value amount to specified address
    • transferFrom: automated transfer of tokens of stated value from address specified to address specified
    • approve: the Smart Contract issuer authorizes an address to withdraw funds from their address
    • allowance: retrieves the available balance of funds which an address is allowed to withdraw from the owner of the Smart Contract
1 Like

Setting at token standard allows all wallets, exchanges, etc to be “speaking the same language”, which reduces a ton of friction within the system.

A few functions of the ERC20 standard include:
balanceOf(account address) provides the number of tokens within the inputted account address.
transfer() allows tokens to be sent from one user to another.
allowance() allows a token holder to transfer an “allowance” of tokens from a given address by another given/inputted address.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • standards allow communication with existing infrastructure such as exchanges or wallets
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • TotalSupply: provides information about the total token supply.
  • BalanceOf: provides account balance of the owner’s account.
  • Transfer: executes transfers of a specified number of tokens to a specified address.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Using a standard like ERC20 allows exchanges and wallets to support any token.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
  • balanceOf() -> shows the balance of a specific address
  • transfer() -> transfer tokens from the sender address to another address
  • allowance() -> shows how many tokens are allowed to be transferred
  • doSomething() -> instruction
  • approve() -> part of a 2step transfer: authorises to transfer an amount of tokes to another address
2 Likes

1/Everybody uses same functions, same applications…The code is lade same way

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

2 Likes
  1. Wallets and exchanges don’t have to “try” to understand a million ways people write code, rather setting a standard informs all users, wallets, exchanges that they should adapt and understand this style.
  2. balanceOf() Gives balance of a specific account,
    totalsupply the number total fungible tokens.
1 Like