I have a contract that has a reference to another contract:
function initialize(IERC20 token, address owner) public initializer {
Ownable.initialize(owner);
_token = token;
_startVesting = now;
}
But when I want to initialise this contract within a truffle test, it breaks with a strange, very long error:
"before each" hook for "minting with vesting works generally": Error: invalid address (arg="token", coderType="address", value={"constructor":{"contractName":"CityToken","abi":[{"constant":true,"inputs":[],"name":"name","outputs":[{"name":"",
. and so on (it is flooding my screen in red)
this is my test code:
beforeEach(async function () {
token = await CityToken.new({from: owner});
await token.initialize( owner );
example = await Example.new({from: owner});
await example.initialize(token, owner);
The CityToken is derived from StandaloneToken, which es derived from ERC20Mintable, which implements the required IERC20-interface.
Is this the wrong way to pass a contract to another? How should I do?