I'm following https://openzeppelin.org/api/docs/learn-about-tokens.html which contains the following snippet:
contract DoggoToken is ERC20, ERC20Detailed, ERC20Mintable, ERC20Burnable {
constructor(
string name,
string symbol,
uint8 decimals,
address[] minters
)
ERC20Burnable()
ERC20Mintable(minters)
ERC20Detailed(name, symbol, decimals)
ERC20()
public
{}
}
Compiling using
○ → npx truffle version
Truffle v4.1.14 (core: 4.1.14)
Solidity v0.4.24 (solc-js)
I get the following error
(...)
ERC20Mintable(minters)
^--------------------^
Compilation failed. See above.
And that's because ERC20Mintable doesn't expect minters in the constructor. I'm not sure how to fix though, just starting with Solidity/OZ.
Hey there @vanjan, thanks for reporting this. Indeed, the example is wrong, it should read:
contract DoggoToken is ERC20, ERC20Detailed, ERC20Mintable, ERC20Burnable {
constructor(
string name,
string symbol,
uint8 decimals
)
ERC20Burnable()
ERC20Mintable(
ERC20Detailed(name, symbol, decimals)
ERC20()
public
{}
}
We're currently in the process of revamping the docsite, updating old guides, etc. (including letting users improve it themselves!), and this is one of the first things I intend to fix. Sorry about this!
Most helpful comment
Hey there @vanjan, thanks for reporting this. Indeed, the example is wrong, it should read:
We're currently in the process of revamping the docsite, updating old guides, etc. (including letting users improve it themselves!), and this is one of the first things I intend to fix. Sorry about this!