I'm trying to develop a contract that creates a contract (factory/worker, faucet pattern). Think my issue may be with the tools I'm using:
- testrpc (local blockchain)
- Remix Browser Solidity (connected to testrpc)
- MetaMask (for watching transactions, balances etc)
- truffle (for deployment/migration)
When I deploy my contracts using truffle, I can see the transaction and contract address immediately in testrpc
:
Transaction: 0x153a84e6478df590deb21a95cd9042dd5820e838ac14986fb47a8b13df34bd1b
Contract created: 0x7a5812ba512df41432ed408ed0a1b266aa8a27dc
Gas usage: 0x094d2a
Block Number: 0x49
Block Time: Tue Mar 21 2017 19:30:56 GMT+0000 (GMT)
However, when I get my Factory contract to create a contract I can only get the transaction - yet using Event
's for logging I can see an address, but can't interact with it. Also testrpc
reports the transaction but no contract address:
Transaction: 0x2984356f7ea77ac86f6dee92472736a682061fbeab7de335bc4a6aa7ed66462b
Gas usage: 0x0532a9
Block Number: 0x4c
Block Time: Tue Mar 21 2017 19:30:59 GMT+0000 (GMT)
It seems that testrpc
isn't mining, I've tried adding the switch -b 1
, but still same effect. Also I've tried the demo from embark, when I fire it up the framework deploys contracts successfully, as with truffle, but when I try their dapp transactions get created but never mined.
Factory contract
pragma solidity ^0.4.2;
import './Bar.sol';
contract Foo{
function createBar(){
Bar bar = new Bar();
}
}
Worker / Child contract
pragma solidity ^0.4.2;
contract Bar{
}
The issue also persists with embark framework, where the frame work can create contracts but I can't. Seems like their not being mined?