// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
contract GNaira is ERC20, ERC20Capped, ERC20Burnable {
address public owner;
constructor(uint256 cap) ERC20("GNaira", "gNGN") ERC20Capped(cap * (10 ** decimals())) {
owner = msg.sender;
_mint(owner, 3000000000000 * (10 ** decimals())); // Mint initial supply up to the cap
}
function _mint(address account, uint256 amount) internal override(ERC20, ERC20Capped) {
super._mint(account, amount);
}
function _beforeTokenTransfer(address from, address to, uint256 amount)
internal
override(ERC20, ERC20Capped, ERC20Burnable)
{
super._beforeTokenTransfer(from, to, amount);
}
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Capped.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
contract GNaira is ERC20Capped, ERC20Burnable {
address public owner;
constructor(
uint256 cap
) ERC20("GNaira", "gNGN") ERC20Capped(cap * (10 ** decimals())) {
owner = msg.sender;
_mint(owner, 3000000000000 * (10 ** decimals()));
}
}
The code below was the initial code. The code above was recommended as a solution and it still showing the same error. How do I fix it? I'd appreciate the help.