In my DAPP I have 3 contracts where I want to do something like this.
pragma solidity ^0.4.13;
import "./z2.sol";
contract z1 {
uint example;
function z1 (){ example = 33;}
function createZ2() returns(z2){
z2 newZ2 = new z2();
return newZ2;
}
function getZ1example() returns(uint){
return example;
}
}
In z1, I want to return a z2 contract.
pragma solidity ^0.4.13;
import "./z3.sol";
contract z2 is z3{
function z2 (){}
function createZ3() returns(z3){
z3 newZ3 = new z3();
return newZ3;
}
}
In z2, I want to return a z3 contract.
pragma solidity ^0.4.13;
import "./z1.sol";
contract z3 is z1 {
function z3 (){}
function getZ3example() returns(uint){
return (z1.getZ1example());
}
}
In z3, I want to call a function from z1 contract.
I'm trying this on Remix and I get "TypeError: Definition of base has to precede definition of derived contract."
Any idea how can I solve this? Thanks!