I'm trying to implement factory contracts in Mix but can't get the child to create and return an address.
I deploy Factory
but when I try to call the creator function,
contracts['Factory'].contract.Create(10)
Mix throws:
JavaScript error 14:18:06 web3.js - line 3881 - Uncaught invalid address
contract Gizmo
{
int public value;
function Gizmo(int v) {
value = v;
}
}
contract Factory
{
address gizmoAddr;
function Create(int _value) returns (address) {
gizmoAddr = new Gizmo(_value);
return gizmoAddr;
}
}