I want to pass a single parameter as array into a function call :
contract MyToken is StandaloneERC20 {
function initialize(
address owner,
address minter,
address[] memory pausers
) public initializer {
address[] memory minters = [minter];
StandaloneERC20.initialize("MyToken", "MTK", uint8(18), minters, pausers);
}
StandaloneERC20.initialize expects an array for the forth argument minters:
function initialize(
string memory name, string memory symbol, uint8 decimals, address[] memory minters, address[] memory pausers
) public initializer {
However, using my code I get the following compiler error with solidity 0.5.7:
TypeError: Type address[1] memory is not implicitly convertible to expected type address[] memory.
address[] memory minters = [minter];
^---------------------------------^
I have also tried to pass the minter as array-argument:
contract MyToken is StandaloneERC20 {
function initialize(
address owner,
address minter,
address[] memory pausers
) public initializer {
StandaloneERC20.initialize("MyToken", "MTK", uint8(18), [minter], pausers);
}
But this seems to be completely different from what I would expect because of this compiler error:
Member "initialize" not found or not visible after argument-dependent lookup in type(contract StandaloneERC20).
StandaloneERC20.initialize("MyToken", "MT", uint8(18), [minter], pausers);
^------------------------^
How can I pass a single argument as array?