Homework: ERC20

  1. Setting a token standard like ERC20 enables services, like exchanges and wallets, to efficiently add support for new tokens. In addition, the defined commands from a token standard allows for tokens to communicate with each other.

balanceOf : returns the token amount present on the given address

transfer : sends a given token amount from the present address to a given address. The transfer function is not ideal for paying in a smart contract. When a smart contract runs it won’t have access to the details of the action - specifically, between which addresses a transfer took place.

approve : The present address creates permission for a given address (usually a smart contract) to transfer tokens up to the given amount in the function.

transferFrom: Once permission has been created by the approve function, the address with permission can use transferFrom to transfer tokens needed as payment for its own functions operations.

allowance : A public function that provides the amount of tokens allowed to be transferred from a given address by another address. Anyone can query this allowance.

1 Like

What are the benefits of setting a token standard like ERC20?
Devs and wallet providers and exchanges all are working from the same blueprint, allowing companies more room to invest and grow this environment, reward all the people in this space

What functions are in the ERC20 Token Standard Interface and what do they do?
Transfer() - transfer tokens from oneaddress to another address
Totalsupply() - Sum of all balances
balanceOf() - number of tokens held by a given address
Approve() - approval to transfer up to a certain number of tokens, known as an allowance.
Allowance() - provides the number of tokens allowed to be transferred from a given address by another given address
transferFrom()

1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • ERC20 assure that every token programmed with this standard can be supported by every wallet and exchange.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • balanceOf() function show the number of token held by a given adress.
  • transfer() function can be used for send or transfer token between users.
  • totalSupply() is the number of all token in circulation.
  • allowance() function gives the number of token you are able to transfer from an adress to another.
  • approval() gives the approval to transafer from message sender to another adress.
1 Like
  1. When using a standard the efficiency is increased, since the token can be easily implemented on different wallets, exchanges etc.
  2. balanceOf - gives the balance of a specific address
    transfer - transfers a number of tokens to another address
1 Like
  1. standardization using ERC20 allows token creation to benefit from making their development more efficient. Developers and previously made products, such as wallets, can easily be used with smart contracts/erc20 tokens compared to ones which do not follow a standard.
  2. totalSupply()/balanceOf()/transfer are all standard operations in ERC 20 tokens and perform the same tasks in each token made using the ERC 20 standard.
1 Like
  • What are the benefits of setting a token standard like ERC20?

that everyone knows all the functions and it is easily read by all users. making it interoperable.

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

balanceOf shows the amount of tokens that an address has.
transfer is a function that lets an address spend or send the tokens to another address.
allowance() function gives the number of token you are able to transfer from an adress to another.
approval() gives the approval to transfer from message sender to another address.

1 Like
  1. some of the benefits of having a token standard like ERC20 is that as new tokens get created they have the ability to interoperate, be listed on an exchange, and be able to have wallets and transactions right away without extra development.

balanceOf - Checks the balance of an address
totalSupply - gives the total supply of the token
transfer - Transfers an amount of a token from one address to another

1 Like
  1. Means all tokens are fungible, tokens and wallets can communicate by the same standard.

  2. balance of - provides number of tokens provided by an address.
    Transfer - Transfer tokens from message send to specified address.
    allowance - provides amount of token that can be taken from one address by another.
    approve and transfer from - they allow for a functions to be payed for in a smart contract.

1 Like
  1. Setting standards allows interoperability with wallets, servers and exchanges.
  2. totalsupply = the number of tokens, balanceof = acc. balance
1 Like
  1. The benefits are wallets and exchanges use the ERC20 standard to implement various ERC20 tokens onto their platform and allows them to interact seamlessly with one another.

  2. total Supply () The total number of tokens that will exist.
    balance Of ( address account ) a public address of the balance of ERC20 tokens
    transfer () a transfer of ERC20 tokens from a holder account to another address.

1 Like
  1. That the code is much more efficient and understandable by exchanges and wallets
  2. Some functions:
    totalSupply: gets the number of total coins in circulation
    balanceOf: gives the balance of an account
    transfer: to make transactions
1 Like
  1. Cleaner, readable code, easier to be recognized as a valid token. “A standard interface allows any tokens on Ethereum to be re-used by other applications: from wallets to decentralized exchanges.” [Fabian Vogelsteller, Vitalik Buterin 2015]

function name() Returns the name of the token - e.g. "MyToken" .
function symbol() Returns the symbol of the token. E.g. “HIX”.
function decimals() Returns the number of decimals the token uses
function totalSupply() Returns the total token supply.
function balanceOf(address _owner) Returns the account balance of another account with address _owner .

function transfer(address _to, uint256 _value) Transfers _value amount of tokens to address _to , and MUST fire the Transfer event. Returns true or false.

function transferFrom(address _from, address _to, uint256 _value) is used for a withdraw workflow, allowing contracts to transfer tokens on your behalf

function approve(address _spender, uint256 _value) public returns (bool success)
Allows _spender to withdraw from your account multiple times, up to the _value amount.

function allowance(address _owner, address _spender) public view returns (uint256 remaining)
Returns the amount which _spender is still allowed to withdraw from _owner .

1 Like
  1. The ERC-20 standard is a technical standard used for smart contracts on the Ethereum blockchain for token implementation and provides a list of rules that all Ethereum-based tokens must follow. It is beneficial because it allows developers to accurately predict how new tokens will function within the larger Ethereum system. It also ensures compatibility between many different tokens, promoting interoperability. Using the same terminology in the code of ERC-20 compliant tokens means wallets and exchanges can build platforms to accommodate ERC-20 code rather than numerous different code used for each different token. ERC-20 standard has played a big role in making cryptocurrencies more mainstream.

  2. There are six mandatory functions and 3 optional. The mandatory are: totalSupply() function will return the total number of all tokens allocated by this contract regardless of owner. balanceOf() function will provide the current number of tokens held by a specified address. transfer() function is used to move a specified amount of tokens from the owner’s balance to another user (receiver). approve() function allows an owner to approve a delegate account to withdraw tokens from his/her account and to transfer them to another account. This is usually used in smart contracts so that permission is granted to transfer the necessary funds to perform operations. allowance() function provides the current approved number of tokens by an owner allowed to be transferred from the owner to a specific delegate, as set by the approve function. transferFrom() function is the peer of the approve function. It allows a delegate approved for withdrawal to transfer owner funds to a third-party account. The optional are: name chosen name of the token. symbol symbol by which the token is know, usually 3 or 4 characters in length. decimals this represents how divisible the token is with 0 being not at all divisible and 18 giving near continuous range of values.

1 Like
  1. So that all wallets and exchanges can support any token that uses the standard.

  2. totalSupply() number of tokens that exit
    transfer() moves tokens from one address to another
    balanceOf() show amout of tokens held by a specific address.

1 Like
  • What are the benefits of setting a token standard like ERC20?
    Ecosystem infrastructure such as exchanges and wallets, will be able to administer support to tokens from the start. It promotes good code development practices
  • What functions are in the ERC20 Token Standard Interface and what do they do?
    They are a lot of ERC20 functions. Some are listed below:
    totalSupply - allows an instance of the contract to calculate and return the total amount of the token that exists in circulation
    balanceOf - allows a smart contract to store and return the balance of the provided address.
    approve – enables the owner of the contract to authorize, or approve , a given address to withdraw instances of the token from the owner’s address
    transfer - lets the owner of the contract send a given amount of the token to another address just like a conventional cryptocurrency transaction
    transferFrom - allows a smart contract to automate the transfer process and send a given amount of the token on behalf of the owner.
1 Like
  1. What are the benefits of setting a token standard like ERC20? ERC20 is a fungible standard that allows for helps create an efficient integration between tokens.
  2. What functions are in the ERC20 Token Standard Interface and what do they do? ERC20 standards discussed in this session were totalsupply, which gives you how many tokens are in circulation and balanceOf, which shows how much the balance has.
1 Like

Homework on ERC20 token standard.

  1. What are the benefits of setting a token standard like ERC20?
    Makes it easy to deploy new tokens since everyone reads and understands the same syntax

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    balanceOf- current balance
    transfer- moves from one to another
    approve- gives permission to the smart contract to spend or deposit based off the contract rules
    allowance- transfer maximum from one wallet to another
    transferFrom- once its gets approved, this is the protocol that does the transfer from one wallet to the next

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    ERC20 defines how all tokens are program, and therefore wallets and exchanges can support token.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    One function is totalSupply() and it gives you the number of tokens in circulation, another one is balanceOf(address of account) and it gives you the balance of the token in that account.
1 Like
  1. The main benefit of setting a token standard is that all tokens essentially speak the same programming language. This makes communication within the network much more efficient, as opposed to if each token was programmed with different languages.

  2. The main functions within the ERC20 standard are:
    a) “totalSupply(x)” which dictates the total supply of the token
    b) “balanceOf (address account)” which allows users to view an account balance
    c) “transfer(x)” as the name suggests, allows for transferring
    d) “doSomething(x)”
    e) “approve(x)”
    f) “transferFrom(x)”

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

They are programed in the same way - they are identical which allowdes them to be supported by all the exchanges and wallets

  • 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. Approve() and transferFrom() are two functions that allow to transfer tokens as a alowance on approval . The allowance() function provides the number of tokens allowed to be transferred from a given address by another given address
1 Like