Homework: ERC20

  1. The benefits of setting token standards are that their very important for smart contracts, since they can allow wallets and exchanges to be programmed to support a token that someone wants to make, which they’ll have to use the same instructions, like ERC20.

  2. The functions that are in the ERC20 are totalSupply, which gives the maximum amount of tokens that exist, balance0f (I think O but, that’s what it looked like in the example), it gives balance to public adresses of ERC20 tokens and transfer, which allows someone to transfer their ERC20 to someone else.

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

There is a defined set of functions that all ERC20 tokens have to provide. This guarantees immediate compatibility with all wallets and exchanges that support the ERC20 standard.

  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • totalSupply() returns maximum number of tokens that exist
  • balanceOf(address account) returns an addresses’ balance of ERC20 tokens
  • transfer() allows a transaction of ERC20 tokens towards another public address
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Because if all tokens look the same/function in the same way all exchanges and all wallets will be
    able to support the tokens.
1 Like

ERC20

  1. What are the benefits of setting a token standard like ERC20?
    ERC20 is the token standard to build tokens on top of Ethereum. By having the standard set, everyone can build a cryptocurrency, that is compatible with all wallets and exchanges. There is also a starting token standard interface code for ERC20, which also can bring in different programmers who can all start with the main code and then create different functioning ERC20 cryptocurrencies. ERC20 tokens are also a fungible asset, so the value of each token is identical.

  2. What functions are in the ERC20 token Standard Interface and what do they do?
    In the ERC-20 token standard interface, there are 6 main functions and 3 optional functions. The 3 optional functions are:
    o function name () which returns the name of the token.
    o function symbol () which returns the symbol of the token.
    o function decimals () which returns the number of decimals the token uses.
    The 6 main functions are:
    o function totalSupply () which returns the total token supply.
    o function balanceOf () which provides the number of tokens held by a given address.
    o function transfer () transfers a number of tokens directly from the message sender to another address. It is also important to ensure the recipient of funds is a intended.
    o function transferFrom () allows one to communicate by making a ‘call’, which transfers tokens from one address to another. This function is typically used in smart contracts, allowing the contracts to transfer tokens on your behalf.
    o function approve () is a connected method with the function transferFrom () when interacting with smart contracts, approving the contracts to spend on your behalf.
    o function allowance () provides the number of tokens allowed to be transferred from a given address by another given address. The user is allowing the smart contract to take up to an allowed amount of tokens, from the address of the user. If the number of tokens does not match the number of tokens in the users allowed account, the contract will fail.

1 Like
  1. interoperability
  2. total supply and view balance

1 that is of great benefit because of efficiency on exchanges and wallets. It is way easier for them to implement the code compered to all tokens having their own specific code.
2 total supply…total amount of tokens in circulation.
BalanceOf…how many tokens are on the specific adres.
transfer …move tokens
allowance provides the number of tokens allowed to be transferred from an adres to another adres.

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

Setting a standard in developing a smart contract ensures widespread acceptance and usability in the Ethereum network as is the case in ERC20. With ERC20 we can all build applications that can communicate with each other.

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

A few examples of the functions found in ERC 20 RS follows along with what they do:

“totalsupply” = How many tokens in circulation.

“balanceOf (address account)” = Balance inquiry for a specific account.

“transfer (address recipient, uint256 amount)” = Transfer of funds for a recipient and amounts.

1 Like
  1. So they can write programs that can interact with each other because the functions within them are the same.
  2. totalSupply() gives maximum number of tokens that exist
    doSomething(): operates instructions.
1 Like
  1. What are the benefits of setting a token standard like ERC20?

Standards facilitate widespread use and integration across the platforms

  • Ease of use- customer’s ease of use increases because of cross platform integration, minimizing software requirements for wallets.
  • Security and optimization- Increased platform traffic begets more and frequent updates, patches and features.
  • Options- Hardware and software options for wallets increases since companies have a wider customer base for their wallets.
  • Quality- competition in a focused market, forces companies to produce quality products to survive.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • “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() allows the token holder to give another address approval to transfer funds.
  • The doSomething()’ - allows the contract to do it’s work once the funds have been verified.
  • “The allowance() function provides the number of tokens allowed to be transferred”
1 Like

Hello miss, did you forget to type your answer for the 2nd question?

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

If you have any more questions, please let us know so we can help you! :slight_smile:

Carlos Z.

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

But of course good sir! :slight_smile: The total supply function specifies the maximum of how much of the tokens can be in circulation and the view balance function shows how much of the tokens in the smart contract for an address there are.

1 Like
  1. Benefits are:
    •Simplified and eases developers,
    •Defines a common list of rules,
    •Exchanges and wallets needed to build their platform to accommodate for each one token code.
    •New tokens can be put on an exchange or transferred to a wallet automatically, once it’s been created.

  2. Functions are:
    Function total supply - returns the total circulating amount of tokens.
    Function balanceOf - address account, returns how many tokens exist in an account transfer. Will cancel the TX if there are insufficient token.
    Transfer - an amount of tokens from token owner’s account to another account.

1 Like
  • What are the benefits of setting a token standard like ERC20?
    Token standards are important so that integration and interoperation between tokens
    is possible. It allows wallets and exchanges to easily recognize tokens with the same standards.

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

balanceOf( ) - This function allows a smart contract to store and return the balance of the provided address.
totalSupply( ) - this function allows an instance of the contract to calculate and return the total amount of the token that exists in circulation.
transfer( ) - This function lets the owner of the contract send a given amount of the token to another address just like a conventional cryptocurrency transaction.
transferFrom( ) - This function allows a smart contract to automate the transfer process and send a given amount of the token on behalf of the owner.
approve( ) - 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.
allowance( ) - Returns the amount which _spender is still allowed to withdraw from _owner.

1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
  2. What functions are in the ERC20 Token Standard Interface and what do they do?

answers:

  1. Developers are able to easily build smart contracts and dapps since the syntax is standardized. Wallets can easily check balances of different types of tokens. Exchanges are able to list more tokens.

totalsupply defines an ERC20 token contract, mandatory parameter and is the sum of all balances.
balanceOf() number of tokens in an address
transfer() from sender to address, no checks on recipient, does not know if caller has paid
approve() and transferFrom() use two-step process

Holder address - allowance address - Allowance

allowance() provides number of tokens in tx, are soft, must consider the balance
ERC20 two events must be triggered, Transfer() and Approval()
Approval() emits details of approvals of tokens from one address to another.

Minting tokens emits a Transfer() event with the 0 address as the source.

1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
    A. having the same token standard allows interoperability, efficient interactions with the smart contract, deployment of wallets and creation of new tokens.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    A.
  • totalSupply() this number is the total supply of the token
  • balanceOf() gives a public addresses’ balance of ERC20 tokens
  • allowance() returns the amount which spender is still allowed to withdraw from owner
  • approve() allows spender to withdraw from your account, multiple times, up to the value amount.
1 Like
  1. The benefits of a token standard like ERC20 is that other tokens can be easily built on top of the smart contract platform which also makes it easier for wallets and exchanges to read and interact with.
  2. The ERC20 token standard interface comes with a number of functions which allow users to:
    A: balanceOf() function provides the number of tokens held by a given address.
    B: transfer() function transfers a number of tokens directly from the message sender to another address.
    C: approve() the token holder gives another address approval to transfer upto a certain number of tokens.
    D: transferFrom() can be used with approve() to create a two step process ie to approve a transfer of tokens.
    E: allowance() function provides the number of tokens allowed to be transferred by a given address to another given address.
    F: totalsupply() function is the total supply and equals the sum of all balances of the token
1 Like
  1. A set standard is extremely important for compability. All Ethereum wallets will understand any tokens theat follow the ERC20 standard as they are recognisable. All exchanges will be able to handle the tokens if they follow the standard.

  • totalSupply() [no arguments] return a fixed integer the number of tokens in circulation.

  • balanceOf(address _owner) return a float number representing the amount of tokens that are in “_owner” 's possession.

  • transfer(address _to, uint _value) returns a logic value (true/false) if the transfer is allowed. ??

  • transferFrom(address _from, address _to, uint _value) as above but like an automatic payment. ??

  • approve(address _spender, uint _value) The issuer of the SC allows someone to spend unit _value number of tokens. ??

  • allowance(address _owner, address _spender) Givers permission to _spender to transfer tokens from _owner. ??

  • several more functions are available. I assume some functions are mandatory and most are optional.

1 Like
  1. All tokens programmed according to the ERC-20 standard can easily be implemented in the Ethereum-Blockchain. The all have the identical functions to program smart contracts. So standards reduce friction and help to reach efficiency.

total Supply () the function returns the amount of tokens in the contract
balanceOf () returns the balance of the given address
transfer() the function transfers a number of tokens from the sender’s address to the receivers’s address
approve() a token holder gives another address the approval to transfer up to a certain number of tokens

1 Like
  1. allows for creation of new tokens which function in same way on solidity.
  2. balanceOf() Gives balance of a specific account, totalsupply the number total fungible tokens
1 Like