I am getting this error:
Member "mint" not found or not visible after argument-dependent lookup in contract ERC20
Been staring at this for an hour. Would appreciate any help!
Thank you
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.3;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
contract stakingTest {
ERC20 public token;
ERC20 public token2;
address private tokenAddress;
uint private fixedAmount;
constructor () {
}
function setToken(ERC20 _token) public {
token = _token;
}
function setAddress(address _address) public {
tokenAddress = _address;
token2 = ERC20(_address);
}
// Error
// Member "mint" not found or not visible after argument-dependent lookup in contract ERC20
function claim() public {
token._mint(msg.sender, fixedAmount);
}
// This works
function totalSupply() public view returns (uint) {
return token.totalSupply();
}
}
Code to reproduce