Which version this ERC20Detailed.sol is available?

how to utilize the ERC20Detailed.sol

image

:computer: Environment

4.1.0

:memo:Details

:1234: 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.

ERC20Details is not present in the latest version of OpenZeppelin Contracts.

Please check out Contracts Wizard to put together your contract. ERC20Capped is not available there yet, but it’s not necessary if the token is not Mintable.

2 Likes