I wrote two contract, the first Contract1 have a simple function, and the second Contract2 's constructor receive a Contract1 address and call the simple function.
I create Contract1 address, then use this address to create Contract2.
I found I can create Contract2 's address right in remix javascript vm, but fail in private net.
pragma solidity ^0.4.18;
contract Contract1{
function simple() external view returns (bool) {
return true;
}
}
contract Contract2{
bool public result;
constructor(address contract1Address) public {
Contract1 contract1 = Contract1(contract1Address);
result = contract1.simple();
}
}