The problem somehow lied in the fixtures
async function deployToken() {
const Token = await ethers.getContractFactory("Token");
const token = await Token.deploy();
await token.waitForDeployment();
const tokenAddr = await token.getAddress();
return { token, tokenAddr };
}
async function deployFundedToken() {
const Token = await ethers.getContractFactory("Token");
const token = await Token.deploy();
await token.waitForDeployment();
const tokenAddr = await token.getAddress();
const oneEth = ethers.parseEther("1");
await setBalance(tokenAddr, oneEth);
return { token, tokenAddr };
}
I had these two fixtures. When I deleted the funded one and just started to fund when I needed to the balanceOf func and all the other ones became callable. Does anyone know why though?