I have problem with smart contract development using solidity. i have two smart contracts such as Factory contract and Contract contract. Here is my code.
Contract Factory {
address[] newContracts;
function createContract(uint num) {
address newContract = new Contract(num);
newContracts.push(newContract);
}
function getContract() view public returns(address[]) {
return newContracts;
}
function getNum(address _add) view public returns(uint) {
return Contract(_add).getNum();
}
}
contract Contract {
uint public Num;
function Contract(uint num) {
Num = num;
}
function getNum() public returns(uint) {
return Num;
}
}
I create the Factory contract in private blockchain. I call the createContract and getContract function, it works normally but when i call the getNum function i can not get the number. Thank you for your answer!
getNum()a view. - Adam Kipnis