Homework: ERC20

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

    The benefits of token standard like ERC20 is that it brings efficiency, provides
    interoperability with exchanges and wallets, and creates a diverse ecosystem on Ethereum.

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

    These functions create a standard so that we can all build applications that talk to each other and
    makes it easier for a more efficient economy. Examples of these functions are as followed:
    function name() public view returns (string)
    function symbol() public view returns (string)
    function decimals() public view returns (uint8)
    function totalSupply() public view returns (uint256)
    function balanceOf(address _owner) public view returns (uint256 balance)
    function transfer(address _to, uint256 _value) public returns (bool success)
    function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
    function approve(address _spender, uint256 _value) public returns (bool success)
    //function allowance(address _owner, address _spender) public view returns (uint256 remaining)

1 Like

Homework on ERC20 token standard.

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

Can standardize programming instructions

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

Get balance and get total balance

1 Like

1. What are the benefits of setting a token standard like ERC20?
The possitive thing is when a new token with standard ERC20 is created, It can be adopted inmediatly.
2. What functions are in the ERC20 Token Standard Interface and what do they do?
balanceOf() Provides the balance of a speciffic address.
transfer() function to send tokens from account A to account B
approve() A token hodler gives another address approval to transfer up a speciffic amount of tokens, knows as allowance.
transferFrom () used by a function to take some tokens to do it “work”.
allowance() provides the number of tokens which can be transferred to one address to another.
Approval() emits details of approvals of tokens

1 Like
  1. A benefit to having a standard is that you do not have to reinvent the wheel every time you create a smart contract. It allows for all current wallets and platforms to accept the tokens.

2.total supply allows you to see the amount of total tokens on the network. balance of(address account) allows you to see the balance of a specific address.

1 Like
  1. is easy to be accepted by decentralized exchanges, is easy to be executed by EVM, is scalable and easy to understand by the investors and miners, are more efficient and bring people together in order to do easier an IEO.
  2. totalSupply() gives maximum number of tokens that are created
    balanceOf() function provides the number of tokens held by a given address
    transfer() function transfers a number of tokens directly from the message sender to another address
    approve() and transferFrom() are two functions that allow the above scenario to work using a two-step process. In the first step a token holder gives another address (usually of a smart contract) approval to transfer up to a certain number of tokens, known as an allowance. The token holder uses approve() to provide this information.
    The allowance() function provides the number of tokens allowed to be transferred from a given address by another given address. Note that anyone can query any address’ allowance, as all data on the blockchain is public. Any contract using allowance() must additionally consider the balance of the holder when calculating the number of tokens available to it.
    Minting tokens emits a Transfer() event with the 0 address as the source.

Methods
function name() public view returns (string)
function symbol() public view returns (string)
function decimals() public view returns (uint8)
function totalSupply() public view returns (uint256)
function balanceOf(address _owner) public view returns (uint256 balance)
function transfer(address _to, uint256 _value) public returns (bool success)
function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
function approve(address _spender, uint256 _value) public returns (bool success)
function allowance(address _owner, address _spender) public view returns (uint256 remaining)

Events
event Transfer(address indexed _from, address indexed _to, uint256 _value)
event Approval(address indexed _owner, address indexed _spender, uint256 _value)

There are already plenty of ERC20-compliant tokens deployed on the Ethereum network. Different implementations have been written by various teams that have different trade-offs: from gas saving to improved security.

Example implementations are available at

OpenZeppelin implementation
https://raw.githubusercontent.com/OpenZeppelin/openzeppelin-contracts/9b3710465583284b8c4c5d2245749246bb2e0094/contracts/token/ERC20/ERC20.sol
ConsenSys implementation
https://raw.githubusercontent.com/ConsenSys/Tokens/master/contracts/eip20/EIP20.sol

1 Like

1- Benefits of setting a standard like ERC20 is that its naturally consistent for the fluidity and timeless use/management/implementations on the network.

2- One function is the “totalSupply()” where anyone can see the total balance of an ERC20 token. Another is “balanceOf(‘address account’)” where anyone can see the balance of an account where “address account” is queried.

DuuKaa!!

1 Like

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

ERC-20 standard allows for wallets to provide token balances for hundreds of different tokens and allows for exchanges to provide an ERC-20 token just by providing the address of the token contract.

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

  • totalSupply (provide information about the total token supply)
  • balanceOf (provide account balance of the owner’s account)
  • transfer (execute transfer of a specified number of tokens to a specified address)
  • transferFrom (execute transfer of a specified number of tokens from a specified address)
  • approve (allow a spender to withdraw a set number of tokens from a specified account)
1 Like
  1. so all other coins that are whatever name still have value and are fungible. because they are under erc20 standard. if otherwise people would be making all kinds of versions of their own tokens which wouldnt make sense at the end of the day.

  • totalSupply() function and gives u how many tokens are in circulation
  • balanceOf(account balance) gives tokens on how much that account has
    those are just a few but you can see what the functions are because in the code it literally says function before what u want it to do.
1 Like
  1. It is very fungible and is an accepted standard.

  2. It gives the total supply of existing tokens, whether tokens can be minted or burned, verifying balances tokens in each address, and completes transfers between addresses. These are the main functions but there are many others and they are all standardized.

1 Like
  1. Firstly to provide fungibility among the “Tokens”. Plus the commonality among the tokens makes for fair play and understanding in the smart contract community, for standards, code, and implementation, mining, and trading.
  2. “totalSupply” is one that represents the total tokens in circulation. Another is "balanceOf (address account) used to determine the balance in tokens a particular smart contract address has.
1 Like

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

The benefits are that the standard provides a common framework or understanding among the players in the Ethereum network, so that:

  • It is easier for developers to develop a token, and development of a token will result in immediate interoperability with wallets and exchanges;

  • Nodes, wallets, exchanges and other applications are more capable of integrating and interacting with the smart contract; and

  • It is easier to create fungible tokens.

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

  • The totalSupply() function: provides the sum of all balances;

  • The balanceOf() function: provides the number of tokens held by an address;

  • The transfer() function: transfers a number of tokens directly from the message sender to another address. Drawbacks of this functions include that no checks are made on the recipient address, and more importantly that it “doesn’t work so well when tokens are being used to pay for a function in a smart contract. This is because at the time the smart contract runs it has no access to details of which addresses transferred funds where and so cannot assert that the user calling the contract has paid the required amount of funds to operate the contract” - https://www.wealdtech.com/articles/understanding-erc20-token-contracts/ .

  • The approve() and transferFrom() functions, which are used together in a 2-step process to make a transfer from an address to a smart contract to pay for a function of that smart contract.

    With approve() - a token holder can communicate to the smart contract it wants to utilize, another address (usually of a smart contract) to transfer up to a certain number of tokens, known as an allowance; and

    With transferForm(), when the function that the token holder wants to utilize is called by the token holder, the function can use transferFrom() to take the allowance from the account (which was approved by the token holder with the approve() function).

1 Like

1- Benefits of setting token standards are ease of access for those making/taking new tokens, all ERC 20 tokens operate on the same standard so wallets and exchanges can use them day one. This makes it easy for the economy to grow and expand the ETH empire.
2- Transfer() is one of two transfer functions, this one is basic and doesn’t work with SC.

  • Approve() & transferfrom() are the other 2 functions to send money to a SC to be used. They work together in order to approve tokens for use in a SC and use transfer from to pull from a wallet for use in SC.
    Allowance() function provides the number of tokens allowed to transferred from one wallet to another.
1 Like
  1. a tokenstandard like ERC20 means new tokens can be created on the ethereum platform and instantly be supported in exchanges and wallets so the space can grow faster

  • total supply is 0-place and returns the total amount of the token in circulation
  • balanceOf maps an account to its balance (probably no side-effects?)
  • transfer transfers ETH from one address to another
1 Like

Homework Assignment: ERC20

  1. Setting the same standards allows communication between nodes.
  2. a. function totalSupply (Total amount of tokens)
    b. function balanceOf ( checks balance)
    c. function transfer (transfers tokens)
1 Like

[quote=“filip, post:1, topic:8440”]

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

It makes the tokens fungible, meaning that the foundation is identical and they can be processed and understood in the same way making deployment onto exchanges easy too.

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

There are a few such as:
Total supply - giving total of tokens in circulation
BalanceOf() - giving total balance of certain account

1 Like
  1. Setting a token standard like ERC20 creates basic guidelines for the network to follow and also to depend on with regard to a particular token. This makes it possible for anyone to interact gracefully with tokens and provides a language to code with so that communication surrounding a token is ubiquitous. Basically, setting a token standard makes that token fungible.
  2. Functions in the ERC-20 Token Standard Interface are:

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( ) - number of tokens, known as an allowance.
transferFrom( ) - another address, on the sender’s behalf.
allowance( ) - provides the number of tokens allowed to be transferred from a given address to another given address.
totalSupply( ) - shows the total amount of tokens that exist in circulation.

1 Like
  1. What are the benefits of setting a token standard like ERC20?
    If smart contract are coded the same way or same standard, that is, to deploy a token for smart contract platform is beneficial for the entire space.
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
    Total Supply- shows the status of all the account address balances.
    Show updates of accounts address balances when there is Tx of token between addresses.
    The balanceOf() function provides the number of tokens held by a given address.

[/quote]

1 Like
  1. So that there would be uniformity among all tokens created on ethereum Blockchain. it would help wallets and exchanges function better.
  2. ER20 Standard interface has functions such as Mint…where new tokens can be minted or duplicated, it also has total supply function. where the total token supplied is specified.
1 Like

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

  • Follow a list of rules so that they can be shared, exchanged for other tokens, or transferred to a crypto-wallet
  • Uniform and fast transactions.
  • Brings in more efficient transactions confirmation.
  • Convenience - if everyone create their own tokens with its own functions then it would be an interoperability nightmare.
  • The transfer of tokens without ERC20ncould have broken contracts and made them vulnerable to hackers.
  • ERC20 regulations present a proper blueprint for developers to follow. It is easy for them to come up with tokens instead of working from scratch.
  • An important factor that is critical for the overall valuation of the Ethereum network is the liquidity of these ERC20 tokens. If the projects on top of Ethereum are active and interacting with each other, then that is going to invariably bring more projects and more users to the Ethereum network.

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

-a) mandatory rules:

  • totalSupply - identifies the number of all tokens allocated by its contract regardless of owner.
  • balanceOf - returns the current token balance of an account, identified by its owner’s address.
  • transfer - transfers tokens from one address to another, when called by respective token holders.
  • transferFrom - allows a delegate approved for withdrawal to transfer owner funds to a 3rd account.
  • approve - allows a token owner to approve a delegate account to withdraw tokens from his account and to transfer them to other accounts.
  • allowance - returns the current approved number of tokens by an owner to a specific delegate, as set in the approve function.

-b) optional rules:

  • Token Name
  • Token Symbol
  • Number of Decimals - determine to what decimal place the amount of the token will be calculated.
1 Like
  1. What are the benefits of setting a token standard like ERC20?
    Make for the external applications ( like walltet ) to interact easylier with the contract
  2. What functions are in the ERC20 Token Standard Interface and what do they do?
  • balanceOf(acc) - return a balance of acc
  • totalSupply() - get total token supply
  • transfer (acc, value) - transfer to acc (from message sender i guess ) a specified value.
  • transferFrom (sender, recipient, amount ) - moves amount tokens from sender to recipient using the allowance mechanism. amount is then deducted from the caller’s allowance.

To more: https://eips.ethereum.org/EIPS/eip-20
https://docs.openzeppelin.com/contracts/2.x/erc20

1 Like