This is my contract
pragma solidity ^0.5.2;
contract NewContract{
address[] public deployedContract;
function createContract(uint minimum) public{
address newContract = new Contract2(minimum,msg.sender);
deployedContracts.push(newCampaign);
}
function getDeployedContracts() public view returns(address[] memory){
return deployedContracts;
}
}
I'm getting the error while assigning calling the Campaign contract inside NewContract contract
TypeError: Type contract Contract2 is not implicitly convertible to expected type address.
address newContract = new Contract2(minimum,msg.sender);
I have another contract called Contract2 which I want to access inside NewContract.
contract Contract2{
//some variable declarations and some codes here......
and I have the constructor as below
constructor (uint minimum,address creator) public{
manager=creator;
minimumContribution=minimum;
}