Homework: ERC20

1)What are the benefits of setting a token standard like ERC20?
All space of tokens can communicate with each other.

2)What functions are in the ERC20 Token Standard Interface and what do they do?
balanceOf() function provides the number of tokens held by a given address
transfer() function sends tokens from one address to another.
allowance() function provides the number of tokens allowed to be transferred from a given address by another given address.

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

Having the ERC token allows wallets and exchanges to be programmed to support amy token using that standard. This is much simpler and easier than each token having its personalized code

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

BALANCE OFF(): this will provide the number of tokens given off by a certain address.

Transfer() Transfers a number of tokens directly from the message sender to another address. But it doesnt work well when tokens are being used to pay for a function in a smart contract.

Approve () a token holders gives another address approval to transfer up to a certain amount of tokens(allowance).

Transfer from this takes certain tokens from the senders account to carry out its work.

doSomething () To operate instructions

Allowance
this provides the amount allowed to be tranffered from one address to another.

1 Like

Hi guys if I worded wrong or missed anything. Any feedback would be appreciated.

  1. Allows to have standards when creating a smart contract. Results in pure efficiency & integration.
    Its a fungible token.
    Allows wallets to provide token balances for hundreds of different tokens.

  2. To name some there Balanceof() provides the # of tokens held by a given address. Exchanges balances inquiry for example.
    Transfer() transfer a # of tokens directly from the address sender to another address.
    Total Supply() They indicated how many tokens are in circulation.

1 Like
  1. Being standardized means it a lot easier for the entire ecosystem to behave the same way and in turn increase efficiency and safety.
  2. Total supply, name, symbol, decimals, balance of, transfer, transfer from, approve, allowance, increase allowance, decrease allowance. Those functions are to make sure the token behave in the same way.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • Setting a standard (for anything by the way) usually leads to more efficient interoperability.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
1 Like
  1. What are the benefits of setting a token standard like ERC20?

The importance of standards can’t be overstated, it’s what makes the system possible and efficient. Everyone’s speaking the same language. It allows seamless communication and interoperability between ERC tokens.

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

totalSupply () - tells you how many tokens are in circulation.

balanceOf (address account) - gives you the amount of tokens are currently in the specified address account.

1 Like

1 standards make building a token easier because their is only one language for all
2 total supply and balance of the token

  1. So everyone is working within the same framework, using similar commands. Everyone can read each others code and understand it

  2. balanceOf(address account), this is a way of getting a balance of someone’s etherium address
    totalSupply() gives all the tokens in circulation

1 Like
  1. Having standards allows wallets, exchanges etc to easily add all ERC 20 tokens as they have common naming in their code.
  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
1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?-Allow wallets to provide token balances for hundreds of different tokens and creating a means for exchanges to list more tokens by providing nothing more than the address of the token’s contract.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?- The functions are:

The balanceOf()

The transfer()

approve()

transferFrom()

The allowance()

  1. What are the benefits of setting a token standard like ERC20?
    It sets a universal standard within the ETH network at helps to communicate with each other for different procedures done within the network.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Provides total supply and balance of the requested account. The former provides total number of tokens that exist while the latter provides public balance of ERC20 tokens of an account.

1 Like
  • What are the benefits of setting a token standard like ERC20? - So every other token created on the Ethereum network is supported by the same network, accepted by the same wallet, etc.
  • What functions are in the ERC20 Token Standard Interface and what do they do? - Two functions that I already know are totalsupply and balanceof, they provide a total supply of tokens in circulation and the remaining balance of tokens on the particular address respectively.
1 Like
  1. The benefits on setting a token standard is that it allows developers to be share information, creates trust because everyone must deploy on same code standard that can be verified by anyone on chain. Also it make the network more efficient.

  2. Functions in ERC20 standard most commonly used are ()totalsupply.the total supply of all tokens…balanceOf() balance of tokens in given address …transfer() transer from one address to another.

1 Like
function withdraw(uint  amount) public  returns(uint){
        require(amount<=balance[msg.sender]);
        msg.sender.transfer(amount);
        balance[msg.sender]-=amount;
        
    }
  1. What are the benefits of setting a token standard like ERC20?
    All ERC20 tokens have the same standard, so every wallet or exchange can communicate with it without any problems.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    There are a lot of them, but the most important are:
    totalSupply(), which gets token supply number;
    balanceOf(address account), which gets balance of a given account address;
    transfer(address recipient, uint256 amount), which transfers given amount of currency to a given recipient.

1 Like

1. What are the benefits of setting a token standard like ERC20?
Consistent interface rules, uniform approach to labelling of key fields/functions meaning everyone ā€œspeaks the same languageā€ and it reduces overall dev time and costs.

2. What functions are in the ERC20 Token Standard Interface and what do they do?
There are several that allow users to query account balances and perform transfers:

  • balanceOf() – provides the number of tokens held by a given address.
  • transfer() – for sending tokens from one user to another.
  • approve() & transferFrom() – used to approve an allowed amount of tokens to be transferred from one users account to another.
  • allowance() – defines the number of tokens allowed to be transferred from a given address by another given address.
1 Like
  1. That exchanges can add your token without effort.

name(), returns the name of the token.
symbol(), returns the symbol of the token.
decimals(), gets the total amount of decimals the token can use.
totalSupply(), gets the total token supply.
balanceOf(address _owner), gets the balance of an address,
transfer(address _to, uint256 _value), pays the _to address by _value.
transferFrom(address _from, address _to, uint256 _value), used for withdrawal.
approve(address _spender, uint256 value), this is used to prevent a couple of attack vectors.
allowance(address _owner, address _spender), returns the amount which _spender is allowed to withdraw from owner.

events:

Transfer(address indexed _from, address indexed _to. uint256 value), must be called when a transfer happened.
Approval(address indexed _owner, address indexed _spender, uint256 _value), must be called in a approve() call.

2 Likes
  • Standards like ERC20 are important because they remove friction from economies
  • totalSupply() = gives supply
  • balanceOf(account) = returns the balance
  • transfer() = transfers from one address to another
1 Like

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

The benefits are that all wallets will use the same language and will understand the code of every different token.

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

Some functions are totalSupply, balanceOf(account) and transfer.
totalSupply(): is to know how many tokens are in circulation.
balanceOf(): gives how much tokens that account has.
transfer(): is used to transfer.

1 Like

The benefits for setting the ERC20 standards applied to writing smart contracts on the Ethereum blockchain allow tokens to be transferred and traded between wallets and exchanges using standardized programming.

Some of the functions of smart contracts are:

  • totalSupply() ->Get the total token supply
  • balanceOf() ->Get the account balance of given address
  • transferFrom() -> sends funds from an address to another
  • approve() ->Allow another address to transfer funds from another
  • allowance()->max amount that’s allowed to be transferred by another address
1 Like