how to utilize the ERC20Detailed.sol
Environment
4.1.0
Details
Code to reproduce
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
// import "@openzeppelin/contracts/token/ERC20/ERC20Detailed.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
//with capped token
contract ERC20WithCapped is ERC20, ERC20Capped {
// ,ERC20Detailed, ERC20Capped
constructor(
string memory name, // token full name
string memory symbol, //token symbol
uint8 decimals, //precious
uint256 initalSupply, //init total
uint256 cap //capped quantity
)
public
// ERC20Detailed(name, symbol, decimals)
ERC20Capped(cap * (10**uint256(decimals)))
{
_mint(msg.sender, initalSupply * (10**uint256(decimals)));
}
}
Above is sample code.
Also I got below alarm info:
Derived contract must override function “_mint”. Two or more base classes define function with same name and parameter types.
Contract “ERC20WithCapped” should be marked as abstract.