0

I saw this list of things that can be modified for your token. I can't find it but it listed all the different uses and things that can be changed about your token such as the max supply etc.

3

An ERC20 contract must exactly implement the specification described here: https://eips.ethereum.org/EIPS/eip-20. This makes the critical behavior predictable so it will be compatible with wallets and exchanges.

A contract may implement additional behaviour provided it doesn't interfere with the minimum functionality. It's worth noting that exchanges and wallets will not use such extra functions but they may be useful for a DApp interface.

Have a look at this example: https://theethereum.wiki/w/index.php/ERC20_Token_Standard

There's a pretty handy cheat sheet for the normal configurable stuff:

    symbol = "FIXED";
    name = "Example Fixed Supply Token";
    decimals = 18;
    _totalSupply = 1000000 * 10**uint(decimals);

In addition, there's an extra function that is not part of the standard. Users might object to the owner having such a privilege but the presence of this function does not, itself, break ERC20 compatibility.

// ------------------------------------------------------------------------
// Owner can transfer out any accidentally sent ERC20 tokens
// ------------------------------------------------------------------------
function transferAnyERC20Token(address tokenAddress, uint tokens) public onlyOwner returns (bool success) {
    return ERC20Interface(tokenAddress).transfer(owner, tokens);
}

Internal logic and extra functions don't break ERC20 compatibility provided the required functions perform correctly.

Variations of the standard include Mintable tokens that allow the owner to increase the total supply and burnable tokens that do the reverse.

In case that nuance isn't clear, the specification requires that balanceOf() returns a uint that represents an account's entitlement but the spec is silent on the method of calculation. It is typically a running total of transfers but this is not a hard requirement. It could include other factors such as interest or dividends in more exotic patterns.

Hope it helps.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.