when trying to inherit from ERC20Capped, Iām getting this error.
following the tutorial in the academy:
this is my code:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../node_modules/@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
import "../node_modules/@openzeppelin/contracts/access/Ownable.sol";
contract MyToken is ERC20Capped, Ownable {
constructor() ERC20("TesT", "TT") ERC20Capped(1000000) {
_mint(msg.sender, 10000);
}
}
error:
TypeError: Immutable variables cannot be read during contract creation time, which means they cannot be read in the constructor or any function or modifier called from it.