I have ERC20 controller contract which deploys ERC20 contract.
contract ERC20Controller {
ERC20 ercContract;
constructor {
ercContract = new ERC20();
}
}
Now I'm testing this contract in hardhat and want to call balanceOf
function. I've expected that I can just call it this way: controller.ercContract().balanceOf()
but it fails?
Is the only option there to create function inside controller which calls balanceOf on child contract?