Hey @DinS
Well done, just a little integration to the transferFrom answer:
transferFrom() - transfers a certain amount of approved token to an address
in behalf of the token owner
Hey @DinS
Well done, just a little integration to the transferFrom answer:
transferFrom() - transfers a certain amount of approved token to an address
in behalf of the token owner
Homework on ERC20 token standard.
What are the benefits of setting a token standard like ERC20?
Efficiency. Interoperability, integration. No friction. In opposit of everyone structuring differently.
What functions are in the ERC20 Token Standard Interface and what do they do?
totalsupply. Tracks sum of all balances.
balanceOf()
Provides the sum of tokens held by a given address.
transfer()
Transfers tokens directly from the message sender to the recipent address.
approve()
Token holder uses this for giving allowance to another address.
transferFrom()
?
allowance()
provides the number of tokens allowed to be transferred from a given address by another given address
Interoperability between tokens. Efficiency for the network as a whole. Reduced friction since everyone is moving in a unified fashion.
totalSupply() - Establishes how many tokens will be in circulation
balanceOf() - function allows for checking the balance of a particular address
transfer() - transfers ownership of a token amount to another address
transferFrom() - used to automate the transfer of funds from one account to another
approve() - gives approval of another address to transfer funds
allowance() - gives balance remaining in the account, and what can be transacted, transferred or withdrawn
Provide a common set of features and interfaces for successful token contracts, allow wallet tokens balances, create a means for exchanges to list more by providing address of the token’s contract, and lastly, almost every token are created in that way.
Implementation APY standard within the SC, basic functionality to transfer tokens, approved to be spent by another on-chain party and a standard interface allows any tokens to be re-used by other apps to decentralized exchanges.
If you set a token standard like ERC20 it allows the whole space to interact with each other. If we use the same standards it will allow us to make programs that can talk to each other.
One of the functions in ERC20 is totalSupply, this function needs to exist otherwise the token will not have a supply. A few other standard functions are: BalanceOf, transfer, allowance.
It allows everyone to speak the same language and to be able to interact with each other to create a frictionless, efficient ecosystem. Existing wallets or exchanges already know how to support a new ERC20 token.
Example of ERC20 functions are –
totalSupply() – which creates the total token supply
balanceOf() – to check the balance of a particular address
transfer() – transfers money to another address
Benefits: Increase of efficiency. All tokens will be able to communicate with eachother in a known and expected way. It allows wallets, exchanges and platforms to support any tokens using the same standard. It makes the life easier for programmers since they work in the same enviroment.
function toatalSupply() = Provides information about the total token supply.
function balanceOf() = Provides the number of tokens held by a given address. Anyone can
query any adress’ balance, as all data on the blockchain is public.
function allowance() = Return a set number of tokens from a spender to the owner.
function transfer() = Execute transfers of a specified number of tokens to a specified address.
function approve() = Allow a spender to withdraw a set number of tokens from a specified
account.
function transferFrom() = Execute transfers of a specified number of tokens from a specified
address
Additionally, these function will trigger up to two events, including the transfer event and the approval/validation event.
Every wallet and exchange will be able to handle and accept any new token with the standard from launch day without any issues.
balance0f() queries a wallet for the amount of tokens held in that specific wallet.
transfer() sends an amount of tokens from the message sender to the recipient.
approve() gives approval to an address to transfer a certain amount of tokens.
transferFrom() transfers the allowed amount of tokens from an address.
allowance() queries the amount of tokens allowed to be transferred from an address by another address.
What are the benefits of setting a token standard like ERC20?
A standard defines how tokens are programmed. It is important they are programmed the same way, so all exchanges and wallets can accept them.
What functions are in the ERC20 Token Standard Interface and what do they do?
totalSupply - how many tokens are in circulation
balanceOf - shows balance of an address
transfer - transferring money to different address
1. What are the benefits of setting a token standard like ERC20?
It creates common rules that programmers can follow that result in each token created can interact within the same programming environment. This allows increases scalability and eases development in the space.
2. What functions are in the ERC20 Token Standard Interface and what do they do?
Here’s just a few:
totalSupply() : provides the total supply of the tokens.
balanceOf(): provides the balance of tokens in an address.
transfer(): transfers tokens from one address to another.
1- It can be easily added to an exchange. It can be used in same wallets. it can be sent by the same network.
2. balanceOf(): provides the number of tokens held by a given address.
What are the benefits of setting a token standard like ERC20?
It makes it easy to connect to a wallet or exchanges since they have common naming in the code.
What functions are in the ERC20 Token Standard Interface and what do they do?
totalSupply() equals the sum of all balances.
balanceOf(address account) 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() emits details of approvals of tokens from one address to another
allowance() provides the number of tokens allowed to be transferred from a given address by another given address
1: It allows the interoperability of all tokens on wallets and exchanges. It also, creates tokens that are fungible, ie identical to one another.
2: There are many functions like adding, subtracting, multiply, divide,. When creating a new token you must also specify total supply, and you can query balances of addresses and also transfer these balances from one address to another.