Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- contract Foo {
- function Foo() {}
- function chop() public returns (bytes32)
- {
- return "Chop!!!";
- }
- }
- contract Bar {
- // Foo bytecode will be compiled into Bar's bytecode
- Foo public foo = new Foo();
- // Foo bytecode will be loaded into memory from an existing Foo deployment
- Foo public foo2 = Foo(0xF00BAA...);
- // An address primitive to cast;
- address public hoo;
- // Internal calls can pass complex types
- function kungFoo(Foo sumFoo) internal {
- sumFoo.chop();
- }
- // External calls ca pass basic types
- function kungHoo(address sumHoo) public {
- hoo = sumHoo;
- Foo(hoo).chop();
- }
- }
Add Comment
Please, Sign In to add comment