-
It allows for fast coding that is easily understood by the EVM
-
TotalSupply() provides amount of total tokens in existant
BalanceOf() provides the amount ot tokens alloted to a certain address
Correct! Can you briefly explain us what these functions do?
Perfect! Any other functions you can explain to us? How about some related to the transfer of tokens?
How about the benefits for other people or exchanges that interact with the contract?
Can you think of other essential ERC20 functions related to the transfer of tokens?
1 By using the ERC-20 standard smart contract easily interact with multiple tokens (good for DeFi projects), it is also a good programming practice.
2
name() Returns the name of the token
symbol() Returns the symbol of the token.
decimals() Returns the number of decimals the token uses.
totalSupply() Returns the total token supply.
balanceOf() Returns the account balance of another account with address _owner
.
transfer() Transfers _value
amount of tokens to address _to
transferFrom() Transfers _value
amount of tokens from address _from
to address _to
approve() Allows _spender
to withdraw from your account multiple times, up to the _value
amount.
allowance() Returns the amount which _spender
is still allowed to withdraw from _owner
.
Events Transfer() MUST trigger when tokens are transferred, including zero value transfers.
Events Approval() MUST trigger on any successful call to approve(address _spender, uint256 _value)
.
What are the benefits of setting a token standard like ERC20?
By having a streamline ER20 token, it can interact/integrate within the Crypto environment seamlessly. Exchanges benefit dramatically by having this standard as it can list hundreds of different tokens efficiently.
What functions are in the ERC20 Token Standard Interface and what do they do?
totalsupply
: sum of all balances
allowance()
: number of tokens allowed to transferred from address to another
balanceOf() : number of tokens held by an address
transfer() : send tokens from one address to another
doSomething() : instructions
approve(): part of a 2step transfer: authorizes to transfer an amount of tokes to another
given address
TotalSupply() provides the total supply of the token.
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() a token holder gives another address approval to transfer up to a certain number of tokens(allowance).
transferFrom() transfer tokens from senderâs account
allowance() provides the number of tokens allowed to be transferred from a given address
1. What are the benefits of setting a token standard like ERC20?
- All ERC20 tokens use the same standard (functions, âŚ) so it make it easier to implement and exchange this tokens on different wallets and exchanges.
2. What functions are in the ERC20 Token Standard Interface and what do they do?
- totalSupply() // shows the total circulating supply
- balanceOf() // shows the balance of wallet
- transfer() // coordinates the transfer of tokens
-
The benefits of setting a token standard like ERC20 is that people that want to build applications or tokens can have a reference. This standard makes it easier for people to have one thing they could follow and not have everyone have their own and different standard.
-
There is balanceOf() to find out the balance held in a particular address.
Next is transfer() which moves tokens from one address to the other.
approve() and transferFrom are the functions needed to execute a smart contract.
approve() is used by the token holder when they want to perform a smart contract, where there is an approval of token transfer.
Reduces friction throughout the development community by regulating naming conventions for variables, functions, etc. This reduction in friction leads to better collaboration among coders.
totalSupply() = returns number of tokens found in token chain
balanceOf() = returns token a balance for given account
transfer() = transfers an amount to a given address from the owner of that contract returns true/false success
transferFrom() = same as transfer() but with a specified from address
approve() = gives another address approval power to transfer up to a x amount of tokens from their balance
1.Fungibility, same standard allowing us to build applications on the same network.
2 function totalSupply () public view returns (uint256) {
return _balance [ account]; tells you how many tokens in total circulation
function balanceOf ( address account) Tells you the balance of the address or a wallet
Function transfer to
From a programmatic sense, they somewhat restrict developers to conform to a set of rules. This then provides behaviors of a particular something universally.
Specifically, the ERC20 standard thus provides a uniform and fast transaction as they will all be treated in the same way as they provide the âsameâ set of behaviors and reduces the complexity of token interaction.
The interface:
interface ERC20 {
function totalSupply() public view returns (uint);
function balanceOf(address tokenOwner) public view returns (uint balance);
function transfer(address to, uint tokens) public returns (bool success);
function approve(address spender, uint tokens) public returns (bool success);
function allowance(address tokenOwner, address spender) public view returns (uint remaining);
function transferFrom(address from, address to, uint tokens) public returns (bool success);
}
totalSupply : Returns the total circulating amount of tokens.
balanceOf : Returns how many tokens exist in an account.
transfer : Transfer an amount of tokens from token ownerâs account to another account.
approve : A token owner can approve for
spender
totransferFrom
tokens from the token ownerâs account.
allowance : Returns the amount of tokens approved by the owner that can transferred to the spenderâs account.
transferFrom : Allows a spender account to transfer an amount of tokens on behalf of the token owner to another account.
- What are the benefits of setting a token standard like ERC20?
The benefit is that they are all identical from a technical value perspective, which allows all wallets to engage and read the information easily.
- 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
doSomething() completes the action that is ordered by ââdoerââ, owner of the operation
approve() is a function that the owner uses to confirm the tx after the other address has been provided and confirmed
transferFrom() FX when the owner provides another address approval and moves on to the next step
allowance() provides the number of tokens allowed to be transferred from a given address by another given address
Transfer() emits details of the movement of tokens from one address to another
Approval() emits details of approvals of tokens from one address to another. These can be used to keep track of balance and allowance changes for addresses without needing to poll the blockchain.
- What are the benefits of setting a token standard like ERC20? Programmers of tokens want a standard so all exchanges and wallets will be able to support any token. There is no friction to innovation.
- What functions are in the ERC20 Token Standard Interface and what do they do? The standard functions allow all exchanges and wallets to communicate seamlessly. Examples of functions in ERC20 are total supply which tells you how many tokens are in circulations. BalanceOf which is used by exchanges to check your balance of your particular address. Another function is Transfer.
- It makes it easier for exchanges and wallets to understand the programming language, so everyone is using the same functions to describe the same outcomes. This increases the interoperability of the whole space so there is less friction
- TotalSupply shows the total supply of the Token. BalanceOf shows the total amount in a particular account.
- What are the benefits of setting a token standard like ERC20?
Allows an unlimited number of different projects to have tokens on the Ethereum blockchain that are fungible and easily tradeable thru exchanges and from wallets
- What functions are in the ERC20 Token Standard Interface and what do they do?
Total Supply - gives supply of each token
Balance of - gives the balance of each address
Transfer - allows easy transfer of these tokens on Ethereum
Homework on ERC20 token standard.
- What are the benefits of setting a token standard like ERC20?
All exchanges and wallets can support a standard token as they speak the same language it creates a smooth compatibility. (standardization is always a benefit with most working environment applications) - What functions are in the ERC20 Token Standard Interface and what do they do?
Total supply, balance of, transfer, Allowance, Approve
- Its like having a universal language or same conventions making it easier to be added bywallets, exchanges etc.
2.balanceOf() shows balance of specific account, totalSupply() gives maximum number of tokens that exist.
Homework on ERC20 token standard.
What are the benefits of setting a token standard like ERC20?
- With Ethereum Introducing the possibility of allowing anyone to programme anything they want on a smart contract, people are able to create tokens or projects on top of the Ethereum network. Now with so many people building on top of the Ethereum Network a token standard was recognised ERC20 tokens. This meant that any projects that is a ERC20 token would be able to communicate with other ERC20 as well. More connections and adoptions is benefited from having a ERC20 standards with also wallets and Exchanges being able to list these Fungible tokens. This allows future growth on the Network.
What functions are in the ERC20 Token Standard Interface and what do they do?
- With ERC20 smart contract all functions are all the same. Meaning when for example when setting a function for checking balance the function to do would be balanceOf() that would be the same for all ERC20 smart contracts. This makes it easier for all ERC20 smart contracts to communicate if your looking to request balance or function for total supply would be totalSupply() all the command function would be the same. This would allow better interface on the network then having different functions for the same tasks.
-
What are the benefits of setting a token standard like ERC20?
ERC20 standards insure that the tokens are created the same way and can be supported by the same wallet also makes it easy for the space to communicate with each other. ERC20 tokens are fungible. -
What functions are in the ERC20 Token Standard Interface and what do they do?
Function Total Supply gives the total supply of a particular ERC20 token
Function balanceOf is used to get the balance of an ERC20 token for a specific address account.