I saw this code snippet on openzeppelin,

contract DoggoToken is ERC20, ERC20Detailed, ERC20Mintable, ERC20Burnable {

    string name,
    string symbol,
    uint8 decimals,
    address[] minters
    ERC20Detailed(name, symbol, decimals)

and I can't figure out what ERC20Burnable(), ERC20Mintable(minters), ERC20Detailed(name, symbol, decimals), and ERC20() behind constructor stands for.

Is it representing modifier, or contract instantiation?

And is there any using guide for this syntax?



They're calls to parent constructors. This is probably the most relevant part of the documentation: https://solidity.readthedocs.io/en/v0.5.2/contracts.html#arguments-for-base-constructors.

If that doesn't answer all your questions, jump up to the top of the "inheritance" section and read from there.

  • It's great. Appreciate! – Ren Jan 3 at 5:34
  • I got another question. Why does it need to provide the base constructor argument in the header or using modifier-invocation-style. Can't I just call the the base constructor in the curly brackets? – Ren Jan 4 at 8:57

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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