provable-things / ethereum-api

Provable API for Ethereum smart contracts
https://docs.provable.xyz/#ethereum
MIT License
801 stars 427 forks source link

Incompatible SOLC warning #79

Closed benjamin852 closed 5 years ago

benjamin852 commented 5 years ago

Hey Folks. Super new to this anyone know why I'm getting this error in Remix? / INCOMPATIBLE SOLC: import the following instead: "github.com/oraclize/ethereum-api/oraclizeAPI_0.4.sol" / function f(bytes calldata x) external;

my solidity version is pragma solidity ^0.4.25 and my github import statement is just below perhaps the bug is here somwhere? import "github.com/oraclize/ethereum-api/oraclizeAPI.sol";

I get the same bug when i use solidity 0.5.1 so that doesn't solve it.

I'm not doing anything too intense just trying to follow this tutorial from youtube https://www.youtube.com/watch?v=J05DBPdkeAo

Thank You and happy provide the rest of my code if anyone needs it to help me solve the bug!

D-Nice commented 5 years ago

Hello and welcome.

Regarding your specific issue, you can continue to use solc 0.4.x, but you will have to change your import statement from

import "github.com/oraclize/ethereum-api/oraclizeAPI.sol"; (supporting only solc 0.5.x +)

to

import "github.com/oraclize/ethereum-api/oraclizeAPI_0.4.sol"

which supports solc 0.4.1 to 0.4.25

or you can also change it to target your specific version of 0.4.25 by replacing the oraclize API import statement with

import "github.com/oraclize/ethereum-api/oraclizeAPI_0.4.25.sol"

The incompatible solc warning is something we've built-in, to warn users when an older solc is detected, and point them in the right direction of adjusting their import statement, to import the appropriate api for their needs. The base one you use, will always target the latest major version (0.5 in this case).