Homework: ERC20

Erc20 standard for tokens allows inter operability & efficiency in interacting with smart contracts making wallets and making tokens easier

totalSupply ()gives how many tokens in circulation
balanceOf(address)provides the number of tokens held at given address
transfer()transfer tokens from the message sender to another address
approve()gives another address approval to transfer up to a certain number of tokens
transferFrom()transfer token from a given address that previously been given approval for that

1 Like
  1. To not reinvent the wheel again and again.

approve(): a token holder gives another address approval to transfer up to a certain number of tokens(allowance).
transferFrom(): take certain tokes from sender’s account and carry on its work.
allowance(): provides the number of tokens allowed to be transferred from a given address by another given address.

1 Like
  1. wallets and applications can call the standard functions to handle the transactions, which makes the development and maintenance more efficiently with lower cost

  2. totalSupply() -> return the total number of tokens for the smart contract
    balanceOf() -> return the number of tokens possessed by the given address
    transfer() -> transfer a number of tokens from the message sender to another address

1 Like
  1. Everyone has to follow the standards of erc20 and it doesn’t get mixed up
  2. Total Supply, Balance of.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    token standards like ERC20 allows wallets and exchanges to be programmed to support any token using that standard. by following a standard, it will allow the applications to communicated smoothly and efficiently.

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

name() : returns the name of the token

symbol() : returns the symbol of the token

BalanceOf() : returns the total number of tokens an address holds
transfer(): transfers _value amount of token to address _to and must fire the transfer event. the function should throw an error if the message callers balance does not have enough tokens to spend.

approve(): allows _spender to withdraw from your account multiple times, up to the _value amount. if the function is called again it overwrites the current allowance with _value.

totalSupply(): returns the total token supply

transferFrom(): transfers _value amount of tokens from address _from to address _to, and MUST fire the transfer event. transferFrom allows contracts to transfer tokens on your behalf. for example i want to let a contract transfer tokens on my behalf and/or to charge fees in sub-currencies. should throw an error unless the _from account deliberately authorized the sender of the message via some mechanism.

1 Like

Homework on ERC20 token standard.

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

Setting a token standard like ERC20 allows all tokens created to automatically work without issues with any wallet or exchange.

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

There are various functions in the ERC20 Token Standard Interface such as:

  • function totalsupply () - This sets the total supply of Tokens available.
  • function balanceOf (address account) - Will tell you how many Tokens that particular address has.
  • function transfer (address recipient, uint256 amount) - Transfer an amount of Tokens to a particular address.
1 Like
  • What are the benefits of setting a token standard like ERC20?
    With a token standard like ER C20 the process of building smart contracts and minting new tokens is much easier and guarantees that all tokens that are created on ethereum with that standard will function the same way with exchanges and wallets and other third parties, reducing friction and simplifying the project the process
  • What functions are in the ERC20 Token Standard Interface and what do they do?
    totalsupply() show the sum of tokens in all accounts of the token contract
    balanceOf() shows the sum of tokens in a specific account in the tokens’ smart contract
    transfer() will transfer tokens from one account to another
    Allowance() is used to allow 1 account to pay another account for a specific service or in return for X
    transferFrom() will transfer tokens from a specific account
    approve() is used in a pay for something situation where is there one account wants to make sure that there is tokens for something and then have that executed afterwhich tokens will be transferred as payment
1 Like

1 Standards make it some that wallet and exchanges for example, can add them easily.
2 totalSupply() Maximum supply
balanceOf() Token balance of public address
transfer() Transfers an amount to a specified address from the owner of the contract.
transferForm() takes 3 inputs- sender address, receiver address and the number of token to be transferred…It give a success or failure output.
allowance() Shows how many tokens can be transferred.
doSomething() To operate instructions.
approve() GIve an address approval to transfer a certain number of tokens.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • it makes the network understand each other.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • totalsupply for example shows the entire supply of the token. balance0f shows the balance of a wallet.
1 Like

What are the benefits of setting a token standard like ERC20? – Setting up standards to ease the deployment and adoption, different projects can quickly get onboarded as well new projects can faster be deployed, exchanges and wallets can add ERC20 tokens in easier and faster way due to standardization of the code.

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

  • Total supply = a number of tokens
  • balance of = token balance for an account
  • transfer = can be used to send tokens to other accounts
  • approve: a token holder allows another address approval to transfer tokens
1 Like
  1. ERC20 is a standard used to develop fungible tokens (currencies). It is a system that everyone develops and understands in that same way.
  2. balanceOf() is a function of total balance; transfer() function transfers tokens; doSomething() function requires to do something with tokens; approve() function approves; transferFrom() function transfers a certain amount of tokens; allowance() function provides the amount of tokens that can be transferred.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    It makes it easier to use smart contracts that interact with them and build applications on top of them more easily with the same standard. It also makes it easier for wallets and exchanges to interact with the same standard. It creates a standard protocol all applications can more easily interact with as it would be a lot more difficult if there were various different protocols.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    function totalSupply() - shows the total supply of a particular token

function balanceOf() - shows the balance of a particular account

1 Like

1.) The benefits of setting a token standard like ERC-20 is that it makes the coding community able to communicate with a lot more ease, and everyone can integrate on the same network with no friction.
2.) The functions in the ERC-20 token standard interface include:
FunctionTotalSupply: total number of tokens in circulation
FunctionBalanceOf: account’s address being transacted
FunctionAllowance: the number of tokens that are able to be transferred in a transaction
doSomething: the specific instructions of a smart contract
Approve: official authorization to transfer tokens from two addresses that are performing the transaction

1 Like

1.makes it easier to launch coins and easier for wallets and exchanges to interact with
2.total supply, balance, transfer, show total supply of a coin or balance of a account or transfer coins to another account

1 Like
  1. It’s important to have the same naming convention. In this way all fungible tokens and wallets will be able to communicate easily in expected and set way.
  2. totalSupply - gives number of supply.
    balanceOf - gets how much balance an account/.address have.
    transfer - allows transfer to another address.
1 Like
  1. You can launch your token on a well established blockchain network. You can use a widely used and accepted standard that already has a lot of integrated applications.
  2. the functions:
  • balanceOf() get number of tokens in a particular wallet address
  • transfer() send tokens from one wallet to another
  • approve() a wallet gives permission to a smart contract to transfer tokens
  • transferFrom() the smart contract transfers the allowed amount out of the wallet to itself as payment for actions
  • doSomething() a generic function to execute an action and call the transferFrom() function to take out payment from the wallet (if this fails the function will fail)
  • allowance() returns the number of tokens allowed to be transferred from one address to another, allowance can exceed balance
1 Like
  1. with a set standard you can ensure that all smart contracts containing ERC communicate properly with each other.
  2. allow the wallet to conduct balance checks and transfers.
1 Like
  1. What are the benefits of setting a token standard like ERC20? It allows for everyone to build off of the same standard set of rules, which in turn, allow for faster growth and execution of the network overall.

  2. What functions are in the ERC20 Token Standard Interface and what do they do? balance of and total supply functions. TS shows all of the available tokens in circulation and balance of serves the purpose of verifying funds in a particular wallet before interacting with the contract.

1 Like

1- wallets and applications can call the standard functions to handle the transactions, which makes the development and maintenance more efficiently with lower cost.

2- Total Supply: return the total number of tokens for the smart contract
Balance: return the number of tokens possessed by the given address
Transfer: transfer a number of tokens from the message sender to another address

1 Like

Homework on ERC20 token standard.

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

Having a ERC20 token standard allows for exchanges and wallets to program in order to support/accept any token using that standard. This standard allows the crypto space to become more scalable and simple, instead of each token having its own custom token, which would make it harder to communicate.

  1. What functions are in the ERC20 Token Standard Interface and what do they do?
    Function total supply () - shows total supply of token.
    Function balanceOf () - shows balance of a certain address.
    function transfer() allows someone to transfer their ERC20 tokens to another public address.

There is more standard function code in an ERC-20 smart contract, these 3 are just an example.

1 Like