Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract Factory {
- // ...
- function newChild() returns (address) {
- Child c = new Child();
- return c;
- }
- // ...
- }
- contract Child_v1 {
- // ...
- public getVersion() constant returns (uint) {
- return 1;
- }
- }
- contract Child_v2 {
- // ...
- public getVersion() constant returns (uint) {
- return 2;
- }
- }
- contract Factory {
- // ...
- function newChild() returns (address){
- Child c = new Child(); // should use bytecode as provided below
- return c;
- }
- function setChildCode(bytes[] bytecode) {
- // Some magic that updates the bytecode used in newChild() above
- }
- }
Add Comment
Please, Sign In to add comment