Skip to content

Instantly share code, notes, and snippets.

@pirapira
Created September 14, 2016 12:28
Show Gist options
  • Select an option

  • Save pirapira/9fb9cb3166d22cb0337b02de2e8d1b1f to your computer and use it in GitHub Desktop.

Select an option

Save pirapira/9fb9cb3166d22cb0337b02de2e8d1b1f to your computer and use it in GitHub Desktop.
> src0 = "contract Events { function getEvent(bytes32 eventHash) returns (int a, int b, int c, int d, int e) {}}"
> src1 = "contract Events { function getEvent(bytes32 eventHash) returns (int a, int b, int c, int d, int e);} contract test { function foo(address addr) { Events events = Events(addr); var (,,,,) = events.getEvent(0); } }"
> admin.setSolc("./src/solidity/build-develop/solc/solc")
> eth.compile.solidity(src0)
> contracts0 = eth.compile.solidity(src0)
> contracts1 = eth.compile.solidity(src1)
> ConcreteEvents = eth.contract(contracts0.Events.info.abiDefinition)
> concrete_events = ConcreteEvents.new({from: primary, data: contracts0.Events.code})
> receipt0 = eth.getTransactionReceipt(concrete_events.transactionHash)
> address0 = receipt0.contractAddress
> User = eth.contract(contracts1.test.info.abiDefinition)
> user = User.new({from: primary, data: contracts1.test.code})
> receipt1 = eth.getTransactionReceipt(user.transactionHash)
> address1 = receipt1.contractAddress
> user_contract = User.at(address1)
> user_contract.foo(address0)
[]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment