Is it possible to deploy contracts from within contracts, using something like
p.recipient.call.value(p.amount * 1 ether)(bytecode);
This article says so, https://blog.ethereum.org/2015/12/04/ethereum-in-practice-part-2-how-to-build-a-better-democracy-in-under-a-100-lines-of-code/
Can it get any better than this? Actually, it can. On our next post we will explore how you can use “transactionBytecode” to allow the DAO to execute any kind of ethereum transaction, even owning or creating other contracts.
But when I try create a contract by sending the bytecode without an address field, the transaction is sent to 0x0000000000000000000000000000000000000000 but no contract is created.
UPDATE:
Show us your code! We can't usefully help if we can't see what you're trying. – Nick Johnson
In the ethereum.org/dao framework, doing new proposal,
bytes32 transactionBytecode = 0x606060405260068060106000396000f3606060405200
newProposal(transactionBytecode)
to create contract
contract MyContract {
/* Constructor */
function MyContract() {
}
}
The bytecode should create a new contract, but no contract is created. If I do the same transaction from a human account, it deploys a contract.
p.recipient.call.value(p.amount * 1 ether)(bytecode);
– dor May 25 '16 at 10:42transactionBytecode
come from? – Nick Johnson May 25 '16 at 10:56transactionBytecode
in a proposal, and left beneficiary empty, and exectued to proposal which sent it with the .call command to0x0000000000000000000000000000000000000000
But I see no new contract. When I sent the same bytecode from a human account and left theto
address empty, it creates a contract. – dor May 25 '16 at 13:10