Skip to content

Lesson 12 - documentation for ERC20 constructor? #2206

Answered by funkycapra
funkycapra asked this question in Q&A
Discussion options

You must be logged in to vote

Here it is:

/**
     * @dev Sets the values for {name} and {symbol}.
     *
     * The default value of {decimals} is 18. To select a different value for
     * {decimals} you should overload it.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

Taken from ERC20.sol—it conforms to what Patrick has done (w/ the correct order precedence).

Also, it is important to note that this is necessary because OurToken inherits (i.e. "is a") ERC20. Thereby initializing with the parameters "OurToken" and "OT"

Thank you @k…

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@funkycapra
Comment options

@krakxn
Comment options

Comment options

You must be logged in to vote
1 reply
@krakxn
Comment options

Answer selected by funkycapra
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants