Is this even possible (I remember I read somewhere that only normal
accounts can send contract creating transactions)?
This is definitely possible.
When I invoke this method from contract, the address I receive seems
to be normal address and not contract.
I'm not sure which address you are talking about.
This kind of design works well:
contract Factory {
address[] newContracts;
function createContract (bytes32 name) {
address newContract = new Contract(name);
newContracts.push(newContract);
}
}
contract Contract {
bytes32 public Name;
function Contract (bytes32 name) {
Name = name;
}
}
In the array newContracts, you will have the addresses of the Contracts created by the factory.
Then if you want to call the Name from the first Contract created in the Factory contract, you should use :
con.Name();
after having defined
Contract con = Contract(newContracts[0]);