Guest User

Untitled

a guest
Nov 21st, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. contract Factory {
  2. // ...
  3. function newChild() returns (address) {
  4. Child c = new Child();
  5. return c;
  6. }
  7. // ...
  8. }
  9.  
  10. contract Child_v1 {
  11. // ...
  12. public getVersion() constant returns (uint) {
  13. return 1;
  14. }
  15. }
  16.  
  17. contract Child_v2 {
  18. // ...
  19. public getVersion() constant returns (uint) {
  20. return 2;
  21. }
  22. }
  23.  
  24. contract Factory {
  25. // ...
  26. function newChild() returns (address){
  27. Child c = new Child(); // should use bytecode as provided below
  28. return c;
  29. }
  30. function setChildCode(bytes[] bytecode) {
  31. // Some magic that updates the bytecode used in newChild() above
  32. }
  33. }
Add Comment
Please, Sign In to add comment