Homework: ERC20

Consistency - all tokens following the standard will use the exact given set of pre-defined rules and functions which is good for exchanges, wallets and other use cases can access data easier.

Some of the functions in the ERC20 Token Standard are:

balanceOf() - the number of tokens held by any given address
transfer() - send tokens from one address to another
allowance() - provides the number of tokens allowed to be transferred
approve() - allow number of tokens to be taken
transferFrom() - transfer allowed number of tokens from one address to another

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?

1.The mosts important benefit is that all tokens follow the same rules and convention in the same way and the codes always will be laid out in the same way therefore all the wallets and exchanges will be able to support those tokens.

2.total supply :to check how many token are the circulation

transfer :its a function for transferring

balance :to check how much balance you have
:grinning:

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    all tokens are based on same standards which means all interaction is easy predictable.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    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.

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

  1. It’s easier to built applications (smartcontracts) that can talk to eachother because we have standarts that set the rules for the conventions and building those ERC20 Tokens. A side-effect that is pretty juicy is, that it accelerates the growth of the industry. I mean, once you build a token, youll probably do it again. Or help somebody to build one.

2.Functions like:
function totalSupply() public view returns (uint256) or
function balanceOf(address _owner) public view returns (uint256 balance)

For Example: Exchanges use those functions to see whats your balance looks like.

1 Like

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. What are the benefits of setting a token standard like ERC20?y
    Ethereum’s ERC20 protocol makes it possible to easily create new tokens. ERC20 code creates a standard to which any and all who write Smart Contracts that are to be deployed on Ethereum are beholden to.

  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    balanceOf(): gives number of tokens held at an address.
    transfer(): transfers tokens from sender to receiver.
    approval(): transfers tokens that are known as an allowance.
    transferFrom(): with an allowance, a smart contract can take tokens up to the specified limit.
    allowance(): upper limit of tokens that can be transferred.

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

When a token is set under ERC20 standard it allows wallets and exchanges to provide support for it without specific effort. Standard sets ensure the “communication” with any token is performed the same way.

  1. 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() - token holder gives another address (usually the smart contract) the approval to transfer tokens (known as allowance)
transferFrom() - can be used by the smart contract to transfer tokens from the caller’s account, limited to allowance value;
allowance() - provides the number of tokens allowed to be transferred from a given address (function caller) by another given address (usually the smart contract).

1 Like

1.The ERC20 standard is reliable and consistent for all users.

  1. ERC20 functions
  • totalSupply() public view returns (uint256 totalSupply) [Get the total token supply]
  • balanceOf(address _owner) public view returns (uint256 balance) [Get the account balance of another account with address _owner ]
  • transfer(address _to, uint256 _value) public returns (bool success) [Send _value amount of tokens to address _to ]
  • transferFrom(address _from, address _to, uint256 _value) public returns (bool success) [Send _value amount of tokens from address _from to address _to ]
  • approve(address _spender, uint256 _value) public returns (bool success) [Allow _spender to withdraw from your account, multiple times, up to the _value amount. If this function is called again it overwrites the current allowance with _value ]
  • allowance(address _owner, address _spender) public view returns (uint256 remaining) [Returns the amount which _spender is still allowed to withdraw from _owner ]

Events format:

  • Transfer(address indexed _from, address indexed _to, uint256 _value) . [Triggered when tokens are transferred.]
  • Approval(address indexed _owner, address indexed _spender, uint256 _value) [Triggered whenever approve(address _spender, uint256 _value) is called.]

(SOURCE: https://en.wikipedia.org/wiki/ERC-20)

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Setting a token standard allows everyone to talk to each other in the same convention, prevents restrictions, integrate and upgrade with each in the same structure to reach efficiency , Otherwise, there will be so mant and people will have their own versions of tokens.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    The functions are:
    a) totalSupply: Returns the total circulating amount of tokens.
    b) balanceOf: Returns how many tokens exist in an account.
    c) transfer: Transfer an amount of tokens from token owner’s account to another account.
    d) approve: A token owner can approve for spender to transferFrom tokens from the token owner’s account.
    e) allowance: Returns the amount of tokens approved by the owner that can transferred to the spender’s account.
    f) transferFrom: Allows a spender account to transfer an amount of tokens on behalf of the token owner to another account.
    to allow users to find out the balances of accounts as well as to transfer them from one account to another under varying condition
1 Like
  • What are the benefits of setting a token standard like ERC20?
    Allows everyone to work fluidly and efficiently on top of Ethereum which allows people to develop there own tokens

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

-totalSupply() returns maximum number of tokens that exist;
-balanceOf() returns the balance of a specific address;
-transfer() transfers tokens from the sender to receiver address;
-allowance() shows the amount of tokens allowed to be transferred;

1 Like
  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?
  1. Setting a universal standard is very useful for all developers and users alike. It means that any new ERC20 token, because it uses the same standards as other ERC20 tokens, will be compatible with the existing software that handles tokens, such as wallets and exchanges. Meaning there is no need to program a new wallet, etc for every new ERC20 token.
    This also helps for other developers to innovate basing their ideas on other tokens open-source code, since they can understand the functions and parameters clearly from the start, because they don’t have to learn any new functions or standards.
    This also means tokens can be coded to interact with each other. For example two different ERC20 tokens can both be listed on Uniswap together, opening the door for token to token trading, without having to code anything specific to make it possible.
    Just being an ERC20 is enough to make it possible in this scenario.

  2. Some primary functions within the ERC20 standard include:

  • totalsupply() : reads and provides the total number of tokens that exist
    -balanceOf() : reads the specific token balance of a specific wallet
    -transfer() : transfers tokens from a wallet (or smart contract) to another wallet (or smart contract)
1 Like

Homework on ERC20 token standard.

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

Standardised functions for ease of use with wallets and exchanges. Fungibility.

  1. What functions are in the ERC20 Token Standard Interface and what do they do?
    Approve - authorise the movement of /us of funds.
    Transfer - movement of funds between addresses.
    Balance - number of tokens held in an address.
    Allowance- amount of tokens with authorisation to move/use.
1 Like
  1. What are the benefits of setting a token standard like ERC20?

It is beneficial to have a standardized version to ensure compatibility with various wallets. It also is beneficial because by setting the ERC20 standard it allows for other fungible tokens to be created on top of the Ethereum blockchain represented as their own currency but at their core, specific smart contracts aside, they are identical to each other.

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

These are the various programmable language words used to instruct smart contracts to do certain things. Wallets use these standard functions to interact with every ERC20 token. For example, totalSupply, balanceOf, and transfer. These are all the same across the board for each ERC20 token making them able to be used easily.

1 Like
  1. By setting a standard like ERC20, communication between tokens becomes possible, which allows wallets to exchange them.

  2. ERC20 Standard functions:

    • balanceOf() = provides the total number of tokens held by an address.
    • transfer() = transfers a number of tokens from one address to another.
    • transferFrom() = specifies the address from where the value will be transferred.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
  • Standardisation of the token ecosystem – Enables efficient integration between projects and platforms through inter-operability and efficiency through the elimination of friction.
  1. What functions are in the ERC20 Token Standard Interface and what do they do?
  • BalanceOf () – Extracts balance in the wallet per address
  • TotalSupply () – Extracts number of tokens in circulation
  • Transfer () – Transfer tokens to a recipient address
  • Allowance () – Number of tokens allowed to be transferred
  • Approve () – Approval to transfer
1 Like

*** What are the benefits of setting a token standard like ERC20?**
A good way to look at it is that ERC20 tokens agree I speech the same language when writing a smart contract which reduces friction.
*** What functions are in the ERC20 Token Standard Interface and what do they do?**
An example is the totalsupply() function and it lets you set the total supply

Oh, yeah.
2. TokenSupply(): Provides the total supply of tokens in circulation. balanceOf(): Displays the balance of the address. transfer(): Sends tokens to a different address. allowance(): The amount/tokens allowed to be transferred.

1 Like
  1. The benefits of having a standard token like ERC20 are increment of efficiency, use the common language and get supported in the wallets and exchanges immediately.

2.1. balanceOf() The number of tokens held by the address
2.2. totalSupply() The total number of supply of the particular token
2.3 transfer() transfers x amount of tokens from A address to B address

1 Like
  1. This forces everyone using the standard to write the code following certain convetions, for instance to specify the Total Supply of a given Token, the code should use the function totalSupply()
    This eases a lot the reading / audit of such Smart Contracts.

  2. 6 Functions are required in the ERC20 Token Standard Interface :

totalSupply() returns the current supply of tokens for the contract

balanceOf(SpecificAddress) returns the token balance for that SpecificAddress

transfer(ToAddress, AmountToSend) transfers the AmountToSend of Tokens to the ToAddress as long the balanceOf(FromAddress) >= AmountToSend

approve(SpenderAddress, AmountToSend) approves Spender to spend AmountToSend (from OwnerAddress)
AmountToSend is the balance to be spent by another address in the name of the Owner
Note that this function doesn’t affect the balances directly, only the allowances

`allowance(OwnerAddress, SpenderAddress) provides the number of tokens allowed to be transferred from a given address (OwnerAddress) by another given address (SpenderAddress)
Note that anyone can query any address’ allowance, as all data on the blockchain is public

transferFrom(OwnerAddress, SpenderAddress, AmountToSend) is used when an address with an allowance wants to transfer the balance from one address to another address

Notice https://docs.ethhub.io/guides/a-straightforward-guide-erc20-tokens/ has been used to dig more on these ERC20 functions

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Wallets can read all different tokens build on the same standard because those tokens use common naming in their code.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    balanceOf() = number of tokens held by a given address
    totalSupply() = gives maximum number of tokens that exist
    transfer() = allows transfer of tokens to another public address
    doSomething() = operates instructions.
    allowance() = number of tokens allowed to be transferred from a given address by another adress

and more…

1 Like