Guest User

Untitled

a guest
Dec 17th, 2017
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. contract Foo {
  2. function Foo() {}
  3.  
  4. function chop() public returns (bytes32)
  5. {
  6. return "Chop!!!";
  7. }
  8. }
  9.  
  10. contract Bar {
  11. // Foo bytecode will be compiled into Bar's bytecode
  12. Foo public foo = new Foo();
  13.  
  14. // Foo bytecode will be loaded into memory from an existing Foo deployment
  15. Foo public foo2 = Foo(0xF00BAA...);
  16.  
  17. // An address primitive to cast;
  18. address public hoo;
  19.  
  20. // Internal calls can pass complex types
  21. function kungFoo(Foo sumFoo) internal {
  22. sumFoo.chop();
  23. }
  24.  
  25. // External calls ca pass basic types
  26. function kungHoo(address sumHoo) public {
  27. hoo = sumHoo;
  28. Foo(hoo).chop();
  29. }
  30. }
Add Comment
Please, Sign In to add comment