I have been following various dapps based on ethereum and found one that has a 2-token model. One Token is ERC20 Standard compliant and one that is not. The one that is compliant is the one that acts like currency and the other doesnt have a monetary value. That one is just used to perform rating for individuals. I don't get what could be the benefits or problems with implementing such an idea and would like to know more. So please explain your thoughts regarding this.
3 Answers
ERC20 tokens are used because they "play nice" with existing smart contracts that operate on tokens, like etherdelta. Even some type of reputation token can be an ERC20 token, as long as it follows this standard: https://theethereum.wiki/w/index.php/ERC20_Token_Standard
An ERC20 token must implement these functions and getters:
contract ERC20 {
function totalSupply() constant returns (uint totalSupply);
function balanceOf(address _owner) constant returns (uint balance);
function transfer(address _to, uint _value) returns (bool success);
function transferFrom(address _from, address _to, uint _value) returns (bool success);
function approve(address _spender, uint _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint remaining);
event Transfer(address indexed _from, address indexed _to, uint _value);
event Approval(address indexed _owner, address indexed _spender, uint _value);
}
I would highly recommend conforming you token to the ERC20 standard, unless you have a good reason not to.
-
1
-
1@Leon, the only reason I have for not instituting the ERC20 standard would be if you didn’t want your token to be accessible with pre-built contracts, or you wanted to obscure your token somehow.– AlexCommented Oct 20, 2017 at 6:39
At first, Token != DApp
ERC-20 helps to web-clients(stock exchanges, etc) to interact with your token. That's why it is highly recommended to use this Standard.
So, if someones know that your token is ERC-20, he knows that he can execute transfer
, balanceOf
and other functions. And this knowledge is very useful for him, if he try to implement universal interface for all token.
But ERC-20 is just interface for your token. You can implement function in that way, that you want.
If you make DApp, then you don't need to use ERC-20 Standard, because ERC20 is only for tokens (coins, cryptocurrency, etc)
It depends on what the token is being used for.
A token is just a contract which records how many are at any given address. If it's an ERC20 token, this means it has functionality to query the total token supply, transfer tokens you own to someone else, or query anyone's token balance, amongst other related things. This is obviously useful functionality for anything you'd like to be freely traded or act as a currency, and if you want this to be the case for your token then you would implement ERC20 so that all existing software/dapps (e.g exchanges) can interact with your token without extra programming being done.
So, why would you not want your token to be ERC20?
Perhaps you don't want your token to be traded, such as if you're using it as a reputation count like an eBay rating. Perhaps your tokens are non-transferable 'reward-points' for using your system which can only be redeemed through your app. There are a variety of token uses you could think up which aren't really designed to be bought/sold/transferred, and in this case you would not want the token to be ERC20 compliant.