2

I tried running a contract with the code below inserted on the ethereum browser and it complied successfully. I tried it on the Ethereum wallet and its giving an error of source not found.

import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";

I need it to work on the Ethereum wallet as I do not know how to interact with contracts using the browser solidity or command line. Thanks

1

This will work in Browser Solidity because:

The browser-based compiler provides an automatic remapping for github and will also automatically retrieve the file over the network.

This won't work in Mist, or anywhere else, without mapping in the external sources first. The general outline (you might need to tweak it a bit):

  1. Clone github.com/oraclize/ethereum-api/ to a local directory, e.g. /usr/local/ethereum-api/.
  2. Import, e.g. import "github.com/oraclize/ethereum-api/oraclizeAPI.sol" as oracle;
  3. Compile while specifying the mapping: solc github.com/oraclize/ethereum-api/=/usr/local/ethereum-api/ source.sol

This is covered in the Solidity documentation under the Use In Actual Compilers section.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.